shareneus 1.4.49 → 1.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.js +1 -1
- package/dist/accounting/counter-sales/sales-receipt-pdf.service.js +1 -1
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +1 -1
- package/dist/accounting/credit-note/credit-note-pdf.service.js +1 -1
- package/dist/accounting/debit-note/debit-note-print.service.js +1 -1
- package/dist/accounting/invoice/inv-pdf.service.js +13 -12
- package/dist/accounting/invoice/inv-print.service.js +6 -6
- package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +1 -1
- package/dist/accounting/invoice/invoice-landscape-pdf.service.js +7 -6
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +13 -12
- package/dist/accounting/invoice/invoice-portrait-pdf.d.ts +5 -5
- package/dist/accounting/invoice/invoice-portrait-pdf.js +31 -30
- package/dist/accounting/invoice/invoice-total.service.js +1 -1
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +8 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +14 -14
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +10 -10
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +14 -13
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +8 -8
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +12 -11
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +12 -11
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +11 -10
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +19 -18
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +11 -11
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +11 -11
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +13 -12
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +14 -13
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +10 -10
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +13 -12
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +14 -14
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +14 -14
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +14 -13
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +8 -8
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +12 -11
- package/dist/accounting/invoice/shared-inv-pdf.service.js +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.d.ts +4 -4
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +9 -9
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.d.ts +5 -5
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +11 -11
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +3 -3
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +10 -10
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +3 -3
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +7 -7
- package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +4 -4
- package/dist/gst/excel/GSTR-RO-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR-RO-excel.service.js +8 -8
- package/dist/gst/excel/GSTR1-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR1-excel.service.js +10 -10
- package/dist/gst/excel/GSTR2-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR2-excel.service.js +9 -9
- package/dist/gst/excel/tally-sales-import.service.d.ts +4 -4
- package/dist/gst/excel/tally-sales-import.service.js +8 -8
- package/dist/inventory/items/issue-parts-pdf.service.d.ts +6 -6
- package/dist/inventory/items/issue-parts-pdf.service.js +33 -33
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +11 -10
- package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +8 -8
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +8 -8
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +12 -12
- package/dist/inventory/items/reports/excel/stock-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/stock-excel.service.js +8 -8
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +2 -2
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +8 -7
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.d.ts +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +9 -9
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.d.ts +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +9 -9
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.d.ts +4 -4
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +9 -9
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.d.ts +6 -6
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +14 -14
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +3 -3
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +8 -8
- package/dist/purchases/purchase-order/purchase-order-pdf.service.js +5 -5
- package/dist/purchases/purchase-order/purchase-order-print.service.d.ts +2 -2
- package/dist/purchases/purchase-order/purchase-order-print.service.js +25 -25
- package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.js +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +20 -20
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +8 -8
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +31 -32
- package/dist/purchases/vendor-debit-note/vendor-debit-note-pdf.service.js +1 -1
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +6 -6
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +19 -19
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.d.ts +1 -1
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +7 -6
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +2 -2
- package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +6 -6
- package/dist/sales/delivery-challan/delivery-challan-totals.js +20 -20
- package/dist/sales/sales/sales-pdf.service.js +1 -1
- package/dist/sales/sales/sales-print.service.js +7 -7
- package/dist/sales/sales/sales-totals.service.d.ts +6 -6
- package/dist/sales/sales/sales-totals.service.js +19 -19
- package/dist/services/est.print-service.js +1 -1
- package/dist/services/reports/excel/insurance-expire-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/insurance-expire-excel.service.js +8 -8
- package/dist/services/reports/excel/next-service-date-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/next-service-date-excel.service.js +8 -8
- package/dist/services/reports/excel/repair-orders-excel.service.d.ts +5 -5
- package/dist/services/reports/excel/repair-orders-excel.service.js +11 -11
- package/dist/services/reports/pdf/repair-orders-pdf.service.d.ts +4 -4
- package/dist/services/reports/pdf/repair-orders-pdf.service.js +9 -9
- package/dist/services/ro-pdf.service.js +2 -2
- package/dist/services/ro-print-service.js +1 -1
- package/dist/services/ro-totals.service.d.ts +11 -11
- package/dist/services/ro-totals.service.js +50 -50
- package/dist/services/separate-wo-print.service.js +1 -1
- package/dist/shared/shared-pdf.service.d.ts +3 -3
- package/dist/shared/shared-pdf.service.js +31 -30
- package/dist/utils/tr-utils.d.ts +1 -1
- package/dist/utils/tr-utils.js +3 -2
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ exports.VenBalanceXlsxFileService = void 0;
|
|
|
27
27
|
const XLSX = __importStar(require("xlsx"));
|
|
28
28
|
const tr_utils_1 = require("../../../../utils/tr-utils");
|
|
29
29
|
class VenBalanceXlsxFileService {
|
|
30
|
-
static GetInvoiceWiseExcelData(MainData) {
|
|
30
|
+
static GetInvoiceWiseExcelData(MainData, EntitySettings) {
|
|
31
31
|
this.wb = {};
|
|
32
32
|
this.ws = {};
|
|
33
33
|
this.Row = 0;
|
|
@@ -40,7 +40,7 @@ class VenBalanceXlsxFileService {
|
|
|
40
40
|
this.wb.SheetNames = [];
|
|
41
41
|
// MainData = this.GetTotals(MainData, WOTypes);
|
|
42
42
|
// this.setHeadingInCell();
|
|
43
|
-
this.setInvoiceDetailsInCell(MainData);
|
|
43
|
+
this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
|
|
44
44
|
this.ws['!ref'] = XLSX.utils.encode_range(this.range);
|
|
45
45
|
this.ws['!merges'] = this.MergeArray;
|
|
46
46
|
this.wb.SheetNames.push(ws_name);
|
|
@@ -128,7 +128,7 @@ class VenBalanceXlsxFileService {
|
|
|
128
128
|
});
|
|
129
129
|
this.Row += 1;
|
|
130
130
|
}
|
|
131
|
-
static setHeading1InCell(Name) {
|
|
131
|
+
static setHeading1InCell(Name, DecimalsNumber) {
|
|
132
132
|
let InvoiceData = [
|
|
133
133
|
{
|
|
134
134
|
text: Name,
|
|
@@ -138,7 +138,7 @@ class VenBalanceXlsxFileService {
|
|
|
138
138
|
];
|
|
139
139
|
let ColStart = 0;
|
|
140
140
|
InvoiceData.forEach((InvData) => {
|
|
141
|
-
InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
|
|
141
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
142
142
|
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
143
143
|
this.MergeArray.push({
|
|
144
144
|
s: { r: this.Row, c: ColStart },
|
|
@@ -148,7 +148,7 @@ class VenBalanceXlsxFileService {
|
|
|
148
148
|
});
|
|
149
149
|
this.Row += 1;
|
|
150
150
|
}
|
|
151
|
-
static setInvoiceFinalRowInCell(Due) {
|
|
151
|
+
static setInvoiceFinalRowInCell(Due, DecimalsNumber) {
|
|
152
152
|
let InvoiceData = [
|
|
153
153
|
{
|
|
154
154
|
text: 'Total Due',
|
|
@@ -163,7 +163,7 @@ class VenBalanceXlsxFileService {
|
|
|
163
163
|
];
|
|
164
164
|
let ColStart = 3;
|
|
165
165
|
InvoiceData.forEach((InvData) => {
|
|
166
|
-
InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
|
|
166
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
167
167
|
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
168
168
|
this.MergeArray.push({
|
|
169
169
|
s: { r: this.Row, c: ColStart },
|
|
@@ -173,9 +173,9 @@ class VenBalanceXlsxFileService {
|
|
|
173
173
|
});
|
|
174
174
|
this.Row += 1;
|
|
175
175
|
}
|
|
176
|
-
static setInvoiceDetailsInCell(MainData) {
|
|
176
|
+
static setInvoiceDetailsInCell(MainData, DecimalsNumber) {
|
|
177
177
|
MainData.forEach((Record) => {
|
|
178
|
-
this.setHeading1InCell(Record.Name);
|
|
178
|
+
this.setHeading1InCell(Record.Name, DecimalsNumber);
|
|
179
179
|
// this.MergeArray.push({
|
|
180
180
|
// s: { r: this.Row, c: ColStart },
|
|
181
181
|
// e: { r: this.Row, c: ColStart + InvData.ColRange - 1 },
|
|
@@ -183,15 +183,15 @@ class VenBalanceXlsxFileService {
|
|
|
183
183
|
// ColStart += InvData.ColRange;
|
|
184
184
|
this.setHeadingInCell();
|
|
185
185
|
Record.Bills.forEach((Invoice, index) => {
|
|
186
|
-
this.SetInvoiceDataInExcel(Invoice, index);
|
|
186
|
+
this.SetInvoiceDataInExcel(Invoice, index, DecimalsNumber);
|
|
187
187
|
if (Record.Bills.length === (index + 1)) {
|
|
188
|
-
this.setInvoiceFinalRowInCell(Record.Balance);
|
|
188
|
+
this.setInvoiceFinalRowInCell(Record.Balance, DecimalsNumber);
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
this.Row += 1;
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
static SetInvoiceDataInExcel(BillInfo, index) {
|
|
194
|
+
static SetInvoiceDataInExcel(BillInfo, index, DecimalsNumber) {
|
|
195
195
|
// BillInfo.CrDate = this.ConvertDateToReadableFormat(BillInfo.CrDate);
|
|
196
196
|
BillInfo.CrDate = this.ConvertDateToReadableFormat(BillInfo.CrDate);
|
|
197
197
|
let InvoiceData = [
|
|
@@ -203,7 +203,7 @@ class VenBalanceXlsxFileService {
|
|
|
203
203
|
];
|
|
204
204
|
let ColStart = 0;
|
|
205
205
|
InvoiceData.forEach((InvData) => {
|
|
206
|
-
InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
|
|
206
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
207
207
|
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
208
208
|
this.MergeArray.push({
|
|
209
209
|
s: { r: this.Row, c: ColStart },
|
|
@@ -213,7 +213,7 @@ class VenBalanceXlsxFileService {
|
|
|
213
213
|
});
|
|
214
214
|
this.Row += 1;
|
|
215
215
|
}
|
|
216
|
-
static ConvertToString(Text, IsString) {
|
|
216
|
+
static ConvertToString(Text, IsString, DecimalsNumber) {
|
|
217
217
|
if (IsString) {
|
|
218
218
|
if (Text == null) {
|
|
219
219
|
Text = '';
|
|
@@ -225,7 +225,7 @@ class VenBalanceXlsxFileService {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
if (typeof Text === 'number') {
|
|
228
|
-
return Number(tr_utils_1.TrUtils.FixedTo(Text));
|
|
228
|
+
return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
|
|
229
229
|
}
|
|
230
230
|
else {
|
|
231
231
|
return Text;
|
|
@@ -205,8 +205,8 @@ export declare class VendorBalancesService {
|
|
|
205
205
|
};
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
|
-
static GetBillDataTable(BillData: any): any;
|
|
209
|
-
static GetItemsTable(billData: any): {
|
|
208
|
+
static GetBillDataTable(BillData: any, DecimalsNumber: number): any;
|
|
209
|
+
static GetItemsTable(billData: any, DecimalsNumber: number): {
|
|
210
210
|
style: string;
|
|
211
211
|
marginTop: number;
|
|
212
212
|
marginBottom: number;
|
|
@@ -222,6 +222,6 @@ export declare class VendorBalancesService {
|
|
|
222
222
|
vLineColor: (i: any, node: any) => string;
|
|
223
223
|
};
|
|
224
224
|
};
|
|
225
|
-
static BuildTableBodyForLaborAndParts(billData: any): any;
|
|
225
|
+
static BuildTableBodyForLaborAndParts(billData: any, DecimalsNumber: number): any;
|
|
226
226
|
static GetHeaderNames(): any;
|
|
227
227
|
}
|
|
@@ -20,18 +20,18 @@ class VendorBalancesService {
|
|
|
20
20
|
{ text: 'As of ' + my_date_1.MyDate.ConvertUTCDateToReadable(my_date_1.MyDate.GetDateTimeNowInUTC(EntityData.Entity.User.TZ)),
|
|
21
21
|
alignment: 'center', fontSize: 10 },
|
|
22
22
|
// SharedPDFService.HeaderAfterLine(),
|
|
23
|
-
this.GetBillDataTable(BillData),
|
|
23
|
+
this.GetBillDataTable(BillData, EntityData.Entity.Settings.DecimalsNumber),
|
|
24
24
|
],
|
|
25
25
|
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
26
26
|
};
|
|
27
27
|
return dd;
|
|
28
28
|
}
|
|
29
|
-
static GetBillDataTable(BillData) {
|
|
29
|
+
static GetBillDataTable(BillData, DecimalsNumber) {
|
|
30
30
|
let Data = [];
|
|
31
31
|
let OveralDue = 0;
|
|
32
32
|
BillData.forEach((bill) => {
|
|
33
33
|
OveralDue = OveralDue + bill.Balance;
|
|
34
|
-
Data.push(this.GetItemsTable(bill));
|
|
34
|
+
Data.push(this.GetItemsTable(bill, DecimalsNumber));
|
|
35
35
|
});
|
|
36
36
|
Data.push({
|
|
37
37
|
style: 'tableExample',
|
|
@@ -43,7 +43,7 @@ class VendorBalancesService {
|
|
|
43
43
|
});
|
|
44
44
|
return Data;
|
|
45
45
|
}
|
|
46
|
-
static GetItemsTable(billData) {
|
|
46
|
+
static GetItemsTable(billData, DecimalsNumber) {
|
|
47
47
|
return {
|
|
48
48
|
style: 'tableExample',
|
|
49
49
|
marginTop: 3,
|
|
@@ -51,7 +51,7 @@ class VendorBalancesService {
|
|
|
51
51
|
table: {
|
|
52
52
|
widths: [50, '*', 150, 100, 100],
|
|
53
53
|
headerRows: 2,
|
|
54
|
-
body: this.BuildTableBodyForLaborAndParts(billData)
|
|
54
|
+
body: this.BuildTableBodyForLaborAndParts(billData, DecimalsNumber)
|
|
55
55
|
},
|
|
56
56
|
layout: {
|
|
57
57
|
hLineWidth: function (i, node) {
|
|
@@ -69,7 +69,7 @@ class VendorBalancesService {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
static BuildTableBodyForLaborAndParts(billData) {
|
|
72
|
+
static BuildTableBodyForLaborAndParts(billData, DecimalsNumber) {
|
|
73
73
|
let body = this.GetHeaderNames();
|
|
74
74
|
let Row = [{ text: billData.Name, alignment: 'left', colSpan: 5, bold: true, fontSize: 12 }, {}, {}, {}, {}];
|
|
75
75
|
body.unshift(Row);
|
|
@@ -78,8 +78,8 @@ class VendorBalancesService {
|
|
|
78
78
|
dataRow.push({ text: index + 1 });
|
|
79
79
|
dataRow.push({ text: bill.BNo });
|
|
80
80
|
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadable(bill.CrDate), alignment: 'center', style: ['headerstyle'], });
|
|
81
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(bill.Total), alignment: 'right', style: ['headerstyle'], });
|
|
82
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(bill.Due), alignment: 'right', style: ['headerstyle'], });
|
|
81
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(bill.Total, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
|
|
82
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(bill.Due, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
|
|
83
83
|
body.push(dataRow);
|
|
84
84
|
if (billData.Bills.length === (index + 1)) {
|
|
85
85
|
let Row = [{ text: 'Total Due ', alignment: 'right', colSpan: 4, bold: true, fontSize: 12 }, {}, {}, {}, { text: tr_utils_1.TrUtils.FixPriceValue(billData.Balance), fontSize: 12, alignment: 'right', bold: true }];
|
|
@@ -735,7 +735,7 @@ class PurchaseOrderPDFService {
|
|
|
735
735
|
];
|
|
736
736
|
let total = {
|
|
737
737
|
name: 'Total',
|
|
738
|
-
value: tr_utils_1.TrUtils.FixPriceValue(OverAllRecordTotal)
|
|
738
|
+
value: tr_utils_1.TrUtils.FixPriceValue(OverAllRecordTotal, RecordData.Entity.DecimalsNumber)
|
|
739
739
|
};
|
|
740
740
|
let Rounding = { name: 'Rounding', value: Rounded };
|
|
741
741
|
let FinalTotal = { name: 'Total', value: GrandTotal };
|
|
@@ -743,22 +743,22 @@ class PurchaseOrderPDFService {
|
|
|
743
743
|
Rounding.value = '+' + Rounding.value;
|
|
744
744
|
}
|
|
745
745
|
if (!tr_utils_1.TrUtils.IsFixedZero(SubTotal)) {
|
|
746
|
-
AccountFields.push({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(SubTotal) });
|
|
746
|
+
AccountFields.push({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(SubTotal, RecordData.Entity.DecimalsNumber) });
|
|
747
747
|
}
|
|
748
748
|
if (!tr_utils_1.TrUtils.IsEmpty(PartsDiscTotal) && !moreDiscDetails) {
|
|
749
749
|
AccountFields.push({ name: 'Discount', value: '-' + PartsDiscTotal });
|
|
750
750
|
}
|
|
751
751
|
else {
|
|
752
|
-
AccountFields.push({ name: 'Overall Discount', value: '-' + tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
|
|
752
|
+
AccountFields.push({ name: 'Overall Discount', value: '-' + tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc, RecordData.Entity.DecimalsNumber) });
|
|
753
753
|
}
|
|
754
754
|
if (!tr_utils_1.TrUtils.IsEmpty(TaxTotal)) {
|
|
755
755
|
AccountFields.push({ name: 'Total Tax', value: TaxTotal });
|
|
756
756
|
}
|
|
757
757
|
if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
|
|
758
758
|
if (Adj > 0) {
|
|
759
|
-
Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
|
|
759
|
+
Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj, RecordData.Entity.DecimalsNumber);
|
|
760
760
|
}
|
|
761
|
-
AccountFields.push({ name: 'Adjust', value: tr_utils_1.TrUtils.FixPriceValue(Adj) });
|
|
761
|
+
AccountFields.push({ name: 'Adjust', value: tr_utils_1.TrUtils.FixPriceValue(Adj, RecordData.Entity.DecimalsNumber) });
|
|
762
762
|
}
|
|
763
763
|
AccountFields.push(total);
|
|
764
764
|
AccountFields.push(Rounding);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare class PurchaseOrderPrintService {
|
|
2
2
|
static GetDataForPurchaseOrderPrint(argPurchaseOrderData: any, EntityData: any, image: any, VendorData: any, TaxCodes: any, IsFormPO: boolean): any;
|
|
3
|
-
static GetLaborPrintInfo(LaborList: any, TaxCodes: any, LineTotal: string): any;
|
|
3
|
+
static GetLaborPrintInfo(LaborList: any, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
4
4
|
static GetVendorDataForPrint(argVendorData: any): any;
|
|
5
5
|
static GetQtyWithUoM(Items: any): any;
|
|
6
6
|
static ConcatTotalsInfo(PurchaseOrderPDFData: any, DetailedTotalsInfo: any): any;
|
|
7
|
-
static FixPriceValuesForPrint(PrintData: any, TaxCodes: any): any;
|
|
7
|
+
static FixPriceValuesForPrint(PrintData: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
8
8
|
}
|
|
@@ -40,13 +40,13 @@ class PurchaseOrderPrintService {
|
|
|
40
40
|
PurchaseOrderPDFData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(PurchaseOrderData.CrDate);
|
|
41
41
|
PurchaseOrderPDFData.DeDate = my_date_1.MyDate.ConvertUTCDateToReadable(PurchaseOrderData.DeDate);
|
|
42
42
|
}
|
|
43
|
+
PurchaseOrderPDFData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, code_enums_1.PrintTypesEnum.PurOrder, PurchaseOrderData);
|
|
43
44
|
PurchaseOrderPDFData.Items = tr_utils_1.TrUtils.Stringify(PurchaseOrderData.Items);
|
|
44
45
|
PurchaseOrderPDFData.Ops = tr_utils_1.TrUtils.Stringify(PurchaseOrderData.Ops);
|
|
45
46
|
if (!tr_utils_1.TrUtils.IsNull(PurchaseOrderPDFData.Ops)) {
|
|
46
|
-
PurchaseOrderPDFData.Ops = this.GetLaborPrintInfo(PurchaseOrderPDFData.Ops, TaxCodes, 'AT');
|
|
47
|
+
PurchaseOrderPDFData.Ops = this.GetLaborPrintInfo(PurchaseOrderPDFData.Ops, TaxCodes, 'AT', PurchaseOrderPDFData.Entity.DecimalsNumber);
|
|
47
48
|
}
|
|
48
49
|
// PurchaseOrderPDFData.Items = this.GetPartsDescription(PurchaseOrderPDFData.Items);
|
|
49
|
-
PurchaseOrderPDFData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, code_enums_1.PrintTypesEnum.PurOrder, PurchaseOrderData);
|
|
50
50
|
PurchaseOrderPDFData.Items = this.GetQtyWithUoM(PurchaseOrderPDFData.Items);
|
|
51
51
|
let DetailedTotalsInfo;
|
|
52
52
|
if (IsFormPO) {
|
|
@@ -69,16 +69,16 @@ class PurchaseOrderPrintService {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
PurchaseOrderPDFData.Vendor = this.GetVendorDataForPrint(tr_utils_1.TrUtils.Stringify(VendorData));
|
|
72
|
-
PurchaseOrderPDFData = this.FixPriceValuesForPrint(PurchaseOrderPDFData, TaxCodes);
|
|
72
|
+
PurchaseOrderPDFData = this.FixPriceValuesForPrint(PurchaseOrderPDFData, TaxCodes, PurchaseOrderPDFData.Entity.DecimalsNumber);
|
|
73
73
|
return PurchaseOrderPDFData;
|
|
74
74
|
}
|
|
75
|
-
static GetLaborPrintInfo(LaborList, TaxCodes, LineTotal) {
|
|
75
|
+
static GetLaborPrintInfo(LaborList, TaxCodes, LineTotal, DecimalsNumber) {
|
|
76
76
|
LaborList.forEach((Labor) => {
|
|
77
77
|
Labor.HSN = Labor.SAC;
|
|
78
78
|
if (tr_utils_1.TrUtils.IsNull(Labor.Qty)) {
|
|
79
79
|
Labor.Qty = 1;
|
|
80
80
|
}
|
|
81
|
-
Labor.UnCo = tr_utils_1.TrUtils.FixPriceValue(Labor.UnCo);
|
|
81
|
+
Labor.UnCo = tr_utils_1.TrUtils.FixPriceValue(Labor.UnCo, DecimalsNumber);
|
|
82
82
|
// Labor.TaxName = this.getTaxName(Labor.TCode, TaxCodes);
|
|
83
83
|
if (!tr_utils_1.TrUtils.IsEmpty(Labor.Perc)) {
|
|
84
84
|
Labor.DiscPerc = Labor.Perc;
|
|
@@ -87,9 +87,9 @@ class PurchaseOrderPrintService {
|
|
|
87
87
|
Labor.DiscPerc = Labor.Perc;
|
|
88
88
|
Labor.DiscPerc = (0, aggregation_1.division)((0, aggregation_1.multiply)(100, Labor.Disc), Labor.UnCo);
|
|
89
89
|
}
|
|
90
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST);
|
|
91
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST);
|
|
92
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST);
|
|
90
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST, DecimalsNumber);
|
|
91
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST, DecimalsNumber);
|
|
92
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST, DecimalsNumber);
|
|
93
93
|
Labor.QtyAndUoM = Labor.Qty.toString();
|
|
94
94
|
Labor.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
95
95
|
Labor.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
@@ -152,18 +152,18 @@ class PurchaseOrderPrintService {
|
|
|
152
152
|
PurchaseOrderPDFData = tr_utils_1.TrUtils.ConcatObjects(PurchaseOrderPDFData, DetailedTotalsInfo);
|
|
153
153
|
return PurchaseOrderPDFData;
|
|
154
154
|
}
|
|
155
|
-
static FixPriceValuesForPrint(PrintData, TaxCodes) {
|
|
155
|
+
static FixPriceValuesForPrint(PrintData, TaxCodes, DecimalsNumber) {
|
|
156
156
|
PrintData.ShowDetailedPartTaxInfo = false;
|
|
157
157
|
PrintData.Items.forEach((Part) => {
|
|
158
158
|
if (tr_utils_1.TrUtils.IsNull(Part.UnCo)) {
|
|
159
159
|
Part.UnCo = Part.UnPr;
|
|
160
160
|
}
|
|
161
|
-
Part.UnCo = tr_utils_1.TrUtils.FixPriceValue(Part.UnCo);
|
|
162
|
-
Part.DiscountedPrice = tr_utils_1.TrUtils.FixPriceValue(Part.DiscountedPrice);
|
|
163
|
-
Part.AfterTax = tr_utils_1.TrUtils.FixPriceValue(Part.AfterTax);
|
|
164
|
-
Part.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.CGST);
|
|
165
|
-
Part.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.IGST);
|
|
166
|
-
Part.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.SGST);
|
|
161
|
+
Part.UnCo = tr_utils_1.TrUtils.FixPriceValue(Part.UnCo, DecimalsNumber);
|
|
162
|
+
Part.DiscountedPrice = tr_utils_1.TrUtils.FixPriceValue(Part.DiscountedPrice, DecimalsNumber);
|
|
163
|
+
Part.AfterTax = tr_utils_1.TrUtils.FixPriceValue(Part.AfterTax, DecimalsNumber);
|
|
164
|
+
Part.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.CGST, DecimalsNumber);
|
|
165
|
+
Part.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.IGST, DecimalsNumber);
|
|
166
|
+
Part.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.SGST, DecimalsNumber);
|
|
167
167
|
if (!tr_utils_1.TrUtils.CheckInvalidSelect(Part.TCode)) {
|
|
168
168
|
PrintData.ShowDetailedPartTaxInfo = true;
|
|
169
169
|
}
|
|
@@ -171,16 +171,16 @@ class PurchaseOrderPrintService {
|
|
|
171
171
|
Part.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
172
172
|
Part.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
173
173
|
});
|
|
174
|
-
PrintData.PartsDiscTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsDiscTotal);
|
|
175
|
-
PrintData.PartsTotalAfterDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsTotalAfterDisc);
|
|
176
|
-
PrintData.PartsTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsTotalBeforeDisc);
|
|
177
|
-
PrintData.TaxTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.TaxTotal);
|
|
178
|
-
PrintData.PartCGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartCGST);
|
|
179
|
-
PrintData.PartIGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartIGST);
|
|
180
|
-
PrintData.PartSGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartSGST);
|
|
181
|
-
PrintData.PartAfterTax = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartAfterTax);
|
|
182
|
-
PrintData.TotalRoundedBy = tr_utils_1.TrUtils.FixPriceValue(PrintData.TotalRoundedBy);
|
|
183
|
-
PrintData.RoundedTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.RoundedTotal);
|
|
174
|
+
PrintData.PartsDiscTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsDiscTotal, DecimalsNumber);
|
|
175
|
+
PrintData.PartsTotalAfterDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsTotalAfterDisc, DecimalsNumber);
|
|
176
|
+
PrintData.PartsTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartsTotalBeforeDisc, DecimalsNumber);
|
|
177
|
+
PrintData.TaxTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.TaxTotal, DecimalsNumber);
|
|
178
|
+
PrintData.PartCGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartCGST, DecimalsNumber);
|
|
179
|
+
PrintData.PartIGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartIGST, DecimalsNumber);
|
|
180
|
+
PrintData.PartSGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartSGST, DecimalsNumber);
|
|
181
|
+
PrintData.PartAfterTax = tr_utils_1.TrUtils.FixPriceValue(PrintData.PartAfterTax, DecimalsNumber);
|
|
182
|
+
PrintData.TotalRoundedBy = tr_utils_1.TrUtils.FixPriceValue(PrintData.TotalRoundedBy, DecimalsNumber);
|
|
183
|
+
PrintData.RoundedTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.RoundedTotal, DecimalsNumber);
|
|
184
184
|
return PrintData;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -792,7 +792,7 @@ class VendorCreditNotePDFService {
|
|
|
792
792
|
AccountFields.push({ name: 'SubTotal', value: SubTotal });
|
|
793
793
|
}
|
|
794
794
|
if (moreDiscDetails) {
|
|
795
|
-
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
|
|
795
|
+
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc, RecordData.Entity.DecimalsNumber) });
|
|
796
796
|
}
|
|
797
797
|
else {
|
|
798
798
|
AccountFields.push({ name: 'Discount', value: RecordData.Disc });
|
|
@@ -2,5 +2,5 @@ export declare class VendorCreditNotePrintService {
|
|
|
2
2
|
static GetDataForVendorCreditNotesPrint(argCNData: any, EntityData: any, image: any, IncludeGST: any, ConsolidateGST: any, TaxCodes: any): any;
|
|
3
3
|
static GetVendorDataForPrint(argVendorData: any): any;
|
|
4
4
|
static ConcatTotalsInfo(creditNotePDFData: any, DetailedTotalsInfo: any): any;
|
|
5
|
-
static FixPriceValuesForPrint(PrintData: any, TaxCodes: any): any;
|
|
5
|
+
static FixPriceValuesForPrint(PrintData: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
6
6
|
}
|
|
@@ -35,13 +35,13 @@ class VendorCreditNotePrintService {
|
|
|
35
35
|
creditNotePDFData.Items = tr_utils_1.TrUtils.Stringify(CNData.Items);
|
|
36
36
|
// creditNotePDFData.Items = this.GetPartsDescription(creditNotePDFData.Items);
|
|
37
37
|
let DetailedTotalsInfo;
|
|
38
|
-
DetailedTotalsInfo = vendor_credit_note_totals_service_1.VendorCreditNoteTotalsService.GetTotalsValue([], creditNotePDFData.Items, IsTaxable, true, creditNotePDFData.Disc, creditNotePDFData.Perc, TaxCodes, true, creditNotePDFData.Settings);
|
|
39
|
-
creditNotePDFData = this.ConcatTotalsInfo(creditNotePDFData, DetailedTotalsInfo);
|
|
40
38
|
creditNotePDFData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, code_enums_1.PrintTypesEnum.PurOrder, CNData);
|
|
39
|
+
DetailedTotalsInfo = vendor_credit_note_totals_service_1.VendorCreditNoteTotalsService.GetTotalsValue([], creditNotePDFData.Items, IsTaxable, true, creditNotePDFData.Disc, creditNotePDFData.Perc, TaxCodes, true, creditNotePDFData.Settings, creditNotePDFData.Entity);
|
|
40
|
+
creditNotePDFData = this.ConcatTotalsInfo(creditNotePDFData, DetailedTotalsInfo);
|
|
41
41
|
creditNotePDFData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(creditNotePDFData, EntityData, image);
|
|
42
42
|
creditNotePDFData.HeaderName = 'Vendor Credit Note';
|
|
43
43
|
creditNotePDFData.Vendor = this.GetVendorDataForPrint(tr_utils_1.TrUtils.Stringify(CNData.BFrom));
|
|
44
|
-
creditNotePDFData = this.FixPriceValuesForPrint(creditNotePDFData, TaxCodes);
|
|
44
|
+
creditNotePDFData = this.FixPriceValuesForPrint(creditNotePDFData, TaxCodes, creditNotePDFData.Entity);
|
|
45
45
|
return creditNotePDFData;
|
|
46
46
|
}
|
|
47
47
|
static GetVendorDataForPrint(argVendorData) {
|
|
@@ -73,15 +73,15 @@ class VendorCreditNotePrintService {
|
|
|
73
73
|
creditNotePDFData = tr_utils_1.TrUtils.ConcatObjects(creditNotePDFData, DetailedTotalsInfo);
|
|
74
74
|
return creditNotePDFData;
|
|
75
75
|
}
|
|
76
|
-
static FixPriceValuesForPrint(PrintData, TaxCodes) {
|
|
76
|
+
static FixPriceValuesForPrint(PrintData, TaxCodes, DecimalsNumber) {
|
|
77
77
|
PrintData.ShowDetailedPartTaxInfo = false;
|
|
78
78
|
PrintData.Items.forEach((Part) => {
|
|
79
|
-
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.Pr);
|
|
80
|
-
Part.DiscountedPrice = tr_utils_1.TrUtils.FixPriceValue(Part.DiscountedPrice);
|
|
81
|
-
Part.AfterTax = tr_utils_1.TrUtils.FixPriceValue(Part.AfterTax);
|
|
82
|
-
Part.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.CGST);
|
|
83
|
-
Part.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.IGST);
|
|
84
|
-
Part.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.SGST);
|
|
79
|
+
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.Pr, DecimalsNumber);
|
|
80
|
+
Part.DiscountedPrice = tr_utils_1.TrUtils.FixPriceValue(Part.DiscountedPrice, DecimalsNumber);
|
|
81
|
+
Part.AfterTax = tr_utils_1.TrUtils.FixPriceValue(Part.AfterTax, DecimalsNumber);
|
|
82
|
+
Part.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.CGST, DecimalsNumber);
|
|
83
|
+
Part.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.IGST, DecimalsNumber);
|
|
84
|
+
Part.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Part.SGST, DecimalsNumber);
|
|
85
85
|
if (!tr_utils_1.TrUtils.CheckInvalidSelect(Part.TCode)) {
|
|
86
86
|
PrintData.ShowDetailedPartTaxInfo = true;
|
|
87
87
|
}
|
|
@@ -89,16 +89,16 @@ class VendorCreditNotePrintService {
|
|
|
89
89
|
Part.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
90
90
|
Part.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
91
91
|
});
|
|
92
|
-
PrintData.PartsDiscTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsDiscTotal);
|
|
93
|
-
PrintData.PartsTotalAfterDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsTotalAfterDisc);
|
|
94
|
-
PrintData.PartsTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsTotalBeforeDisc);
|
|
95
|
-
PrintData.TaxTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.TaxTotal);
|
|
96
|
-
PrintData.PartCGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemCGST);
|
|
97
|
-
PrintData.PartIGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemIGST);
|
|
98
|
-
PrintData.PartSGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemSGST);
|
|
99
|
-
PrintData.PartAfterTax = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemAfterTax);
|
|
100
|
-
PrintData.TotalRoundedBy = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustTotalRoundedBy);
|
|
101
|
-
PrintData.RoundedTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustRoundedTotal);
|
|
92
|
+
PrintData.PartsDiscTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsDiscTotal, DecimalsNumber);
|
|
93
|
+
PrintData.PartsTotalAfterDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsTotalAfterDisc, DecimalsNumber);
|
|
94
|
+
PrintData.PartsTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemsTotalBeforeDisc, DecimalsNumber);
|
|
95
|
+
PrintData.TaxTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.TaxTotal, DecimalsNumber);
|
|
96
|
+
PrintData.PartCGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemCGST, DecimalsNumber);
|
|
97
|
+
PrintData.PartIGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemIGST, DecimalsNumber);
|
|
98
|
+
PrintData.PartSGST = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemSGST, DecimalsNumber);
|
|
99
|
+
PrintData.PartAfterTax = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustItemAfterTax, DecimalsNumber);
|
|
100
|
+
PrintData.TotalRoundedBy = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustTotalRoundedBy, DecimalsNumber);
|
|
101
|
+
PrintData.RoundedTotal = tr_utils_1.TrUtils.FixPriceValue(PrintData.CustRoundedTotal, DecimalsNumber);
|
|
102
102
|
return PrintData;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
export declare class VendorCreditNoteTotalsService {
|
|
2
|
-
static GetTotalsValue(opCodesList: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any): any;
|
|
2
|
+
static GetTotalsValue(opCodesList: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborItemValueIfInvalid(Item: any): any;
|
|
6
|
-
static GetFinalCNDataForSave(LaborList: any, ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any): any;
|
|
6
|
+
static GetFinalCNDataForSave(LaborList: any, ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(Disc: string, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetSubTotalFor(LaborList: any, ItemsList: any): any;
|
|
10
10
|
static GetItemsTotalAfterDiscount(ItemsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, ItemsList: any, TaxCodes: any): any;
|
|
12
|
-
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, ItemsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
|
+
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any, DecimalsNumber: number): number;
|
|
13
13
|
static GetLaborTaxTotalFor(opCodesList: any, IsIndependentTax: boolean): any;
|
|
14
14
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
15
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, ItemsTaxAmount: number, LaborList: any, ItemsList: any, IsIndependentTax: boolean): any;
|
|
15
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, ItemsTaxAmount: number, LaborList: any, ItemsList: any, IsIndependentTax: boolean, DecimalsNumber: number): any;
|
|
16
16
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc: number, LaborTaxAmount: number, MainLDisc: number, LDiscInPerc: string): number;
|
|
17
17
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc: number, ItemsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
18
18
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|
|
19
|
-
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
19
|
+
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
20
20
|
static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
|
|
21
21
|
static CompareItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
22
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any): any[];
|
|
22
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
23
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
24
24
|
}
|
|
@@ -4,7 +4,7 @@ exports.VendorCreditNoteTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class VendorCreditNoteTotalsService {
|
|
7
|
-
static GetTotalsValue(opCodesList, ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
7
|
+
static GetTotalsValue(opCodesList, ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class VendorCreditNoteTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalCNDataForSave(opCodesList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
16
|
+
let finalTotalsData = this.GetFinalCNDataForSave(opCodesList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, EntitySettings.DecimalsNumber);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
// finalTotalsData.Ops = opCodesList;
|
|
@@ -53,11 +53,11 @@ class VendorCreditNoteTotalsService {
|
|
|
53
53
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
54
54
|
return Item;
|
|
55
55
|
}
|
|
56
|
-
static GetFinalCNDataForSave(LaborList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
56
|
+
static GetFinalCNDataForSave(LaborList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, DecimalsNumber) {
|
|
57
57
|
let finalTotalsData = {};
|
|
58
58
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
59
59
|
finalTotalsData.Settings = Settings;
|
|
60
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], ItemsList, IsIndependentTax, DetailedInfo);
|
|
60
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber);
|
|
61
61
|
return finalTotalsData;
|
|
62
62
|
}
|
|
63
63
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -74,22 +74,22 @@ class VendorCreditNoteTotalsService {
|
|
|
74
74
|
}
|
|
75
75
|
return finalTotalsData;
|
|
76
76
|
}
|
|
77
|
-
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, ItemsList, IsIndependentTax, DetailedInfo) {
|
|
77
|
+
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber) {
|
|
78
78
|
let CustomerAfterDiscTotals = this.GetSubTotalFor([], ItemsList);
|
|
79
79
|
let CustLaborTaxTotal = this.GetLaborTaxTotalFor([], IsIndependentTax);
|
|
80
80
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
81
|
-
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
81
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
82
82
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
83
|
-
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
83
|
+
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData, DecimalsNumber);
|
|
84
84
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
85
85
|
let CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
86
|
-
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo(CustItemsDiscTotal
|
|
87
|
-
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustItemTaxTotal, [], ItemsList, IsIndependentTax);
|
|
88
|
-
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal)
|
|
86
|
+
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(CustItemsDiscTotal, CustItemsTotalAfterDisc), DecimalsNumber);
|
|
87
|
+
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustItemTaxTotal, [], ItemsList, IsIndependentTax, DecimalsNumber);
|
|
88
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
89
89
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
90
90
|
if (DetailedInfo) {
|
|
91
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
92
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
91
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
92
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
93
93
|
}
|
|
94
94
|
return finalTotalsData;
|
|
95
95
|
}
|
|
@@ -105,15 +105,14 @@ class VendorCreditNoteTotalsService {
|
|
|
105
105
|
});
|
|
106
106
|
return ItemsTotalAfterDisc;
|
|
107
107
|
}
|
|
108
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes) {
|
|
108
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes, DecimalsNumber) {
|
|
109
109
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList, IsIndependentTax, finalTotalsData);
|
|
110
|
-
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
110
|
+
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData, DecimalsNumber);
|
|
111
111
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
112
112
|
finalTotalsData.CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
113
113
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
114
114
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
115
|
-
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo(finalTotalsData.CustItemsTotalAfterDisc
|
|
116
|
-
+ finalTotalsData.CustItemsDiscTotal);
|
|
115
|
+
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal), DecimalsNumber);
|
|
117
116
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
118
117
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
119
118
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -128,21 +127,21 @@ class VendorCreditNoteTotalsService {
|
|
|
128
127
|
// finalTotalsData.CustItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
129
128
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
130
129
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
131
|
-
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo(finalTotalsData.CustItemITax
|
|
132
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
133
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
134
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
130
|
+
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc), DecimalsNumber);
|
|
131
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
132
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
133
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
135
134
|
for (var key in finalTotalsData) {
|
|
136
135
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
137
136
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
138
137
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
139
138
|
&& typeof finalTotalsData[key] === 'number') {
|
|
140
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
139
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
return finalTotalsData;
|
|
144
143
|
}
|
|
145
|
-
static GetItemDiscountedTotal(ItemsList, isTaxable, finalTotalsData) {
|
|
144
|
+
static GetItemDiscountedTotal(ItemsList, isTaxable, finalTotalsData, DecimalsNumber) {
|
|
146
145
|
let ItemsDiscountedTotal = 0;
|
|
147
146
|
let overallItemDisc = 0;
|
|
148
147
|
if (!isTaxable) {
|
|
@@ -151,7 +150,7 @@ class VendorCreditNoteTotalsService {
|
|
|
151
150
|
ItemsList.forEach((Item) => {
|
|
152
151
|
ItemsDiscountedTotal += Item.DiscountedPrice;
|
|
153
152
|
});
|
|
154
|
-
return tr_utils_1.TrUtils.FixedTo(ItemsDiscountedTotal
|
|
153
|
+
return tr_utils_1.TrUtils.FixedTo(((0, aggregation_1.addition)(ItemsDiscountedTotal, overallItemDisc)), DecimalsNumber);
|
|
155
154
|
}
|
|
156
155
|
static GetLaborTaxTotalFor(opCodesList, IsIndependentTax) {
|
|
157
156
|
let TotalTaxAmt = 0;
|
|
@@ -171,14 +170,14 @@ class VendorCreditNoteTotalsService {
|
|
|
171
170
|
}
|
|
172
171
|
return TotalTaxAmt;
|
|
173
172
|
}
|
|
174
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, ItemsTaxAmount, LaborList, ItemsList, IsIndependentTax) {
|
|
173
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, ItemsTaxAmount, LaborList, ItemsList, IsIndependentTax, DecimalsNumber) {
|
|
175
174
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
176
175
|
let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
177
176
|
if (IsIndependentTax) {
|
|
178
|
-
return ItemsTotalAfterDisc
|
|
177
|
+
return (0, aggregation_1.addition)(ItemsTotalAfterDisc, LaborTaxAmount, ItemsTaxAmount);
|
|
179
178
|
}
|
|
180
179
|
else {
|
|
181
|
-
return tr_utils_1.TrUtils.FixedTo(ItemsTotalAfterDisc
|
|
180
|
+
return tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(ItemsTotalAfterDisc, finalTotalsData.Disc), DecimalsNumber);
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
@@ -220,11 +219,11 @@ class VendorCreditNoteTotalsService {
|
|
|
220
219
|
}
|
|
221
220
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
222
221
|
}
|
|
223
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
222
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
224
223
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
225
224
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
226
225
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
227
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
226
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
228
227
|
}
|
|
229
228
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
230
229
|
Items.forEach((Item) => {
|
|
@@ -270,7 +269,7 @@ class VendorCreditNoteTotalsService {
|
|
|
270
269
|
});
|
|
271
270
|
return FinalMatchedItems;
|
|
272
271
|
}
|
|
273
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
272
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
274
273
|
let HSNTaxInfo = [];
|
|
275
274
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
276
275
|
let TaxInfo = {};
|
|
@@ -285,8 +284,8 @@ class VendorCreditNoteTotalsService {
|
|
|
285
284
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
286
285
|
});
|
|
287
286
|
TaxInfo.HSN = HSN;
|
|
288
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
289
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
287
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
288
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
290
289
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
291
290
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
292
291
|
// TaxInfo.CGST = GSTValues[0];
|