shareneus 1.4.95 → 1.4.97
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/index.d.ts +4 -0
- package/dist/index.js +9 -1
- package/dist/sales-receive/sales-receive-pdf.service.d.ts +272 -0
- package/dist/sales-receive/sales-receive-pdf.service.js +578 -0
- package/dist/sales-receive/sales-receive-print.service.d.ts +13 -0
- package/dist/sales-receive/sales-receive-print.service.js +187 -0
- package/dist/sales-receive/sales-receive-totals.service.d.ts +212 -0
- package/dist/sales-receive/sales-receive-totals.service.js +573 -0
- package/dist/sales-receive/sales-total-calculation.d.ts +5 -0
- package/dist/sales-receive/sales-total-calculation.js +152 -0
- package/package.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SalesReceivePrintService = void 0;
|
|
4
|
+
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
|
+
const code_enums_1 = require("../enums/code-enums");
|
|
6
|
+
const enums_1 = require("../enums/enums");
|
|
7
|
+
const shared_print_service_1 = require("../shared/shared-print.service");
|
|
8
|
+
const my_date_1 = require("../utils/my-date");
|
|
9
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
10
|
+
const sales_receive_totals_service_1 = require("./sales-receive-totals.service");
|
|
11
|
+
class SalesReceivePrintService {
|
|
12
|
+
static GetSalesReceivePrintInfo(OriginalSalesReceiveData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
let ForInsurance = !tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.BillTo.InsId);
|
|
15
|
+
let SalesReceivePrintData = {};
|
|
16
|
+
let argSalesReceiveData = tr_utils_1.TrUtils.Stringify(OriginalSalesReceiveData);
|
|
17
|
+
if (!IncludeGST) {
|
|
18
|
+
argSalesReceiveData.Settings.Tax = 'NO';
|
|
19
|
+
}
|
|
20
|
+
SalesReceivePrintData.IsProforma = IsProforma;
|
|
21
|
+
SalesReceivePrintData.Settings = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.Settings);
|
|
22
|
+
SalesReceivePrintData.SType = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.SType);
|
|
23
|
+
let SType = tr_utils_1.TrUtils.IsNull(argSalesReceiveData.SType) ? null : argSalesReceiveData.SType;
|
|
24
|
+
SalesReceivePrintData = this.GetPrintConditionsBasedOnInput(SalesReceivePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argSalesReceiveData, IsProforma);
|
|
25
|
+
SalesReceivePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalSalesReceiveData);
|
|
26
|
+
SalesReceivePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(SalesReceivePrintData, OriginalEntityData, image);
|
|
27
|
+
SalesReceivePrintData = this.GetSalesReceiveOtherDetailsForPrint(SalesReceivePrintData, argSalesReceiveData);
|
|
28
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argSalesReceiveData.Settings.Tax)) ? true : false;
|
|
29
|
+
let finalTotalsData = sales_receive_totals_service_1.SalesReceiveTotalsService.GetTotalsValue([], argSalesReceiveData.Items, IsTaxable, true, argSalesReceiveData.Disc, argSalesReceiveData.Perc, TaxCodes, true, argSalesReceiveData.Settings, SalesReceivePrintData.Entity);
|
|
30
|
+
if (ConsolidateGST) {
|
|
31
|
+
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
32
|
+
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
33
|
+
}
|
|
34
|
+
SalesReceivePrintData = tr_utils_1.TrUtils.ConcatObjects(SalesReceivePrintData, finalTotalsData);
|
|
35
|
+
SalesReceivePrintData.Items = this.GetItemsPrintInfo(SalesReceivePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, SalesReceivePrintData.Entity.DecimalsNumber);
|
|
36
|
+
argSalesReceiveData = this.ReverseItemsForSalesReceivePrint(argSalesReceiveData);
|
|
37
|
+
SalesReceivePrintData.PrintInfo = this.PrepareFormatForSalesReceivePrint(SalesReceivePrintData, code_enums_1.ROTypeEnum.Invoice, argSalesReceiveData.Sts);
|
|
38
|
+
SalesReceivePrintData = this.GetFormattedProductDataForPrint(argSalesReceiveData, SalesReceivePrintData);
|
|
39
|
+
SalesReceivePrintData = this.GetBillNameForSalesReceivePrint(argSalesReceiveData, SalesReceivePrintData);
|
|
40
|
+
SalesReceivePrintData.Consolidate = ConsolidateGST;
|
|
41
|
+
return SalesReceivePrintData;
|
|
42
|
+
}
|
|
43
|
+
static GetPrintConditionsBasedOnInput(SalesReceivePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, OriginalSalesReceiveData, IsProforma) {
|
|
44
|
+
SalesReceivePrintData.ForInsurance = ForInsurance;
|
|
45
|
+
SalesReceivePrintData.For = ForInsurance ? enums_1.PayTypeEnum.Insurance : enums_1.PayTypeEnum.Customer;
|
|
46
|
+
SalesReceivePrintData.IncludeGST = IncludeGST;
|
|
47
|
+
SalesReceivePrintData.ConsolidateGST = ConsolidateGST;
|
|
48
|
+
SalesReceivePrintData.ShowAccParts = false;
|
|
49
|
+
SalesReceivePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
50
|
+
SalesReceivePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
51
|
+
// SalesReceivePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
52
|
+
SalesReceivePrintData = this.GetSalesReceiveTypeHeading(SalesReceivePrintData, OriginalSalesReceiveData, IncludeGST, ConsolidateGST, IsProforma);
|
|
53
|
+
SalesReceivePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalSalesReceiveData.PrDate);
|
|
54
|
+
return SalesReceivePrintData;
|
|
55
|
+
}
|
|
56
|
+
static GetSalesReceiveTypeHeading(SalesReceivePrintData, OriginalSalesReceiveData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
57
|
+
SalesReceivePrintData.HeaderName = 'Sales Receive';
|
|
58
|
+
return SalesReceivePrintData;
|
|
59
|
+
}
|
|
60
|
+
static GetSalesReceiveOtherDetailsForPrint(SalesReceivePrintData, OriginalSalesReceiveData) {
|
|
61
|
+
SalesReceivePrintData.Type = 'Sales Receive';
|
|
62
|
+
SalesReceivePrintData._id = OriginalSalesReceiveData.Code;
|
|
63
|
+
SalesReceivePrintData.Sts = OriginalSalesReceiveData.Sts;
|
|
64
|
+
SalesReceivePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalSalesReceiveData.CrDate);
|
|
65
|
+
return SalesReceivePrintData;
|
|
66
|
+
}
|
|
67
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
68
|
+
Items.forEach((Item) => {
|
|
69
|
+
if (Consolidate) {
|
|
70
|
+
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
71
|
+
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
72
|
+
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
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), DecimalsNumber);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
78
|
+
}
|
|
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
|
+
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
83
|
+
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
84
|
+
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
85
|
+
if (LineTotal === 'AT') {
|
|
86
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
90
|
+
}
|
|
91
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
92
|
+
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return Items;
|
|
96
|
+
}
|
|
97
|
+
static ReverseItemsForSalesReceivePrint(argSalesReceiveData) {
|
|
98
|
+
// argSalesReceiveData.Ops = argSalesReceiveData.Ops.reverse();
|
|
99
|
+
argSalesReceiveData.Items = argSalesReceiveData.Items.reverse();
|
|
100
|
+
return argSalesReceiveData;
|
|
101
|
+
}
|
|
102
|
+
static PrepareFormatForSalesReceivePrint(SalesReceivePrintData, ROType, InvoiceStatus) {
|
|
103
|
+
let PrintInfo = [];
|
|
104
|
+
let SRLaborParts = {};
|
|
105
|
+
// SRLaborParts.Ops = SalesReceivePrintData.Ops;
|
|
106
|
+
SRLaborParts.Items = SalesReceivePrintData.Items;
|
|
107
|
+
SRLaborParts.Sts = InvoiceStatus;
|
|
108
|
+
SRLaborParts.Type = ROType;
|
|
109
|
+
PrintInfo.push(SRLaborParts);
|
|
110
|
+
return PrintInfo;
|
|
111
|
+
}
|
|
112
|
+
static GetFormattedProductDataForPrint(OriginalSalesReceiveData, SalesReceivePrintData) {
|
|
113
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.Prod)) {
|
|
114
|
+
SalesReceivePrintData.Product = OriginalSalesReceiveData.Prod;
|
|
115
|
+
if (tr_utils_1.TrUtils.IsNull(SalesReceivePrintData.Product.VIN)) {
|
|
116
|
+
SalesReceivePrintData.Product.VIN = '';
|
|
117
|
+
}
|
|
118
|
+
if (tr_utils_1.TrUtils.IsNull(SalesReceivePrintData.Product.RegNo)) {
|
|
119
|
+
SalesReceivePrintData.Product.RegNo = '';
|
|
120
|
+
}
|
|
121
|
+
if (tr_utils_1.TrUtils.IsNull(SalesReceivePrintData.Product.EngNo)) {
|
|
122
|
+
SalesReceivePrintData.Product.EngNo = '';
|
|
123
|
+
}
|
|
124
|
+
SalesReceivePrintData.MIn = OriginalSalesReceiveData.Prod.MIn;
|
|
125
|
+
SalesReceivePrintData.MOut = OriginalSalesReceiveData.Prod.MOut;
|
|
126
|
+
}
|
|
127
|
+
return SalesReceivePrintData;
|
|
128
|
+
}
|
|
129
|
+
static GetBillNameForSalesReceivePrint(OriginalSalesReceiveData, SalesReceivePrintData) {
|
|
130
|
+
let Customer = {};
|
|
131
|
+
Customer.Name = OriginalSalesReceiveData.BillTo.Name;
|
|
132
|
+
Customer.Adrs = [];
|
|
133
|
+
Customer.Cons = [];
|
|
134
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.BillTo.Adrs)) {
|
|
135
|
+
Customer.Adrs.push(OriginalSalesReceiveData.BillTo.Adrs.A1);
|
|
136
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalSalesReceiveData.BillTo.Adrs.A2)) {
|
|
137
|
+
Customer.Adrs.push(OriginalSalesReceiveData.BillTo.Adrs.A2);
|
|
138
|
+
}
|
|
139
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalSalesReceiveData.BillTo.Adrs.Ct)) {
|
|
140
|
+
Customer.Adrs.push(OriginalSalesReceiveData.BillTo.Adrs.Ct);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
Customer.GSTIN = OriginalSalesReceiveData.BillTo.GSTIN;
|
|
144
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalSalesReceiveData.BillTo.Ph)) {
|
|
145
|
+
Customer.Cons = [
|
|
146
|
+
{
|
|
147
|
+
Type: 'M',
|
|
148
|
+
No: OriginalSalesReceiveData.BillTo.Ph
|
|
149
|
+
}
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
SalesReceivePrintData.Customer = Customer;
|
|
153
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.BillTo.InsId)) {
|
|
154
|
+
SalesReceivePrintData.Cust = this.GetCustomerDetails(OriginalSalesReceiveData);
|
|
155
|
+
}
|
|
156
|
+
return SalesReceivePrintData;
|
|
157
|
+
}
|
|
158
|
+
static GetCustomerDetails(OriginalSalesReceiveData) {
|
|
159
|
+
let Customer = {};
|
|
160
|
+
Customer.Name = this.GetBillToName(OriginalSalesReceiveData.Cust.Title, OriginalSalesReceiveData.Cust.Name);
|
|
161
|
+
Customer.Cons = [];
|
|
162
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalSalesReceiveData.Cust.Ph)) {
|
|
163
|
+
Customer.Cons = [
|
|
164
|
+
{
|
|
165
|
+
Type: 'M',
|
|
166
|
+
No: OriginalSalesReceiveData.Cust.Ph
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
Customer.GSTIN = OriginalSalesReceiveData.Cust.GSTIN;
|
|
171
|
+
Customer.Adrs = [];
|
|
172
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalSalesReceiveData.Cust.Adrs)) {
|
|
173
|
+
Customer.Adrs.push(OriginalSalesReceiveData.Cust.Adrs.A1);
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalSalesReceiveData.Cust.Adrs.A2)) {
|
|
175
|
+
Customer.Adrs.push(OriginalSalesReceiveData.Cust.Adrs.A2);
|
|
176
|
+
}
|
|
177
|
+
Customer.Adrs.push(OriginalSalesReceiveData.Cust.Adrs.Ct);
|
|
178
|
+
}
|
|
179
|
+
Customer.ConName = OriginalSalesReceiveData.Cust.ConName;
|
|
180
|
+
Customer.ConPh = OriginalSalesReceiveData.Cust.ConPhone;
|
|
181
|
+
return Customer;
|
|
182
|
+
}
|
|
183
|
+
static GetBillToName(Title, Name) {
|
|
184
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.SalesReceivePrintService = SalesReceivePrintService;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service class for calculating sales receive totals including taxes, discounts and final amounts
|
|
3
|
+
*/
|
|
4
|
+
export declare class SalesReceiveTotalsService {
|
|
5
|
+
/**
|
|
6
|
+
* Main method to calculate totals for sales receive operations
|
|
7
|
+
* @param opCodesList - Array of operation codes/labor items
|
|
8
|
+
* @param PartsList - Array of parts/items to be processed
|
|
9
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
10
|
+
* @param DetailedInfo - Whether to include detailed breakdown information
|
|
11
|
+
* @param Disc - Discount amount
|
|
12
|
+
* @param Perc - Discount percentage
|
|
13
|
+
* @param TaxCodes - Available tax codes for GST calculations
|
|
14
|
+
* @param WithItems - Whether to include items in the response
|
|
15
|
+
* @param Settings - General settings object
|
|
16
|
+
* @param EntitySettings - Entity-specific settings including decimal places
|
|
17
|
+
* @returns Object containing calculated totals and breakdown information
|
|
18
|
+
*/
|
|
19
|
+
static GetTotalsValue(opCodesList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, EntitySettings?: any): any;
|
|
20
|
+
/**
|
|
21
|
+
* Calculates labor part values including discounts and taxes
|
|
22
|
+
* @param PartsList - Array of parts to be processed
|
|
23
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
24
|
+
* @returns Processed parts list with calculated values
|
|
25
|
+
*/
|
|
26
|
+
static CalculateLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
27
|
+
/**
|
|
28
|
+
* Resets and recalculates labor part values including discounts and taxes
|
|
29
|
+
* @param PartsList - Array of parts to be processed
|
|
30
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
31
|
+
* @returns Parts list with reset and recalculated values
|
|
32
|
+
*/
|
|
33
|
+
static ResetLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
34
|
+
/**
|
|
35
|
+
* Resets part values to zero if they are null or invalid
|
|
36
|
+
* @param Part - Individual part item to reset
|
|
37
|
+
* @returns Part with reset values
|
|
38
|
+
*/
|
|
39
|
+
static ResetLaborPartValueIfInvalid(Part: any): any;
|
|
40
|
+
/**
|
|
41
|
+
* Prepares final repair order data for saving with calculated totals
|
|
42
|
+
* @param LaborList - Array of labor items
|
|
43
|
+
* @param PartsList - Array of parts
|
|
44
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
45
|
+
* @param Disc - Discount amount
|
|
46
|
+
* @param Perc - Discount percentage
|
|
47
|
+
* @param DetailedInfo - Whether to include detailed information
|
|
48
|
+
* @param Settings - General settings
|
|
49
|
+
* @param DecimalsNumber - Number of decimal places for calculations
|
|
50
|
+
* @returns Final totals data object ready for saving
|
|
51
|
+
*/
|
|
52
|
+
static GetFinalRODataForSave(LaborList: any, PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, DecimalsNumber: any): any;
|
|
53
|
+
/**
|
|
54
|
+
* Sets main discount values in the totals data object
|
|
55
|
+
* @param Disc - Discount amount
|
|
56
|
+
* @param Perc - Discount percentage
|
|
57
|
+
* @param finalTotalsData - Totals data object to update
|
|
58
|
+
* @param DetailedInfo - Whether to include detailed information
|
|
59
|
+
* @returns Updated totals data with discount values
|
|
60
|
+
*/
|
|
61
|
+
static SetMainDiscountValues(Disc: string, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
62
|
+
/**
|
|
63
|
+
* Calculates final customer totals including subtotals, taxes, and rounded amounts
|
|
64
|
+
* @param finalTotalsData - Existing totals data object
|
|
65
|
+
* @param LaborList - Array of labor items
|
|
66
|
+
* @param PartsList - Array of parts
|
|
67
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
68
|
+
* @param DetailedInfo - Whether to include detailed information
|
|
69
|
+
* @param DecimalsNumber - Number of decimal places for calculations
|
|
70
|
+
* @returns Updated totals data with customer calculations
|
|
71
|
+
*/
|
|
72
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, DecimalsNumber?: number): any;
|
|
73
|
+
/**
|
|
74
|
+
* Calculates subtotal for labor and parts combined
|
|
75
|
+
* @param LaborList - Array of labor items
|
|
76
|
+
* @param PartsList - Array of parts
|
|
77
|
+
* @returns Calculated subtotal amount
|
|
78
|
+
*/
|
|
79
|
+
static GetSubTotalFor(LaborList: any, PartsList: any): any;
|
|
80
|
+
/**
|
|
81
|
+
* Calculates total amount for parts after applying discounts
|
|
82
|
+
* @param PartsList - Array of parts
|
|
83
|
+
* @returns Total parts amount after discounts
|
|
84
|
+
*/
|
|
85
|
+
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
86
|
+
/**
|
|
87
|
+
* Generates detailed totals data including tax breakdowns and groupings
|
|
88
|
+
* @param finalTotalsData - Existing totals data
|
|
89
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
90
|
+
* @param opCodesList - Array of operation codes
|
|
91
|
+
* @param PartsList - Array of parts
|
|
92
|
+
* @param TaxCodes - Available tax codes
|
|
93
|
+
* @param DecimalsNumber - Number of decimal places
|
|
94
|
+
* @returns Enhanced totals data with detailed breakdowns
|
|
95
|
+
*/
|
|
96
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
|
|
97
|
+
/**
|
|
98
|
+
* Groups parts by tax percentage for consolidated tax reporting
|
|
99
|
+
* @param Parts - Array of parts to group
|
|
100
|
+
* @param TaxCodes - Available tax codes
|
|
101
|
+
* @param DecimalsNumber - Number of decimal places
|
|
102
|
+
* @returns Array of parts grouped by tax percentage
|
|
103
|
+
*/
|
|
104
|
+
static GetTaxGroupingForPartsByPerc(Parts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
105
|
+
/**
|
|
106
|
+
* Compares and groups parts by tax percentage rates
|
|
107
|
+
* @param Parts - Array of parts to compare
|
|
108
|
+
* @param TaxCodes - Available tax codes
|
|
109
|
+
* @returns Array of grouped parts with same tax percentages
|
|
110
|
+
*/
|
|
111
|
+
static ComparePartsByPerc(Parts: any, TaxCodes: any): any[];
|
|
112
|
+
/**
|
|
113
|
+
* Calculates total discounted amount for all parts
|
|
114
|
+
* @param PartsList - Array of parts
|
|
115
|
+
* @param isTaxable - Whether parts are taxable
|
|
116
|
+
* @param finalTotalsData - Existing totals data
|
|
117
|
+
* @returns Total discounted amount including overall part discount
|
|
118
|
+
*/
|
|
119
|
+
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
|
|
120
|
+
/**
|
|
121
|
+
* Calculates total tax amount for all parts
|
|
122
|
+
* @param PartsList - Array of parts
|
|
123
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
124
|
+
* @returns Total tax amount for all parts
|
|
125
|
+
*/
|
|
126
|
+
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
127
|
+
/**
|
|
128
|
+
* Calculates customer total based on tax calculation type
|
|
129
|
+
* @param finalTotalsData - Existing totals data
|
|
130
|
+
* @param LaborTaxAmount - Total labor tax amount
|
|
131
|
+
* @param PartsTaxAmount - Total parts tax amount
|
|
132
|
+
* @param LaborList - Array of labor items
|
|
133
|
+
* @param PartsList - Array of parts
|
|
134
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
135
|
+
* @returns Final customer total based on tax type
|
|
136
|
+
*/
|
|
137
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): any;
|
|
138
|
+
/**
|
|
139
|
+
* Calculates items total after applying discounts (percentage or fixed)
|
|
140
|
+
* @param PartsTotalAfterDisc - Parts total after discount
|
|
141
|
+
* @param PartsTaxAmount - Parts tax amount
|
|
142
|
+
* @param MainPDisc - Main parts discount amount
|
|
143
|
+
* @param PDiscInPerc - Parts discount percentage
|
|
144
|
+
* @returns Final items total after all discounts
|
|
145
|
+
*/
|
|
146
|
+
static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
147
|
+
/**
|
|
148
|
+
* Calculates total CGST tax amount for labor items
|
|
149
|
+
* @param opCodesList - Array of operation codes/labor
|
|
150
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
151
|
+
* @returns Total CGST amount for labor
|
|
152
|
+
*/
|
|
153
|
+
static GetLaborCGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
154
|
+
/**
|
|
155
|
+
* Calculates total IGST tax amount for labor items
|
|
156
|
+
* @param opCodesList - Array of operation codes/labor
|
|
157
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
158
|
+
* @returns Total IGST amount for labor
|
|
159
|
+
*/
|
|
160
|
+
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
161
|
+
/**
|
|
162
|
+
* Calculates total SGST tax amount for labor items
|
|
163
|
+
* @param opCodesList - Array of operation codes/labor
|
|
164
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
165
|
+
* @returns Total SGST amount for labor
|
|
166
|
+
*/
|
|
167
|
+
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
168
|
+
/**
|
|
169
|
+
* Calculates GST tax breakdown for all parts (CGST, SGST, IGST, Total)
|
|
170
|
+
* @param PartsList - Array of parts
|
|
171
|
+
* @param IsIndependentTax - Whether tax is calculated independently
|
|
172
|
+
* @returns Array containing [CGST, SGST, IGST, Total Tax] amounts
|
|
173
|
+
*/
|
|
174
|
+
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
175
|
+
/**
|
|
176
|
+
* Groups parts by HSN code for tax reporting and compliance
|
|
177
|
+
* @param Parts - Array of parts to group
|
|
178
|
+
* @param TaxCodes - Available tax codes
|
|
179
|
+
* @param DecimalsNumber - Number of decimal places
|
|
180
|
+
* @returns Tax grouping information organized by HSN codes
|
|
181
|
+
*/
|
|
182
|
+
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
183
|
+
/**
|
|
184
|
+
* Adds combined tax percentage calculation to each part based on tax codes
|
|
185
|
+
* @param Parts - Array of parts to process
|
|
186
|
+
* @param TaxCodes - Available tax codes for lookup
|
|
187
|
+
* @returns Parts array with added tax percentage information
|
|
188
|
+
*/
|
|
189
|
+
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
190
|
+
/**
|
|
191
|
+
* Compares and groups parts by HSN code and tax rates
|
|
192
|
+
* @param Parts - Array of parts to compare
|
|
193
|
+
* @param TaxCodes - Available tax codes
|
|
194
|
+
* @returns Array of parts grouped by HSN code and tax rates
|
|
195
|
+
*/
|
|
196
|
+
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
197
|
+
/**
|
|
198
|
+
* Generates detailed tax information grouped by HSN codes for compliance reporting
|
|
199
|
+
* @param FinalMatchedParts - Array of grouped parts by HSN
|
|
200
|
+
* @param TaxCodes - Available tax codes
|
|
201
|
+
* @param DecimalsNumber - Number of decimal places for formatting
|
|
202
|
+
* @returns Array of HSN-wise tax information objects
|
|
203
|
+
*/
|
|
204
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
205
|
+
/**
|
|
206
|
+
* Retrieves GST values (CGST, SGST, IGST) based on tax code lookup
|
|
207
|
+
* @param TCode - Tax code identifier
|
|
208
|
+
* @param TaxCodes - Array of available tax codes
|
|
209
|
+
* @returns Array containing [CGST, SGST, IGST] values for the tax code
|
|
210
|
+
*/
|
|
211
|
+
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
212
|
+
}
|