shareneus 1.7.324 → 1.7.325
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.
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebitNotePrintService = void 0;
|
|
4
4
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
5
|
-
const debit_note_totals_service_1 = require("./debit-note-totals.service");
|
|
6
5
|
const code_enums_1 = require("../../enums/code-enums");
|
|
7
6
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
8
7
|
const enums_1 = require("../../enums/enums");
|
|
9
8
|
const my_date_1 = require("../../utils/my-date");
|
|
10
9
|
const math_operations_1 = require("../../shared/math-operations");
|
|
10
|
+
const invoice_total_service_1 = require("../invoice/invoice-total.service");
|
|
11
11
|
class DebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, IsCustBillTo) {
|
|
13
13
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -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 =
|
|
28
|
+
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Services, argInvoiceData.Items, IsTaxable, true, null, '', null, '', argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, true, 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.Ops = this.GetLaborPrintInfo(InvoicePrintData.
|
|
34
|
+
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);
|
|
35
35
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_d = (_c = OriginalEntityData.Entity.Settings) === null || _c === void 0 ? void 0 : _c.Acc) === null || _d === void 0 ? void 0 : _d.LTot, (_e = InvoicePrintData.Entity) === null || _e === void 0 ? void 0 : _e.DecimalsNumber);
|
|
36
36
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
37
37
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
@@ -203,12 +203,14 @@ class DebitNotePrintService {
|
|
|
203
203
|
return Items;
|
|
204
204
|
}
|
|
205
205
|
static ReverseItemsForInvoicePrint(argInvoiceData) {
|
|
206
|
-
argInvoiceData.
|
|
206
|
+
argInvoiceData.Services = argInvoiceData.Services;
|
|
207
|
+
argInvoiceData.Items = argInvoiceData.Items;
|
|
207
208
|
return argInvoiceData;
|
|
208
209
|
}
|
|
209
210
|
static PrepareFormatForInvoicePrint(InvoicePrintData, ROType, InvoiceStatus) {
|
|
210
211
|
let PrintInfo = [];
|
|
211
212
|
let ROLaborParts = {};
|
|
213
|
+
ROLaborParts.Services = InvoicePrintData.Services;
|
|
212
214
|
ROLaborParts.Items = InvoicePrintData.Items;
|
|
213
215
|
ROLaborParts.Sts = InvoiceStatus;
|
|
214
216
|
ROLaborParts.Type = ROType;
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { TrUtils } from '../../utils/tr-utils';
|
|
|
7
7
|
import { InvoiceStatusEnum, PayTypeEnum } from '../../enums/enums';
|
|
8
8
|
import { MyDate } from '../../utils/my-date';
|
|
9
9
|
import { Add, Divide, Multiply, Subtract } from '../../shared/math-operations';
|
|
10
|
+
import { InvoiceTotalsService } from '../invoice/invoice-total.service';
|
|
10
11
|
|
|
11
12
|
export class DebitNotePrintService {
|
|
12
13
|
|
|
@@ -38,8 +39,8 @@ export class DebitNotePrintService {
|
|
|
38
39
|
|
|
39
40
|
let IsTaxable: boolean = (IncludeGST && TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
40
41
|
|
|
41
|
-
let finalTotalsData: any =
|
|
42
|
-
true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
|
|
42
|
+
let finalTotalsData: any = InvoiceTotalsService.GetTotalsValue(argInvoiceData.Services, argInvoiceData.Items, IsTaxable,
|
|
43
|
+
true, null, '', null, '', argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, true, InvoicePrintData.Entity);
|
|
43
44
|
|
|
44
45
|
if (ConsolidateGST) {
|
|
45
46
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
@@ -47,7 +48,7 @@ export class DebitNotePrintService {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
InvoicePrintData = TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
50
|
-
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.
|
|
51
|
+
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes, OriginalEntityData.Entity.Settings?.Acc?.LTot, InvoicePrintData.Entity.DecimalsNumber);
|
|
51
52
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, OriginalEntityData.Entity.Settings?.Acc?.LTot, InvoicePrintData.Entity?.DecimalsNumber);
|
|
52
53
|
|
|
53
54
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
@@ -238,7 +239,8 @@ export class DebitNotePrintService {
|
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
static ReverseItemsForInvoicePrint(argInvoiceData: any) {
|
|
241
|
-
|
|
242
|
+
argInvoiceData.Services = argInvoiceData.Services;
|
|
243
|
+
argInvoiceData.Items = argInvoiceData.Items;
|
|
242
244
|
return argInvoiceData;
|
|
243
245
|
}
|
|
244
246
|
|
|
@@ -246,7 +248,7 @@ export class DebitNotePrintService {
|
|
|
246
248
|
let PrintInfo: any[] = [];
|
|
247
249
|
|
|
248
250
|
let ROLaborParts: any = {};
|
|
249
|
-
|
|
251
|
+
ROLaborParts.Services = InvoicePrintData.Services;
|
|
250
252
|
ROLaborParts.Items = InvoicePrintData.Items;
|
|
251
253
|
|
|
252
254
|
ROLaborParts.Sts = InvoiceStatus;
|