shareneus 1.4.48 → 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/sales-receipt-print.service.d.ts +3 -3
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +30 -29
- 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 +43 -43
- 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 +43 -43
- 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/shared-inv-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/shared-inv-pdf.service.js +29 -29
- package/dist/appointments/appointments/appointment-total.service.d.ts +6 -6
- package/dist/appointments/appointments/appointment-total.service.js +28 -29
- 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/ro-print-service.d.ts +6 -6
- package/dist/services/ro-print-service.js +39 -39
- 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 +1 -0
- 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
|
@@ -5,7 +5,7 @@ const aggregation_1 = require("../../aggregation/aggregation");
|
|
|
5
5
|
const code_enums_1 = require("../../enums/code-enums");
|
|
6
6
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
7
|
class PurchaseOrderTotalsService {
|
|
8
|
-
static GetTotalsValue(opCodesList, argPartsList, IsTaxable, DetailedTotalsInfo, TaxCodes, Tax, ReturnPartsAlso, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust) {
|
|
8
|
+
static GetTotalsValue(opCodesList, argPartsList, IsTaxable, DetailedTotalsInfo, TaxCodes, Tax, ReturnPartsAlso, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, EntitySettings) {
|
|
9
9
|
let PartsList = tr_utils_1.TrUtils.IsNull(argPartsList) ? [] : tr_utils_1.TrUtils.Stringify(argPartsList);
|
|
10
10
|
// PartsList = this.ResetPartValuesIfInvalid(PartsList);
|
|
11
11
|
// PartsList = this.GetPartsDiscountPrice(PartsList);
|
|
@@ -13,27 +13,27 @@ class PurchaseOrderTotalsService {
|
|
|
13
13
|
if (tr_utils_1.TrUtils.IsNull(opCodesList)) {
|
|
14
14
|
opCodesList = [];
|
|
15
15
|
}
|
|
16
|
-
opCodesList = this.CalculateLaborValues(opCodesList, IsTaxable);
|
|
17
|
-
PartsList = this.GetPartsTaxAmount(PartsList, IsTaxable, TaxCodes);
|
|
16
|
+
opCodesList = this.CalculateLaborValues(opCodesList, IsTaxable, EntitySettings.DecimalsNumber);
|
|
17
|
+
PartsList = this.GetPartsTaxAmount(PartsList, IsTaxable, TaxCodes, EntitySettings.DecimalsNumber);
|
|
18
18
|
// PartsList = this.GetPartsAfterTax(PartsList);
|
|
19
|
-
let finalTotalsData = this.GetTotalsInfo(PartsList, opCodesList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust);
|
|
19
|
+
let finalTotalsData = this.GetTotalsInfo(PartsList, opCodesList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, EntitySettings.DecimalsNumber);
|
|
20
20
|
if (ReturnPartsAlso) {
|
|
21
21
|
finalTotalsData.Ops = opCodesList;
|
|
22
22
|
finalTotalsData.Items = PartsList;
|
|
23
23
|
}
|
|
24
24
|
if (DetailedTotalsInfo === true) {
|
|
25
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, opCodesList, TaxCodes, Tax, HasNoTax);
|
|
25
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, opCodesList, TaxCodes, Tax, HasNoTax, EntitySettings.DecimalsNumber);
|
|
26
26
|
}
|
|
27
27
|
return finalTotalsData;
|
|
28
28
|
}
|
|
29
|
-
static CalculateLaborValues(opCodesList, IsIndependentTax) {
|
|
30
|
-
opCodesList = this.ResetLaborValues(opCodesList, IsIndependentTax);
|
|
29
|
+
static CalculateLaborValues(opCodesList, IsIndependentTax, DecimalsNumber) {
|
|
30
|
+
opCodesList = this.ResetLaborValues(opCodesList, IsIndependentTax, DecimalsNumber);
|
|
31
31
|
// opCodesList = this.GetOperationsDiscountPrice(opCodesList);
|
|
32
32
|
// opCodesList = this.GetOperationsAfterDiscount(opCodesList,IsIndependentTax);
|
|
33
33
|
// opCodesList = this.GetOperationsAfterTax(opCodesList, IsIndependentTax);
|
|
34
34
|
return opCodesList;
|
|
35
35
|
}
|
|
36
|
-
static ResetLaborValues(opCodesList, IsIndependentTax) {
|
|
36
|
+
static ResetLaborValues(opCodesList, IsIndependentTax, DecimalsNumber) {
|
|
37
37
|
opCodesList.forEach((Operation) => {
|
|
38
38
|
Operation = this.ResetLaborValueIfInvalid(Operation);
|
|
39
39
|
Operation.DiscountedPrice = (0, aggregation_1.addition)(Operation.Disc, Operation.RecDisc);
|
|
@@ -53,10 +53,10 @@ class PurchaseOrderTotalsService {
|
|
|
53
53
|
let Price = 0;
|
|
54
54
|
Price = (0, aggregation_1.multiply)(Operation.UnCo, Operation.Qty);
|
|
55
55
|
if (IsIndependentTax) {
|
|
56
|
-
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Operation.Disc), Operation.GSTAmt));
|
|
56
|
+
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Operation.Disc), Operation.GSTAmt), DecimalsNumber);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
|
-
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Operation.Disc));
|
|
59
|
+
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Operation.Disc), DecimalsNumber);
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
return opCodesList;
|
|
@@ -96,7 +96,7 @@ class PurchaseOrderTotalsService {
|
|
|
96
96
|
return (0, aggregation_1.addition)(Disc, tr_utils_1.TrUtils.SetValueToZeroIfNull(RecDisc));
|
|
97
97
|
// }
|
|
98
98
|
}
|
|
99
|
-
static GetPartsTaxAmount(Items, IsTaxable, TaxCodes) {
|
|
99
|
+
static GetPartsTaxAmount(Items, IsTaxable, TaxCodes, DecimalsNumber) {
|
|
100
100
|
Items.forEach((Part) => {
|
|
101
101
|
Part = this.ResetPartValueIfInvalid(Part);
|
|
102
102
|
// Part.CGSTAmt = this.GetCGSTTaxAmount(Part.AfterDiscountPrice, IsTaxable, Part.TCode, TaxCodes);
|
|
@@ -113,7 +113,7 @@ class PurchaseOrderTotalsService {
|
|
|
113
113
|
if (IsTaxable) {
|
|
114
114
|
// if (!TrUtils(Part.Perc)) {
|
|
115
115
|
Price = (0, aggregation_1.multiply)(Part.UnCo, Part.Qty);
|
|
116
|
-
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Part.Disc), Part.GSTAmt));
|
|
116
|
+
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Part.Disc), Part.GSTAmt), DecimalsNumber);
|
|
117
117
|
// } else {
|
|
118
118
|
// Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc) + Part.GSTAmt);
|
|
119
119
|
// }
|
|
@@ -122,7 +122,7 @@ class PurchaseOrderTotalsService {
|
|
|
122
122
|
// let DiscPrice: any = 0;
|
|
123
123
|
// if (Part.Perc) {
|
|
124
124
|
Price = (0, aggregation_1.multiply)(Part.UnCo, Part.Qty);
|
|
125
|
-
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Part.Disc));
|
|
125
|
+
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Part.Disc), DecimalsNumber);
|
|
126
126
|
// } else {
|
|
127
127
|
// Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc));
|
|
128
128
|
// }
|
|
@@ -156,7 +156,7 @@ class PurchaseOrderTotalsService {
|
|
|
156
156
|
return [0, 0, 0];
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
static GetTotalsInfo(PartsList, LaborList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust) {
|
|
159
|
+
static GetTotalsInfo(PartsList, LaborList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, DecimalsNumber) {
|
|
160
160
|
let finalTotalsData = {};
|
|
161
161
|
let PartsInfo = this.GetPartsTotalTaxAndAfterDiscount(PartsList);
|
|
162
162
|
let PartsTotalAfterDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[0]);
|
|
@@ -167,7 +167,7 @@ class PurchaseOrderTotalsService {
|
|
|
167
167
|
let ServicesDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[1]);
|
|
168
168
|
let ServicesTaxTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[2]);
|
|
169
169
|
finalTotalsData.SubTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsDiscTotal, ServicesTotalAfterDisc, ServicesDiscTotal);
|
|
170
|
-
finalTotalsData.Adj = tr_utils_1.TrUtils.FixPriceValue(Adjust);
|
|
170
|
+
finalTotalsData.Adj = tr_utils_1.TrUtils.FixPriceValue(Adjust, DecimalsNumber);
|
|
171
171
|
// if (GetSubTotal) {
|
|
172
172
|
// finalTotalsData.SubTotal = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal,
|
|
173
173
|
// IsTaxable);
|
|
@@ -182,7 +182,7 @@ class PurchaseOrderTotalsService {
|
|
|
182
182
|
// }
|
|
183
183
|
// finalTotalsData.Total = Total;
|
|
184
184
|
// } else {
|
|
185
|
-
finalTotalsData.Total = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust);
|
|
185
|
+
finalTotalsData.Total = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust, DecimalsNumber);
|
|
186
186
|
// }
|
|
187
187
|
// finalTotalsData.Round = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
|
|
188
188
|
// finalTotalsData.Total = Math.round(finalTotalsData.Total);
|
|
@@ -210,7 +210,7 @@ class PurchaseOrderTotalsService {
|
|
|
210
210
|
});
|
|
211
211
|
return [PartsTotalAfterDisc, PartsDiscountedTotal, TotalTaxAmt];
|
|
212
212
|
}
|
|
213
|
-
static GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust) {
|
|
213
|
+
static GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust, DecimalsNumber) {
|
|
214
214
|
let Total = 0;
|
|
215
215
|
if (IsTaxable) {
|
|
216
216
|
Total = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal);
|
|
@@ -219,9 +219,9 @@ class PurchaseOrderTotalsService {
|
|
|
219
219
|
Total = (0, aggregation_1.addition)(PartsTotalAfterDisc, ServicesTotalAfterDisc);
|
|
220
220
|
}
|
|
221
221
|
let finalTotal = (0, aggregation_1.addition)(Total, tr_utils_1.TrUtils.SetValueToZeroIfNull(Adjust));
|
|
222
|
-
return tr_utils_1.TrUtils.FixedTo(finalTotal);
|
|
222
|
+
return tr_utils_1.TrUtils.FixedTo(finalTotal, DecimalsNumber);
|
|
223
223
|
}
|
|
224
|
-
static GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, LaborList, TaxCodes, Tax, HasNoTax) {
|
|
224
|
+
static GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, LaborList, TaxCodes, Tax, HasNoTax, DecimalsNumber) {
|
|
225
225
|
let PartsInfo = this.GetPartsTotalTaxAndAfterDiscount(PartsList);
|
|
226
226
|
let ServicesInfo = this.GetServiceTotalTaxAndAfterDiscount(LaborList);
|
|
227
227
|
finalTotalsData.PartsDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[1]);
|
|
@@ -249,7 +249,7 @@ class PurchaseOrderTotalsService {
|
|
|
249
249
|
finalTotalsData.IsTaxable = IsTaxable;
|
|
250
250
|
finalTotalsData.Tax = Tax;
|
|
251
251
|
finalTotalsData.HasNoTax = HasNoTax;
|
|
252
|
-
finalTotalsData.TaxGroupData = this.GetPartsTaxGroupingFor(PartsList, TaxCodes);
|
|
252
|
+
finalTotalsData.TaxGroupData = this.GetPartsTaxGroupingFor(PartsList, TaxCodes, DecimalsNumber);
|
|
253
253
|
// finalTotalsData.TotalRoundedBy = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
|
|
254
254
|
finalTotalsData.RoundedTotal = Math.round(finalTotalsData.Total);
|
|
255
255
|
// finalTotalsData.Round = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
|
|
@@ -278,14 +278,14 @@ class PurchaseOrderTotalsService {
|
|
|
278
278
|
});
|
|
279
279
|
return [CGSTAmt, SGSTAmt, IGSTAmt];
|
|
280
280
|
}
|
|
281
|
-
static GetPartsTaxGroupingFor(PartsList, TaxCodes) {
|
|
282
|
-
return this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes);
|
|
281
|
+
static GetPartsTaxGroupingFor(PartsList, TaxCodes, DecimalsNumber) {
|
|
282
|
+
return this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
|
|
283
283
|
}
|
|
284
|
-
static GetTaxGroupingForPartsByHSN(Items, TaxCodes) {
|
|
284
|
+
static GetTaxGroupingForPartsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
285
285
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
286
286
|
// Items = this.ResetPartsHSNIfInvalid(Items);
|
|
287
287
|
let FinalMatchedParts = this.ComparePartsByHSN(Items, TaxCodes);
|
|
288
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
|
|
288
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
289
289
|
}
|
|
290
290
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
291
291
|
Items.forEach((Part) => {
|
|
@@ -332,7 +332,7 @@ class PurchaseOrderTotalsService {
|
|
|
332
332
|
});
|
|
333
333
|
return FinalMatchedParts;
|
|
334
334
|
}
|
|
335
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
|
|
335
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
|
|
336
336
|
let HSNTaxInfo = [];
|
|
337
337
|
FinalMatchedParts.forEach((MatchedPart) => {
|
|
338
338
|
let TaxInfo = {};
|
|
@@ -347,8 +347,8 @@ class PurchaseOrderTotalsService {
|
|
|
347
347
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
348
348
|
});
|
|
349
349
|
TaxInfo.HSN = HSN;
|
|
350
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
351
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
350
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
351
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
352
352
|
TaxInfo.PartsCount = MatchedPart.length;
|
|
353
353
|
// let CGST = this.GetCGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
354
354
|
// let SGST = this.GetSGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
@@ -3,12 +3,11 @@ export declare class VendorDebitNotePrintService {
|
|
|
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
|
}
|
|
@@ -29,13 +29,13 @@ class VendorDebitNotePrintService {
|
|
|
29
29
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
30
30
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
31
31
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
32
|
-
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
32
|
+
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
|
|
33
33
|
if (ConsolidateGST) {
|
|
34
34
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
35
35
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
36
36
|
}
|
|
37
37
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
38
|
-
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);
|
|
38
|
+
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, OriginalEntityData.Entity.DecimalsNumber);
|
|
39
39
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
40
40
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
41
41
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
@@ -103,29 +103,29 @@ class VendorDebitNotePrintService {
|
|
|
103
103
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
104
104
|
return InvoicePrintData;
|
|
105
105
|
}
|
|
106
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
106
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
107
107
|
Items.forEach((Item) => {
|
|
108
108
|
if (Consolidate) {
|
|
109
109
|
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
110
110
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
111
111
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
112
112
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
113
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
113
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
116
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
117
117
|
}
|
|
118
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
119
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
120
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
118
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
119
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
120
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
121
121
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
122
122
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
123
123
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
124
124
|
if (LineTotal === 'AT') {
|
|
125
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
125
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
128
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
129
129
|
}
|
|
130
130
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
131
131
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -220,27 +220,5 @@ class VendorDebitNotePrintService {
|
|
|
220
220
|
static GetBillToName(Title, Name) {
|
|
221
221
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
222
222
|
}
|
|
223
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
224
|
-
var i = 0;
|
|
225
|
-
let Data = {};
|
|
226
|
-
let PaidTotal = 0;
|
|
227
|
-
for (i = 0; i < InvoicePayments.length; i++) {
|
|
228
|
-
PaidTotal += InvoicePayments[i].Paid;
|
|
229
|
-
}
|
|
230
|
-
if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
|
|
231
|
-
Data.Due = 0;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
235
|
-
}
|
|
236
|
-
if (Data.Due < 0) {
|
|
237
|
-
Data.Due = 0;
|
|
238
|
-
}
|
|
239
|
-
if (Data.Due === 0) {
|
|
240
|
-
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
241
|
-
}
|
|
242
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
243
|
-
return Data;
|
|
244
|
-
}
|
|
245
223
|
}
|
|
246
224
|
exports.VendorDebitNotePrintService = VendorDebitNotePrintService;
|
|
@@ -3,10 +3,9 @@ export declare class DeliveryChallanPrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: 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 GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
10
|
static GetBillToName(Title: any, Name: string): string;
|
|
11
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
12
11
|
}
|
|
@@ -4,7 +4,6 @@ exports.DeliveryChallanPrintService = void 0;
|
|
|
4
4
|
const delivery_challan_totals_1 = require("./delivery-challan-totals");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
const code_enums_1 = require("../../enums/code-enums");
|
|
7
|
-
const enums_1 = require("../../enums/enums");
|
|
8
7
|
const my_date_1 = require("../../utils/my-date");
|
|
9
8
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
10
9
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
@@ -34,7 +33,7 @@ class DeliveryChallanPrintService {
|
|
|
34
33
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
35
34
|
}
|
|
36
35
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
37
|
-
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);
|
|
36
|
+
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, OriginalEntityData.Entity.DecimalsNumber);
|
|
38
37
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
39
38
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
40
39
|
InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
|
|
@@ -77,29 +76,29 @@ class DeliveryChallanPrintService {
|
|
|
77
76
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
78
77
|
return InvoicePrintData;
|
|
79
78
|
}
|
|
80
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
79
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
81
80
|
Items.forEach((Item) => {
|
|
82
81
|
if (Consolidate) {
|
|
83
82
|
let AfterDiscForEach = Item.AfterPartDisc / Item.Qty;
|
|
84
83
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
85
84
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
86
85
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
87
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem), DecimalsNumber);
|
|
88
87
|
}
|
|
89
88
|
else {
|
|
90
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
89
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
91
90
|
}
|
|
92
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
93
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
94
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
91
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
92
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
93
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
95
94
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
96
95
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
97
96
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
98
97
|
if (LineTotal === 'AT') {
|
|
99
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
98
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
100
99
|
}
|
|
101
100
|
else {
|
|
102
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
101
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
103
102
|
}
|
|
104
103
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
105
104
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -152,27 +151,5 @@ class DeliveryChallanPrintService {
|
|
|
152
151
|
static GetBillToName(Title, Name) {
|
|
153
152
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
154
153
|
}
|
|
155
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
156
|
-
var i = 0;
|
|
157
|
-
let Data = {};
|
|
158
|
-
let PaidTotal = 0;
|
|
159
|
-
for (i = 0; i < InvoicePayments.length; i++) {
|
|
160
|
-
PaidTotal += InvoicePayments[i].Paid;
|
|
161
|
-
}
|
|
162
|
-
if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
|
|
163
|
-
Data.Due = 0;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
167
|
-
}
|
|
168
|
-
if (Data.Due < 0) {
|
|
169
|
-
Data.Due = 0;
|
|
170
|
-
}
|
|
171
|
-
if (Data.Due === 0) {
|
|
172
|
-
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
173
|
-
}
|
|
174
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
175
|
-
return Data;
|
|
176
|
-
}
|
|
177
154
|
}
|
|
178
155
|
exports.DeliveryChallanPrintService = DeliveryChallanPrintService;
|
|
@@ -3,7 +3,7 @@ export declare class SalesPrintService {
|
|
|
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, isOtherIndustry: boolean, LineTotal: string): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, isOtherIndustry: boolean, 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;
|
|
@@ -11,5 +11,5 @@ export declare class SalesPrintService {
|
|
|
11
11
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
12
12
|
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
13
13
|
static GetBillToName(Title: any, Name: string): string;
|
|
14
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
14
|
+
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string, DecimalsNumber: number): any;
|
|
15
15
|
}
|
|
@@ -40,7 +40,7 @@ class SalesPrintService {
|
|
|
40
40
|
}
|
|
41
41
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
42
42
|
// InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes);
|
|
43
|
-
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, isOtherIndustry, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
43
|
+
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, isOtherIndustry, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, OriginalEntityData.Entity.DecimalsNumber);
|
|
44
44
|
// argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
45
45
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.SOTypeEnum.SO, argInvoiceData.Sts);
|
|
46
46
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
@@ -49,7 +49,7 @@ class SalesPrintService {
|
|
|
49
49
|
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Payments)) {
|
|
50
50
|
argInvoiceData.Payments = [];
|
|
51
51
|
}
|
|
52
|
-
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
|
|
52
|
+
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts, OriginalEntityData.Entity.DecimalsNumber);
|
|
53
53
|
if (argInvoiceData.Settings.DiscLvl !== 'REC') {
|
|
54
54
|
InvoicePrintData.FixedDisc = null;
|
|
55
55
|
}
|
|
@@ -97,7 +97,7 @@ class SalesPrintService {
|
|
|
97
97
|
InvoicePrintData.RefNo = OriginalInvoiceData.RefNo;
|
|
98
98
|
return InvoicePrintData;
|
|
99
99
|
}
|
|
100
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, isOtherIndustry, LineTotal) {
|
|
100
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, isOtherIndustry, LineTotal, DecimalsNumber) {
|
|
101
101
|
let Amt = 0;
|
|
102
102
|
let TaxAmt = 0;
|
|
103
103
|
let TotalAmt = 0;
|
|
@@ -117,25 +117,25 @@ class SalesPrintService {
|
|
|
117
117
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
118
118
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
119
119
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
120
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
|
|
120
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem), DecimalsNumber);
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
123
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
124
124
|
}
|
|
125
125
|
if (isOtherIndustry && tr_utils_1.TrUtils.IsNull(Item.Type) && !tr_utils_1.TrUtils.IsNull(Item.Model) && !tr_utils_1.TrUtils.IsNull(Item.TR)) {
|
|
126
126
|
Item.Desc = Item.Desc + '( ' + Item.Model + ', ' + Item.TR + ' TR )';
|
|
127
127
|
}
|
|
128
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
129
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
130
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
128
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
129
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
130
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
131
131
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
132
132
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
133
133
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
134
134
|
if (LineTotal === 'AT') {
|
|
135
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterItemTax);
|
|
135
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterItemTax, DecimalsNumber);
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
138
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
139
139
|
}
|
|
140
140
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
141
141
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -143,19 +143,19 @@ class SalesPrintService {
|
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
145
|
if (Item.Type === 'Sub') {
|
|
146
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(Amt);
|
|
146
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(Amt, DecimalsNumber);
|
|
147
147
|
Amt = 0;
|
|
148
148
|
}
|
|
149
149
|
if (Item.Type === 'Tax') {
|
|
150
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(TaxAmt);
|
|
150
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(TaxAmt, DecimalsNumber);
|
|
151
151
|
TaxAmt = 0;
|
|
152
152
|
}
|
|
153
153
|
if (Item.Type === 'Disc') {
|
|
154
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(DiscAmt);
|
|
154
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(DiscAmt, DecimalsNumber);
|
|
155
155
|
DiscAmt = 0;
|
|
156
156
|
}
|
|
157
157
|
if (Item.Type === 'Tot') {
|
|
158
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(TotalAmt);
|
|
158
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixedTo(TotalAmt, DecimalsNumber);
|
|
159
159
|
TotalAmt = 0;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -282,7 +282,7 @@ class SalesPrintService {
|
|
|
282
282
|
static GetBillToName(Title, Name) {
|
|
283
283
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
284
284
|
}
|
|
285
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
285
|
+
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus, DecimalsNumber) {
|
|
286
286
|
var i = 0;
|
|
287
287
|
let Data = {};
|
|
288
288
|
let PaidTotal = 0;
|
|
@@ -293,7 +293,7 @@ class SalesPrintService {
|
|
|
293
293
|
Data.Due = 0;
|
|
294
294
|
}
|
|
295
295
|
else {
|
|
296
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
296
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
|
|
297
297
|
}
|
|
298
298
|
if (Data.Due < 0) {
|
|
299
299
|
Data.Due = 0;
|
|
@@ -301,7 +301,7 @@ class SalesPrintService {
|
|
|
301
301
|
if (Data.Due === 0) {
|
|
302
302
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
303
303
|
}
|
|
304
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
304
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal, DecimalsNumber);
|
|
305
305
|
return Data;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -27,32 +27,32 @@ export declare class EstPrintService {
|
|
|
27
27
|
static SeparateROCollisionsByItems(Collisions: any, Ops: any, Parts: any): any[];
|
|
28
28
|
static ResetQtyAndUoM(Parts: any): any;
|
|
29
29
|
static CheckAndShowItemsAsAR(argROData: any): boolean;
|
|
30
|
-
static ConvertItemsAsAR(ROPrintData: any, Consolidate: boolean): any;
|
|
30
|
+
static ConvertItemsAsAR(ROPrintData: any, Consolidate: boolean, DecimalsNumber: number): any;
|
|
31
31
|
static ResetItemsDataById(Collision: any, AddedOperations: any[], AddedParts: any[]): any;
|
|
32
32
|
static GetPartDataById(PartId: any, AddedParts: any[]): any;
|
|
33
33
|
static GetLaborDataById(LaborId: any, AddedOperations: any[]): any;
|
|
34
34
|
static EmptyInvalidCollisionRepairItems(Colli: any): any;
|
|
35
|
-
static GetLineTotals(ROPrintData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean): any;
|
|
35
|
+
static GetLineTotals(ROPrintData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean, DecimalsNumber: number): any;
|
|
36
36
|
static GetCollisionPartLineTotal(PartData: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean): number;
|
|
37
37
|
static GetCollisionLaborLineTotal(LaborData: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean): number;
|
|
38
|
-
static GetLaborLineTotal(LaborData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean): number;
|
|
39
|
-
static GetPartLineTotal(PartData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean): number;
|
|
38
|
+
static GetLaborLineTotal(LaborData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean, DecimalsNumber: number): number;
|
|
39
|
+
static GetPartLineTotal(PartData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, Consolidate: boolean, DecimalsNumber: number): number;
|
|
40
40
|
static ReverseItemsForROPrint(argROData: any, isReverse: boolean): any;
|
|
41
|
-
static CheckAndGetCombinedTotals(AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, finalTotalsData: any): any;
|
|
42
|
-
static GetDetailedInfoForItems(ROTotalsData: any): any;
|
|
43
|
-
static GetCustLaborPrintInfo(LaborList: any): any;
|
|
44
|
-
static GetCustItemsPrintInfo(Items: any, LaborList: any): any;
|
|
45
|
-
static GetCustTaxInfo(ROTotalsData: any, IncludeGST: boolean, TaxCodes: any[]): any;
|
|
46
|
-
static GetCustLaborTaxInfo(LaborList: any, IncludeGST: boolean, TaxCodes: any[]): any;
|
|
47
|
-
static GetCustPartTaxInfo(Items: any, LaborList: any, IncludeGST: boolean, TaxCodes: any[]): any;
|
|
48
|
-
static GetLaborAndPartItemsAfterDisc(ROTotalsData: any): any;
|
|
49
|
-
static GetCustLaborAfterDiscPrintInfo(LaborList: any): any;
|
|
50
|
-
static GetCustItemsAfterDiscPrintInfo(Items: any, LaborList: any): any;
|
|
41
|
+
static CheckAndGetCombinedTotals(AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, finalTotalsData: any, DecimalsNumber: number): any;
|
|
42
|
+
static GetDetailedInfoForItems(ROTotalsData: any, DecimalsNumber: number): any;
|
|
43
|
+
static GetCustLaborPrintInfo(LaborList: any, DecimalsNumber: number): any;
|
|
44
|
+
static GetCustItemsPrintInfo(Items: any, LaborList: any, DecimalsNumber: number): any;
|
|
45
|
+
static GetCustTaxInfo(ROTotalsData: any, IncludeGST: boolean, TaxCodes: any[], DecimalsNumber: number): any;
|
|
46
|
+
static GetCustLaborTaxInfo(LaborList: any, IncludeGST: boolean, TaxCodes: any[], DecimalsNumber: number): any;
|
|
47
|
+
static GetCustPartTaxInfo(Items: any, LaborList: any, IncludeGST: boolean, TaxCodes: any[], DecimalsNumber: number): any;
|
|
48
|
+
static GetLaborAndPartItemsAfterDisc(ROTotalsData: any, DecimalsNumber: number): any;
|
|
49
|
+
static GetCustLaborAfterDiscPrintInfo(LaborList: any, DecimalsNumber: number): any;
|
|
50
|
+
static GetCustItemsAfterDiscPrintInfo(Items: any, LaborList: any, DecimalsNumber: number): any;
|
|
51
51
|
static GetPartParentStatus(PartOpId: any, LaborList: any): any;
|
|
52
|
-
static GetCombinedInfoForItems(ROTotalsData: any): any;
|
|
53
|
-
static GetLaborCombinedPrintInfo(LaborList: any): any;
|
|
54
|
-
static GetItemsCombinedPrintInfo(Items: any): any;
|
|
55
|
-
static GetSplitInfoForParts(Items: any): any;
|
|
52
|
+
static GetCombinedInfoForItems(ROTotalsData: any, DecimalsNumber: number): any;
|
|
53
|
+
static GetLaborCombinedPrintInfo(LaborList: any, DecimalsNumber: number): any;
|
|
54
|
+
static GetItemsCombinedPrintInfo(Items: any, DecimalsNumber: number): any;
|
|
55
|
+
static GetSplitInfoForParts(Items: any, DecimalsNumber: number): any;
|
|
56
56
|
static CheckLaborTaxItemIndex(LaborList: any[]): any;
|
|
57
57
|
static CheckPartTaxItemIndex(PartsList: any[]): any;
|
|
58
58
|
static PrepareFormatForEstPrint(ROPrintData: any, SuppEstCodeValue: any, OverAllEst: boolean, argROType: any, AsEstimated: boolean): any[];
|