shareneus 1.7.334 → 1.7.335
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.
|
@@ -246,7 +246,7 @@ function WithOutDiscountFieldTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body,
|
|
|
246
246
|
return a;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
function calculatePartsTotals(Parts, DecimalsNumber) {
|
|
249
|
+
function calculatePartsTotals(ConsolidateGST, Parts, DecimalsNumber) {
|
|
250
250
|
let Qty = 0;
|
|
251
251
|
let CGSTAMT = 0;
|
|
252
252
|
let SGSTAMT = 0;
|
|
@@ -258,12 +258,12 @@ function calculatePartsTotals(Parts, DecimalsNumber) {
|
|
|
258
258
|
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
|
|
259
259
|
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
|
|
260
260
|
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
|
|
261
|
-
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
261
|
+
Taxable = ConsolidateGST ? (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber)) : (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
262
262
|
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
|
|
263
263
|
});
|
|
264
264
|
return { Qty, CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
|
|
265
265
|
}
|
|
266
|
-
function calculateLaborTotals(Labor, DecimalsNumber) {
|
|
266
|
+
function calculateLaborTotals(ConsolidateGST, Labor, DecimalsNumber) {
|
|
267
267
|
let CGSTAMT = 0;
|
|
268
268
|
let SGSTAMT = 0;
|
|
269
269
|
let IGSTAMT = 0;
|
|
@@ -273,13 +273,13 @@ function calculateLaborTotals(Labor, DecimalsNumber) {
|
|
|
273
273
|
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
|
|
274
274
|
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
|
|
275
275
|
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
|
|
276
|
-
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
276
|
+
Taxable = ConsolidateGST ? (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber)) : (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
277
277
|
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
|
|
278
278
|
});
|
|
279
279
|
return { CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
|
|
280
280
|
}
|
|
281
|
-
function addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber) {
|
|
282
|
-
const totals = calculatePartsTotals(Parts, DecimalsNumber);
|
|
281
|
+
function addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST) {
|
|
282
|
+
const totals = calculatePartsTotals(ConsolidateGST, Parts, DecimalsNumber);
|
|
283
283
|
let dpartadding1 = {};
|
|
284
284
|
dpartadding1.SNo = '';
|
|
285
285
|
dpartadding1.Desc = partsTotalLabel;
|
|
@@ -301,8 +301,8 @@ function addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxC
|
|
|
301
301
|
dummypartadding1.LineTotal = '';
|
|
302
302
|
Parts.unshift(dummypartadding1);
|
|
303
303
|
}
|
|
304
|
-
function addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber) {
|
|
305
|
-
const totals = calculateLaborTotals(Labor, DecimalsNumber);
|
|
304
|
+
function addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST) {
|
|
305
|
+
const totals = calculateLaborTotals(ConsolidateGST, Labor, DecimalsNumber);
|
|
306
306
|
let dpartadding1 = {};
|
|
307
307
|
dpartadding1.SNo = '';
|
|
308
308
|
dpartadding1.Desc = laborTotalLabel;
|
|
@@ -450,11 +450,11 @@ function BuildTableBodyForLaborAndParts(Parts, Labor, PrintPartNo, ShowTaxColumn
|
|
|
450
450
|
const laborLabel = 'Service';
|
|
451
451
|
const laborTotalLabel = 'Service Total';
|
|
452
452
|
if (Parts.length !== 0) {
|
|
453
|
-
addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber);
|
|
453
|
+
addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST);
|
|
454
454
|
}
|
|
455
455
|
buildTableRows(Parts, columns, partsLabel, body);
|
|
456
456
|
if (Labor.length !== 0) {
|
|
457
|
-
addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber);
|
|
457
|
+
addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST);
|
|
458
458
|
}
|
|
459
459
|
if (Body === 2) {
|
|
460
460
|
for (let i = 0; i < Labor.length; i++) {
|
package/package.json
CHANGED
|
@@ -243,7 +243,7 @@ export function WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
function calculatePartsTotals(Parts: any, DecimalsNumber: number) {
|
|
246
|
+
function calculatePartsTotals(ConsolidateGST: boolean, Parts: any, DecimalsNumber: number) {
|
|
247
247
|
let Qty: number = 0;
|
|
248
248
|
let CGSTAMT: number = 0;
|
|
249
249
|
let SGSTAMT: number = 0;
|
|
@@ -256,14 +256,14 @@ function calculatePartsTotals(Parts: any, DecimalsNumber: number) {
|
|
|
256
256
|
CGSTAMT = Add(CGSTAMT, TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
|
|
257
257
|
SGSTAMT = Add(SGSTAMT, TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
|
|
258
258
|
IGSTAMT = Add(IGSTAMT, TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
|
|
259
|
-
Taxable = Add(Taxable, TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
259
|
+
Taxable = ConsolidateGST ? Add(FinalTotal, TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber)) : Add(Taxable, TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
260
260
|
FinalTotal = Add(FinalTotal, TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
|
|
261
261
|
});
|
|
262
262
|
|
|
263
263
|
return { Qty, CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
function calculateLaborTotals(Labor: any, DecimalsNumber: number) {
|
|
266
|
+
function calculateLaborTotals(ConsolidateGST: boolean, Labor: any, DecimalsNumber: number) {
|
|
267
267
|
let CGSTAMT: number = 0;
|
|
268
268
|
let SGSTAMT: number = 0;
|
|
269
269
|
let IGSTAMT: number = 0;
|
|
@@ -274,15 +274,15 @@ function calculateLaborTotals(Labor: any, DecimalsNumber: number) {
|
|
|
274
274
|
CGSTAMT = Add(CGSTAMT, TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
|
|
275
275
|
SGSTAMT = Add(SGSTAMT, TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
|
|
276
276
|
IGSTAMT = Add(IGSTAMT, TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
|
|
277
|
-
Taxable = Add(Taxable, TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
277
|
+
Taxable = ConsolidateGST ? Add(FinalTotal, TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber)) : Add(Taxable, TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
278
278
|
FinalTotal = Add(FinalTotal, TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
return { CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
function addPartsHeaderAndTotalRows(Parts: any, partsLabel: string, partsTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number) {
|
|
285
|
-
const totals = calculatePartsTotals(Parts, DecimalsNumber);
|
|
284
|
+
function addPartsHeaderAndTotalRows(Parts: any, partsLabel: string, partsTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number, ConsolidateGST: boolean) {
|
|
285
|
+
const totals = calculatePartsTotals(ConsolidateGST, Parts, DecimalsNumber);
|
|
286
286
|
|
|
287
287
|
let dpartadding1: any = {};
|
|
288
288
|
dpartadding1.SNo = '';
|
|
@@ -307,8 +307,8 @@ function addPartsHeaderAndTotalRows(Parts: any, partsLabel: string, partsTotalLa
|
|
|
307
307
|
Parts.unshift(dummypartadding1);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
function addLaborHeaderAndTotalRows(Labor: any, laborLabel: string, laborTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number) {
|
|
311
|
-
const totals = calculateLaborTotals(Labor, DecimalsNumber);
|
|
310
|
+
function addLaborHeaderAndTotalRows(Labor: any, laborLabel: string, laborTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number, ConsolidateGST: boolean) {
|
|
311
|
+
const totals = calculateLaborTotals(ConsolidateGST, Labor, DecimalsNumber);
|
|
312
312
|
|
|
313
313
|
let dpartadding1: any = {};
|
|
314
314
|
dpartadding1.SNo = '';
|
|
@@ -451,13 +451,13 @@ export function BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPart
|
|
|
451
451
|
const laborTotalLabel = 'Service Total';
|
|
452
452
|
|
|
453
453
|
if (Parts.length !== 0) {
|
|
454
|
-
addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber);
|
|
454
|
+
addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
buildTableRows(Parts, columns, partsLabel, body);
|
|
458
458
|
|
|
459
459
|
if (Labor.length !== 0) {
|
|
460
|
-
addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber);
|
|
460
|
+
addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber, ConsolidateGST);
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
if (Body === 2) {
|