shareneus 1.4.47 → 1.4.49
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-print.service.d.ts +3 -3
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +31 -30
- package/dist/accounting/credit-note/cn-print.service.d.ts +1 -2
- package/dist/accounting/credit-note/cn-print.service.js +10 -32
- package/dist/accounting/credit-note/credit-note-totals.service.d.ts +6 -6
- package/dist/accounting/credit-note/credit-note-totals.service.js +19 -19
- package/dist/accounting/debit-note/debit-note-print.service.d.ts +2 -2
- package/dist/accounting/debit-note/debit-note-print.service.js +15 -15
- package/dist/accounting/debit-note/debit-note-totals.service.d.ts +6 -6
- package/dist/accounting/debit-note/debit-note-totals.service.js +18 -18
- package/dist/accounting/invoice/hc-inv-pdf.service.d.ts +7 -7
- package/dist/accounting/invoice/hc-inv-pdf.service.js +36 -36
- package/dist/accounting/invoice/inv-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/inv-pdf.service.js +44 -44
- package/dist/accounting/invoice/inv-print.service.d.ts +3 -3
- package/dist/accounting/invoice/inv-print.service.js +24 -24
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +44 -44
- package/dist/accounting/invoice/invoice-total.service.d.ts +11 -11
- package/dist/accounting/invoice/invoice-total.service.js +54 -54
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +6 -6
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +10 -9
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +0 -2
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +0 -2
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +0 -2
- package/dist/accounting/invoice/shared-inv-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/shared-inv-pdf.service.js +30 -30
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +1 -1
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +3 -3
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +4 -4
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +9 -11
- package/dist/appointments/appointments/appointment-total.service.d.ts +6 -6
- package/dist/appointments/appointments/appointment-total.service.js +28 -29
- package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +3 -3
- package/dist/appointments/consultations/consultation-full-pdf.service.d.ts +2 -2
- package/dist/appointments/consultations/consultation-full-pdf.service.js +7 -7
- package/dist/appointments/consultations/consultation-letterhead-pdf.service.d.ts +2 -3
- package/dist/appointments/consultations/consultation-letterhead-pdf.service.js +7 -15
- package/dist/appointments/consultations/consultation-pdf.service.d.ts +2 -3
- package/dist/appointments/consultations/consultation-pdf.service.js +14 -15
- package/dist/inventory/items/issue-parts-pdf.service.js +1 -1
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +1 -1
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +0 -2
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +0 -2
- package/dist/inventory/items/reports/pdf/reorder-point-pdf.service.js +1 -1
- package/dist/inventory/transfer-order/transfer-order-pdf.service.js +1 -2
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +1 -1
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +3 -3
- package/dist/purchases/purchase-order/po-totals.service.d.ts +7 -7
- package/dist/purchases/purchase-order/po-totals.service.js +24 -25
- package/dist/purchases/purchase-order/purchase-order-print.service.js +3 -3
- package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +10 -10
- package/dist/purchases/purchase-order/purchase-order-totals.service.js +27 -27
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +1 -2
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +10 -32
- package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +1 -2
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +9 -32
- package/dist/sales/sales/sales-print.service.d.ts +2 -2
- package/dist/sales/sales/sales-print.service.js +17 -17
- package/dist/services/est.print-service.d.ts +18 -18
- package/dist/services/est.print-service.js +132 -132
- package/dist/services/reports/pdf/next-service-date-pdf.service.js +0 -2
- package/dist/services/reports/pdf/repair-orders-pdf.service.js +0 -1
- package/dist/services/ro-print-service.d.ts +6 -6
- package/dist/services/ro-print-service.js +39 -39
- package/dist/services/separate-wo-print.service.d.ts +1 -1
- package/dist/services/separate-wo-print.service.js +4 -4
- package/dist/shared/shared-pdf.service.d.ts +0 -16
- package/dist/shared/shared-pdf.service.js +36 -34
- package/dist/shared/shared-print.service.js +3 -1
- package/dist/tasks/meetings/meeting-pdf.d.ts +4 -4
- package/dist/tasks/meetings/meeting-pdf.js +9 -9
- package/dist/tasks/tasks/task-pdf.service.d.ts +4 -4
- package/dist/tasks/tasks/task-pdf.service.js +8 -8
- package/dist/tasks/tasks/task-reports-pdf.service.d.ts +6 -6
- package/dist/tasks/tasks/task-reports-pdf.service.js +14 -14
- package/dist/utils/my-date.d.ts +6 -7
- package/dist/utils/my-date.js +16 -16
- package/dist/utils/tr-utils.d.ts +2 -3
- package/dist/utils/tr-utils.js +5 -5
- package/package.json +1 -1
- package/dist/shared/shared-pdfs/shared-pdf.service.d.ts +0 -926
- package/dist/shared/shared-pdfs/shared-pdf.service.js +0 -2608
|
@@ -479,7 +479,7 @@ class SalesReceiptprintService {
|
|
|
479
479
|
stack: [
|
|
480
480
|
{
|
|
481
481
|
columns: [{ text: '' }, { text: 'Gate Pass', bold: true, fontSize: 9, alignment: 'center', marginTop: 5 },
|
|
482
|
-
{ text: 'Date: ' + my_date_1.MyDate.ConvertUTCDateToReadable(my_date_1.MyDate.GetDateTimeNowInUTC()), marginTop: 5, fontSize: 9, alignment: 'right' }]
|
|
482
|
+
{ text: 'Date: ' + my_date_1.MyDate.ConvertUTCDateToReadable(my_date_1.MyDate.GetDateTimeNowInUTC(ROPrintData.Entity.User.TZ)), marginTop: 5, fontSize: 9, alignment: 'right' }]
|
|
483
483
|
},
|
|
484
484
|
{ text: ROPrintData.Entity.CName, alignment: 'center', bold: true, fontSize: 12, marginTop: 5, marginBottom: 5 },
|
|
485
485
|
{
|
|
@@ -3,8 +3,8 @@ export declare class SaleReceiptPrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
|
|
4
4
|
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
|
|
5
5
|
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
|
|
6
|
-
static GetLaborPrintInfo(LaborList: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
7
|
-
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, OBN: boolean, LineTotal: string): any;
|
|
6
|
+
static GetLaborPrintInfo(LaborList: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
7
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, OBN: boolean, LineTotal: string, DecimalsNumber: number): any;
|
|
8
8
|
static getTaxName(TCode: any, TaxCodes: any): any;
|
|
9
9
|
static GetBatchesData(Item: any, OBN: boolean): any;
|
|
10
10
|
static GetExpiryDate(Item: any): any;
|
|
@@ -14,5 +14,5 @@ export declare class SaleReceiptPrintService {
|
|
|
14
14
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
15
15
|
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
16
16
|
static GetBillToName(Title: any, Name: string): string;
|
|
17
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
17
|
+
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string, DecimalsNumber: number): any;
|
|
18
18
|
}
|
|
@@ -4,6 +4,7 @@ exports.SaleReceiptPrintService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const code_enums_1 = require("../../enums/code-enums");
|
|
6
6
|
const enums_1 = require("../../enums/enums");
|
|
7
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
7
8
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
8
9
|
const my_date_1 = require("../../utils/my-date");
|
|
9
10
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
@@ -31,14 +32,14 @@ class SaleReceiptPrintService {
|
|
|
31
32
|
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Ops)) {
|
|
32
33
|
argInvoiceData.Ops = [];
|
|
33
34
|
}
|
|
34
|
-
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Ops, argInvoiceData.Items, IsTaxable, true, argInvoiceData.LDisc, argInvoiceData.LPerc, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, InvoicePrintData.Entity.Round);
|
|
35
|
+
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Ops, argInvoiceData.Items, IsTaxable, true, argInvoiceData.LDisc, argInvoiceData.LPerc, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
35
36
|
if (ConsolidateGST) {
|
|
36
37
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
37
38
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
38
39
|
}
|
|
39
40
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
40
|
-
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
41
|
-
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, OBN, (_d = (_c = OriginalEntityData.Entity.Settings) === null || _c === void 0 ? void 0 : _c.Acc) === null || _d === void 0 ? void 0 : _d.LTot);
|
|
41
|
+
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, InvoicePrintData.Entity.DecimalsNumber);
|
|
42
|
+
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, OBN, (_d = (_c = OriginalEntityData.Entity.Settings) === null || _c === void 0 ? void 0 : _c.Acc) === null || _d === void 0 ? void 0 : _d.LTot, InvoicePrintData.Entity.DecimalsNumber);
|
|
42
43
|
// InvoicePrintData.Items = InvoicePrintData.Items.filter((item: any) => {
|
|
43
44
|
// return !item.Ret;
|
|
44
45
|
// })
|
|
@@ -46,11 +47,11 @@ class SaleReceiptPrintService {
|
|
|
46
47
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
47
48
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
48
49
|
InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
|
|
49
|
-
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
|
|
50
|
+
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts, InvoicePrintData.Entity.DecimalsNumber);
|
|
50
51
|
// if (argInvoiceData.Settings.DiscLvl !== 'REC') {
|
|
51
52
|
// InvoicePrintData.FixedDisc = null;
|
|
52
53
|
// }
|
|
53
|
-
InvoicePrintData.Due = tr_utils_1.TrUtils.FixPriceValue(argInvoiceData.Due);
|
|
54
|
+
InvoicePrintData.Due = tr_utils_1.TrUtils.FixPriceValue(argInvoiceData.Due, InvoicePrintData.Entity.DecimalsNumber);
|
|
54
55
|
InvoicePrintData.Paid = argInvoiceData.Receipt ? argInvoiceData.Total : PaymentData.Paid;
|
|
55
56
|
if (!tr_utils_1.TrUtils.IsNull(PaymentData.Sts)) {
|
|
56
57
|
InvoicePrintData.Sts = PaymentData.Sts;
|
|
@@ -141,67 +142,67 @@ class SaleReceiptPrintService {
|
|
|
141
142
|
InvoicePrintData._id = OriginalInvoiceData.Code;
|
|
142
143
|
InvoicePrintData.Sts = OriginalInvoiceData.Sts;
|
|
143
144
|
InvoicePrintData.Name = OriginalInvoiceData.Name;
|
|
144
|
-
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateTimeToReadable(OriginalInvoiceData.CrDate);
|
|
145
|
+
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateTimeToReadable(OriginalInvoiceData.CrDate, InvoicePrintData.Entity.User.TZ);
|
|
145
146
|
return InvoicePrintData;
|
|
146
147
|
}
|
|
147
|
-
static GetLaborPrintInfo(LaborList, Consolidate, TaxCodes, LineTotal) {
|
|
148
|
+
static GetLaborPrintInfo(LaborList, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
148
149
|
LaborList.forEach((Labor) => {
|
|
149
150
|
Labor.HSN = Labor.SAC;
|
|
150
151
|
if (Consolidate) {
|
|
151
|
-
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.AfterLaborTax);
|
|
152
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.AfterLaborTax, DecimalsNumber);
|
|
152
153
|
}
|
|
153
154
|
else {
|
|
154
|
-
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
|
|
155
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr, DecimalsNumber);
|
|
155
156
|
}
|
|
156
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST);
|
|
157
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST);
|
|
158
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST);
|
|
157
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST, DecimalsNumber);
|
|
158
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST, DecimalsNumber);
|
|
159
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST, DecimalsNumber);
|
|
159
160
|
Labor.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
160
161
|
Labor.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
161
162
|
Labor.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
162
163
|
if (LineTotal === 'AT') {
|
|
163
|
-
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax);
|
|
164
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax, DecimalsNumber);
|
|
164
165
|
}
|
|
165
166
|
else {
|
|
166
|
-
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc));
|
|
167
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc), DecimalsNumber);
|
|
167
168
|
}
|
|
168
169
|
});
|
|
169
170
|
return LaborList;
|
|
170
171
|
}
|
|
171
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, OBN, LineTotal) {
|
|
172
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, OBN, LineTotal, DecimalsNumber) {
|
|
172
173
|
Items.forEach((Item) => {
|
|
173
174
|
var _a;
|
|
174
175
|
if (Consolidate) {
|
|
175
|
-
let AfterDiscForEach = Item.AfterPartDisc
|
|
176
|
-
let CTaxAmtPerItem = Item.CGST
|
|
177
|
-
let STaxAmtPerItem = Item.SGST
|
|
178
|
-
let ITaxAmtPerItem = Item.IGST
|
|
179
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo(AfterDiscForEach
|
|
176
|
+
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
177
|
+
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
178
|
+
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
179
|
+
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
180
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
180
181
|
}
|
|
181
182
|
else {
|
|
182
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
183
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
183
184
|
}
|
|
184
185
|
Item.ExDt = this.GetExpiryDate(Item);
|
|
185
186
|
Item.Batch = this.GetBatchesData(Item, OBN);
|
|
186
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.CGST);
|
|
187
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.CGST, DecimalsNumber);
|
|
187
188
|
if (tr_utils_1.TrUtils.IsNull(Item.ConUt)) {
|
|
188
189
|
Item.ConUt = 1;
|
|
189
190
|
}
|
|
190
191
|
if (!tr_utils_1.TrUtils.IsNull(Item.Make)) {
|
|
191
192
|
Item.Make = (_a = Item.Make) === null || _a === void 0 ? void 0 : _a.slice(0, 4).toUpperCase();
|
|
192
193
|
}
|
|
193
|
-
Item.Qty = tr_utils_1.TrUtils.FixedTo(Item.Qty
|
|
194
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.SGST);
|
|
195
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.IGST);
|
|
194
|
+
Item.Qty = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Multiply)(Item.Qty, Item.ConUt), DecimalsNumber);
|
|
195
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.SGST, DecimalsNumber);
|
|
196
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.IGST, DecimalsNumber);
|
|
196
197
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
197
198
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
198
199
|
Item.TaxName = this.getTaxName(Item.TCode, TaxCodes);
|
|
199
200
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
200
201
|
if (LineTotal === 'AT') {
|
|
201
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
202
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
202
203
|
}
|
|
203
204
|
else {
|
|
204
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
205
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
205
206
|
}
|
|
206
207
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
207
208
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -394,7 +395,7 @@ class SaleReceiptPrintService {
|
|
|
394
395
|
static GetBillToName(Title, Name) {
|
|
395
396
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
396
397
|
}
|
|
397
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
398
|
+
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus, DecimalsNumber) {
|
|
398
399
|
if (tr_utils_1.TrUtils.IsNull(InvoicePayments)) {
|
|
399
400
|
InvoicePayments = [];
|
|
400
401
|
}
|
|
@@ -408,7 +409,7 @@ class SaleReceiptPrintService {
|
|
|
408
409
|
Data.Due = 0;
|
|
409
410
|
}
|
|
410
411
|
else {
|
|
411
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
412
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
|
|
412
413
|
}
|
|
413
414
|
if (Data.Due < 0) {
|
|
414
415
|
Data.Due = 0;
|
|
@@ -416,7 +417,7 @@ class SaleReceiptPrintService {
|
|
|
416
417
|
if (Data.Due === 0) {
|
|
417
418
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
418
419
|
}
|
|
419
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
420
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal, DecimalsNumber);
|
|
420
421
|
return Data;
|
|
421
422
|
}
|
|
422
423
|
}
|
|
@@ -3,12 +3,11 @@ export declare class CNPrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
|
|
4
4
|
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
|
|
5
5
|
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
|
|
6
|
-
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
7
7
|
static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
|
|
8
8
|
static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
|
|
9
9
|
static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
10
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
11
11
|
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
12
12
|
static GetBillToName(Title: any, Name: string): string;
|
|
13
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
14
13
|
}
|
|
@@ -26,13 +26,13 @@ class CNPrintService {
|
|
|
26
26
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
27
27
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
28
28
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
29
|
-
let finalTotalsData = credit_note_totals_service_1.CreditNoteTotalsService.GetTotalsValue([], argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
29
|
+
let finalTotalsData = credit_note_totals_service_1.CreditNoteTotalsService.GetTotalsValue([], argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
|
|
30
30
|
if (ConsolidateGST) {
|
|
31
31
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
32
32
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
33
33
|
}
|
|
34
34
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
35
|
-
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
35
|
+
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, InvoicePrintData.Entity.DecimalsNumber);
|
|
36
36
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
37
37
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
38
38
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
@@ -64,29 +64,29 @@ class CNPrintService {
|
|
|
64
64
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
65
65
|
return InvoicePrintData;
|
|
66
66
|
}
|
|
67
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
67
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
68
68
|
Items.forEach((Item) => {
|
|
69
69
|
if (Consolidate) {
|
|
70
70
|
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
71
71
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
72
72
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
73
73
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
74
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
74
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
77
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
78
78
|
}
|
|
79
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
80
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
81
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
79
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
80
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
81
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
82
82
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
83
83
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
84
84
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
85
85
|
if (LineTotal === 'AT') {
|
|
86
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
86
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
89
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
90
90
|
}
|
|
91
91
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
92
92
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -183,27 +183,5 @@ class CNPrintService {
|
|
|
183
183
|
static GetBillToName(Title, Name) {
|
|
184
184
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
185
185
|
}
|
|
186
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
187
|
-
var i = 0;
|
|
188
|
-
let Data = {};
|
|
189
|
-
let PaidTotal = 0;
|
|
190
|
-
for (i = 0; i < InvoicePayments.length; i++) {
|
|
191
|
-
PaidTotal += InvoicePayments[i].Paid;
|
|
192
|
-
}
|
|
193
|
-
if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
|
|
194
|
-
Data.Due = 0;
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
198
|
-
}
|
|
199
|
-
if (Data.Due < 0) {
|
|
200
|
-
Data.Due = 0;
|
|
201
|
-
}
|
|
202
|
-
if (Data.Due === 0) {
|
|
203
|
-
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
204
|
-
}
|
|
205
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
206
|
-
return Data;
|
|
207
|
-
}
|
|
208
186
|
}
|
|
209
187
|
exports.CNPrintService = CNPrintService;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class CreditNoteTotalsService {
|
|
2
|
-
static GetTotalsValue(opCodesList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any): any;
|
|
2
|
+
static GetTotalsValue(opCodesList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, EntitySettings?: any): any;
|
|
3
3
|
static CalculateLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborPartValueIfInvalid(Part: any): any;
|
|
6
|
-
static GetFinalRODataForSave(LaborList: any, PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any): any;
|
|
6
|
+
static GetFinalRODataForSave(LaborList: any, PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, DecimalsNumber: any): any;
|
|
7
7
|
static SetMainDiscountValues(Disc: string, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, DecimalsNumber?: number): any;
|
|
9
9
|
static GetSubTotalFor(LaborList: any, PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
|
|
12
12
|
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
|
|
13
13
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
14
14
|
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): any;
|
|
@@ -17,9 +17,9 @@ export declare class CreditNoteTotalsService {
|
|
|
17
17
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
18
18
|
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
19
19
|
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
20
|
-
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
20
|
+
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
21
21
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
22
22
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
23
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any): any[];
|
|
23
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
24
24
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
25
25
|
}
|
|
@@ -4,7 +4,7 @@ exports.CreditNoteTotalsService = void 0;
|
|
|
4
4
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
5
5
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
6
6
|
class CreditNoteTotalsService {
|
|
7
|
-
static GetTotalsValue(opCodesList, PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
7
|
+
static GetTotalsValue(opCodesList, PartsList, 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 CreditNoteTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalRODataForSave(opCodesList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
16
|
+
let finalTotalsData = this.GetFinalRODataForSave(opCodesList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, EntitySettings.DecimalsNumber);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, PartsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, PartsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
// finalTotalsData.Ops = opCodesList;
|
|
@@ -54,11 +54,11 @@ class CreditNoteTotalsService {
|
|
|
54
54
|
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
55
55
|
return Part;
|
|
56
56
|
}
|
|
57
|
-
static GetFinalRODataForSave(LaborList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
57
|
+
static GetFinalRODataForSave(LaborList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, DecimalsNumber) {
|
|
58
58
|
let finalTotalsData = {};
|
|
59
59
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
60
60
|
finalTotalsData.Settings = Settings;
|
|
61
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], PartsList, IsIndependentTax, DetailedInfo);
|
|
61
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], PartsList, IsIndependentTax, DetailedInfo, DecimalsNumber);
|
|
62
62
|
return finalTotalsData;
|
|
63
63
|
}
|
|
64
64
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -75,11 +75,11 @@ class CreditNoteTotalsService {
|
|
|
75
75
|
}
|
|
76
76
|
return finalTotalsData;
|
|
77
77
|
}
|
|
78
|
-
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, PartsList, IsIndependentTax, DetailedInfo) {
|
|
78
|
+
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, PartsList, IsIndependentTax, DetailedInfo, DecimalsNumber = 2) {
|
|
79
79
|
let CustomerAfterDiscTotals = this.GetSubTotalFor([], PartsList);
|
|
80
80
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor([], IsIndependentTax);
|
|
81
81
|
let CustPartTaxTotal = this.GetPartsTaxTotalFor(PartsList, IsIndependentTax);
|
|
82
|
-
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
82
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
83
83
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
84
84
|
let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
85
85
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
@@ -89,8 +89,8 @@ class CreditNoteTotalsService {
|
|
|
89
89
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
90
90
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
91
91
|
if (DetailedInfo) {
|
|
92
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
93
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
92
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
93
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
94
94
|
}
|
|
95
95
|
return finalTotalsData;
|
|
96
96
|
}
|
|
@@ -106,7 +106,7 @@ class CreditNoteTotalsService {
|
|
|
106
106
|
});
|
|
107
107
|
return PartsTotalAfterDisc;
|
|
108
108
|
}
|
|
109
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, PartsList, TaxCodes) {
|
|
109
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, PartsList, TaxCodes, DecimalsNumber = 2) {
|
|
110
110
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList, IsIndependentTax, finalTotalsData);
|
|
111
111
|
finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
112
112
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -125,15 +125,15 @@ class CreditNoteTotalsService {
|
|
|
125
125
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
126
126
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
127
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes);
|
|
129
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
130
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
128
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
|
|
129
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
130
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
131
131
|
for (var key in finalTotalsData) {
|
|
132
132
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
133
133
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
134
134
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
135
135
|
&& typeof finalTotalsData[key] === 'number') {
|
|
136
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
136
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
return finalTotalsData;
|
|
@@ -222,11 +222,11 @@ class CreditNoteTotalsService {
|
|
|
222
222
|
}
|
|
223
223
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
224
224
|
}
|
|
225
|
-
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes) {
|
|
225
|
+
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes, DecimalsNumber) {
|
|
226
226
|
Parts = this.GetCombinedTaxPercentage(Parts, TaxCodes);
|
|
227
227
|
// Parts = this.ResetPartsHSNIfInvalid(Parts);
|
|
228
228
|
let FinalMatchedParts = this.ComparePartsByHSN(Parts, TaxCodes);
|
|
229
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
|
|
229
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
230
230
|
}
|
|
231
231
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
232
232
|
Parts.forEach((Part) => {
|
|
@@ -272,7 +272,7 @@ class CreditNoteTotalsService {
|
|
|
272
272
|
});
|
|
273
273
|
return FinalMatchedParts;
|
|
274
274
|
}
|
|
275
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
|
|
275
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
|
|
276
276
|
let HSNTaxInfo = [];
|
|
277
277
|
FinalMatchedParts.forEach((MatchedPart) => {
|
|
278
278
|
let TaxInfo = {};
|
|
@@ -287,8 +287,8 @@ class CreditNoteTotalsService {
|
|
|
287
287
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
288
288
|
});
|
|
289
289
|
TaxInfo.HSN = HSN;
|
|
290
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
291
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
290
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
291
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
292
292
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
293
293
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
294
294
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -3,12 +3,12 @@ export declare class DebitNotePrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean, IsBillTo: boolean): any;
|
|
4
4
|
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean, IsBillTo: boolean): any;
|
|
5
5
|
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any, IsCustBillTo: boolean): any;
|
|
6
|
-
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
7
7
|
static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
|
|
8
8
|
static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
|
|
9
9
|
static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
10
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any, IsBillTo: boolean): any;
|
|
11
11
|
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
12
12
|
static GetBillToName(Title: any, Name: string): string;
|
|
13
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
13
|
+
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string, DecimalsNumber: number): any;
|
|
14
14
|
}
|
|
@@ -10,7 +10,7 @@ const my_date_1 = require("../../utils/my-date");
|
|
|
10
10
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
11
11
|
class DebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, IsCustBillTo) {
|
|
13
|
-
var _a, _b;
|
|
13
|
+
var _a, _b, _c, _d;
|
|
14
14
|
let InvoicePrintData = {};
|
|
15
15
|
let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
16
16
|
if (!IncludeGST) {
|
|
@@ -25,13 +25,13 @@ class DebitNotePrintService {
|
|
|
25
25
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
26
26
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData, IsCustBillTo);
|
|
27
27
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
28
|
-
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
28
|
+
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
|
|
29
29
|
if (ConsolidateGST) {
|
|
30
30
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
31
31
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
32
32
|
}
|
|
33
33
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
34
|
-
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
34
|
+
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, (_c = InvoicePrintData.Entity) === null || _c === void 0 ? void 0 : _c.DecimalsNumber);
|
|
35
35
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
36
36
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
37
37
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
@@ -39,7 +39,7 @@ class DebitNotePrintService {
|
|
|
39
39
|
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Payments)) {
|
|
40
40
|
argInvoiceData.Payments = [];
|
|
41
41
|
}
|
|
42
|
-
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
|
|
42
|
+
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts, (_d = InvoicePrintData.Entity) === null || _d === void 0 ? void 0 : _d.DecimalsNumber);
|
|
43
43
|
InvoicePrintData.Due = PaymentData.Due;
|
|
44
44
|
InvoicePrintData.Paid = PaymentData.Paid;
|
|
45
45
|
if (!tr_utils_1.TrUtils.IsNull(PaymentData.Sts)) {
|
|
@@ -90,29 +90,29 @@ class DebitNotePrintService {
|
|
|
90
90
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
91
91
|
return InvoicePrintData;
|
|
92
92
|
}
|
|
93
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
93
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
94
94
|
Items.forEach((Item) => {
|
|
95
95
|
if (Consolidate) {
|
|
96
96
|
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
97
97
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
98
98
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
99
99
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
100
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
100
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
103
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
104
104
|
}
|
|
105
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
106
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
107
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
105
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
106
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
107
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
108
108
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
109
109
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
110
110
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
111
111
|
if (LineTotal === 'AT') {
|
|
112
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
112
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
115
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
116
116
|
}
|
|
117
117
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
118
118
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -209,7 +209,7 @@ class DebitNotePrintService {
|
|
|
209
209
|
static GetBillToName(Title, Name) {
|
|
210
210
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
211
211
|
}
|
|
212
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
212
|
+
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus, DecimalsNumber) {
|
|
213
213
|
var i = 0;
|
|
214
214
|
let Data = {};
|
|
215
215
|
let PaidTotal = 0;
|
|
@@ -220,7 +220,7 @@ class DebitNotePrintService {
|
|
|
220
220
|
Data.Due = 0;
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
223
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
|
|
224
224
|
}
|
|
225
225
|
if (Data.Due < 0) {
|
|
226
226
|
Data.Due = 0;
|
|
@@ -228,7 +228,7 @@ class DebitNotePrintService {
|
|
|
228
228
|
if (Data.Due === 0) {
|
|
229
229
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
230
230
|
}
|
|
231
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
231
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal, DecimalsNumber);
|
|
232
232
|
return Data;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export declare class DebitNoteTotalsService {
|
|
2
|
-
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any): any;
|
|
2
|
+
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborPartValueIfInvalid(Part: any): any;
|
|
6
|
-
static GetFinalRODataForSave(PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any): any;
|
|
6
|
+
static GetFinalRODataForSave(PartsList: 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, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, DecimalsNumber?: number): any;
|
|
9
9
|
static GetSubTotalFor(PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
|
|
12
12
|
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
|
|
13
13
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
14
14
|
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, PartsTaxAmount: number, PartsList: any, IsIndependentTax: boolean): any;
|
|
15
15
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
16
16
|
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
17
|
-
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
17
|
+
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
18
18
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
19
19
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
20
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any): any[];
|
|
20
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
21
21
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
22
22
|
}
|