shareneus 1.7.349 → 1.7.351
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.
|
@@ -11,7 +11,8 @@ const tr_utils_1 = require("../utils/tr-utils");
|
|
|
11
11
|
class SalesReceivePrintService {
|
|
12
12
|
static GetSalesReceivePrintInfo(OriginalSalesReceiveData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, HeaderName) {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
let ForInsurance = !
|
|
14
|
+
// let ForInsurance: boolean = !TrUtils.IsNull(OriginalSalesReceiveData.BillTo.InsId);
|
|
15
|
+
let ForInsurance = false;
|
|
15
16
|
let SalesReceivePrintData = {};
|
|
16
17
|
let argSalesReceiveData = tr_utils_1.TrUtils.Stringify(OriginalSalesReceiveData);
|
|
17
18
|
if (!IncludeGST) {
|
|
@@ -20,7 +21,7 @@ class SalesReceivePrintService {
|
|
|
20
21
|
SalesReceivePrintData.IsProforma = IsProforma;
|
|
21
22
|
SalesReceivePrintData.Settings = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.Settings);
|
|
22
23
|
SalesReceivePrintData.SType = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.SType);
|
|
23
|
-
SalesReceivePrintData.Items = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.Items);
|
|
24
|
+
SalesReceivePrintData.Items = tr_utils_1.TrUtils.Stringify(argSalesReceiveData.Items || argSalesReceiveData.Lines);
|
|
24
25
|
let SType = tr_utils_1.TrUtils.IsNull(argSalesReceiveData.SType) ? null : argSalesReceiveData.SType;
|
|
25
26
|
SalesReceivePrintData = this.GetPrintConditionsBasedOnInput(SalesReceivePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argSalesReceiveData, IsProforma, HeaderName);
|
|
26
27
|
SalesReceivePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalSalesReceiveData);
|
|
@@ -37,7 +38,7 @@ class SalesReceivePrintService {
|
|
|
37
38
|
finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.totalTaxOnItems, (0, math_operations_1.Subtract)(finalTotalsData.subtotalOnItems, finalTotalsData.totalDiscountOnItems));
|
|
38
39
|
}
|
|
39
40
|
SalesReceivePrintData = tr_utils_1.TrUtils.ConcatObjects(SalesReceivePrintData, finalTotalsData);
|
|
40
|
-
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, IsTaxable, SalesReceivePrintData.Entity.DecimalsNumber);
|
|
41
|
+
SalesReceivePrintData.Items = this.GetItemsPrintInfo(SalesReceivePrintData.Items || SalesReceivePrintData.Lines, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, IsTaxable, SalesReceivePrintData.Entity.DecimalsNumber);
|
|
41
42
|
argSalesReceiveData = this.ReverseItemsForSalesReceivePrint(argSalesReceiveData);
|
|
42
43
|
SalesReceivePrintData.PrintInfo = this.PrepareFormatForSalesReceivePrint(SalesReceivePrintData, code_enums_1.ROTypeEnum.Invoice, argSalesReceiveData.Sts);
|
|
43
44
|
SalesReceivePrintData = this.GetFormattedProductDataForPrint(argSalesReceiveData, SalesReceivePrintData);
|
|
@@ -145,7 +146,7 @@ class SalesReceivePrintService {
|
|
|
145
146
|
let PrintInfo = [];
|
|
146
147
|
let SRLaborParts = {};
|
|
147
148
|
// SRLaborParts.Ops = SalesReceivePrintData.Ops;
|
|
148
|
-
SRLaborParts.Items = SalesReceivePrintData.Items;
|
|
149
|
+
SRLaborParts.Items = SalesReceivePrintData.Items || SalesReceivePrintData.Lines;
|
|
149
150
|
SRLaborParts.Sts = InvoiceStatus;
|
|
150
151
|
SRLaborParts.Type = ROType;
|
|
151
152
|
PrintInfo.push(SRLaborParts);
|
|
@@ -169,30 +170,32 @@ class SalesReceivePrintService {
|
|
|
169
170
|
return SalesReceivePrintData;
|
|
170
171
|
}
|
|
171
172
|
static GetBillNameForSalesReceivePrint(OriginalSalesReceiveData, SalesReceivePrintData) {
|
|
173
|
+
var _a;
|
|
174
|
+
const BillTo = (_a = OriginalSalesReceiveData.BillTo) !== null && _a !== void 0 ? _a : OriginalSalesReceiveData.BFrom;
|
|
172
175
|
let Customer = {};
|
|
173
|
-
Customer.Name =
|
|
176
|
+
Customer.Name = BillTo.Name;
|
|
174
177
|
Customer.Adrs = [];
|
|
175
178
|
Customer.Cons = [];
|
|
176
|
-
if (!tr_utils_1.TrUtils.IsNull(
|
|
177
|
-
Customer.Adrs.push(
|
|
178
|
-
if (!tr_utils_1.TrUtils.IsEmpty(
|
|
179
|
-
Customer.Adrs.push(
|
|
179
|
+
if (!tr_utils_1.TrUtils.IsNull(BillTo.Adrs)) {
|
|
180
|
+
Customer.Adrs.push(BillTo.Adrs.A1);
|
|
181
|
+
if (!tr_utils_1.TrUtils.IsEmpty(BillTo.Adrs.A2)) {
|
|
182
|
+
Customer.Adrs.push(BillTo.Adrs.A2);
|
|
180
183
|
}
|
|
181
|
-
if (!tr_utils_1.TrUtils.IsEmpty(
|
|
182
|
-
Customer.Adrs.push(
|
|
184
|
+
if (!tr_utils_1.TrUtils.IsEmpty(BillTo.Adrs.Ct)) {
|
|
185
|
+
Customer.Adrs.push(BillTo.Adrs.Ct);
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
|
-
Customer.GSTIN =
|
|
186
|
-
if (!tr_utils_1.TrUtils.IsEmpty(
|
|
188
|
+
Customer.GSTIN = BillTo.GSTIN;
|
|
189
|
+
if (!tr_utils_1.TrUtils.IsEmpty(BillTo.Ph)) {
|
|
187
190
|
Customer.Cons = [
|
|
188
191
|
{
|
|
189
192
|
Type: 'M',
|
|
190
|
-
No:
|
|
193
|
+
No: BillTo.Ph
|
|
191
194
|
}
|
|
192
195
|
];
|
|
193
196
|
}
|
|
194
197
|
SalesReceivePrintData.Customer = Customer;
|
|
195
|
-
if (!tr_utils_1.TrUtils.IsNull(
|
|
198
|
+
if (!tr_utils_1.TrUtils.IsNull(BillTo.InsId)) {
|
|
196
199
|
SalesReceivePrintData.Cust = this.GetCustomerDetails(OriginalSalesReceiveData);
|
|
197
200
|
}
|
|
198
201
|
return SalesReceivePrintData;
|
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ export class SalesReceivePrintService {
|
|
|
12
12
|
static GetSalesReceivePrintInfo(OriginalSalesReceiveData: any, OriginalEntityData: any, image: any,
|
|
13
13
|
IncludeGST: boolean, ConsolidateGST: boolean, TaxCodes: any, IsProforma: boolean, HeaderName: string) {
|
|
14
14
|
|
|
15
|
-
let ForInsurance: boolean = !TrUtils.IsNull(OriginalSalesReceiveData.BillTo.InsId);
|
|
15
|
+
// let ForInsurance: boolean = !TrUtils.IsNull(OriginalSalesReceiveData.BillTo.InsId);
|
|
16
|
+
let ForInsurance: boolean = false;
|
|
16
17
|
let SalesReceivePrintData: any = {};
|
|
17
18
|
let argSalesReceiveData = TrUtils.Stringify(OriginalSalesReceiveData);
|
|
18
19
|
if (!IncludeGST) {
|
|
@@ -21,7 +22,7 @@ export class SalesReceivePrintService {
|
|
|
21
22
|
SalesReceivePrintData.IsProforma = IsProforma;
|
|
22
23
|
SalesReceivePrintData.Settings = TrUtils.Stringify(argSalesReceiveData.Settings);
|
|
23
24
|
SalesReceivePrintData.SType = TrUtils.Stringify(argSalesReceiveData.SType);
|
|
24
|
-
SalesReceivePrintData.Items = TrUtils.Stringify(argSalesReceiveData.Items);
|
|
25
|
+
SalesReceivePrintData.Items = TrUtils.Stringify(argSalesReceiveData.Items || argSalesReceiveData.Lines);
|
|
25
26
|
|
|
26
27
|
let SType: any = TrUtils.IsNull(argSalesReceiveData.SType) ? null : argSalesReceiveData.SType;
|
|
27
28
|
SalesReceivePrintData = this.GetPrintConditionsBasedOnInput(SalesReceivePrintData, IncludeGST, ConsolidateGST, ForInsurance,
|
|
@@ -40,7 +41,7 @@ export class SalesReceivePrintService {
|
|
|
40
41
|
finalTotalsData.CustPartsTotalBeforeDisc = Add(finalTotalsData.totalTaxOnItems, Subtract(finalTotalsData.subtotalOnItems, finalTotalsData.totalDiscountOnItems));
|
|
41
42
|
}
|
|
42
43
|
SalesReceivePrintData = TrUtils.ConcatObjects(SalesReceivePrintData, finalTotalsData);
|
|
43
|
-
SalesReceivePrintData.Items = this.GetItemsPrintInfo(SalesReceivePrintData.Items, ConsolidateGST, TaxCodes,
|
|
44
|
+
SalesReceivePrintData.Items = this.GetItemsPrintInfo(SalesReceivePrintData.Items || SalesReceivePrintData.Lines, ConsolidateGST, TaxCodes,
|
|
44
45
|
OriginalEntityData.Entity.Settings?.Acc?.LTot, IsTaxable, SalesReceivePrintData.Entity.DecimalsNumber);
|
|
45
46
|
argSalesReceiveData = this.ReverseItemsForSalesReceivePrint(argSalesReceiveData);
|
|
46
47
|
SalesReceivePrintData.PrintInfo = this.PrepareFormatForSalesReceivePrint(SalesReceivePrintData, ROTypeEnum.Invoice, argSalesReceiveData.Sts);
|
|
@@ -161,7 +162,7 @@ export class SalesReceivePrintService {
|
|
|
161
162
|
|
|
162
163
|
// SRLaborParts.Ops = SalesReceivePrintData.Ops;
|
|
163
164
|
|
|
164
|
-
SRLaborParts.Items = SalesReceivePrintData.Items;
|
|
165
|
+
SRLaborParts.Items = SalesReceivePrintData.Items || SalesReceivePrintData.Lines;
|
|
165
166
|
|
|
166
167
|
SRLaborParts.Sts = InvoiceStatus;
|
|
167
168
|
SRLaborParts.Type = ROType;
|
|
@@ -189,32 +190,33 @@ export class SalesReceivePrintService {
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
static GetBillNameForSalesReceivePrint(OriginalSalesReceiveData: any, SalesReceivePrintData: any) {
|
|
193
|
+
const BillTo: any = OriginalSalesReceiveData.BillTo ?? OriginalSalesReceiveData.BFrom;
|
|
192
194
|
let Customer: any = {};
|
|
193
|
-
Customer.Name =
|
|
195
|
+
Customer.Name = BillTo.Name;
|
|
194
196
|
Customer.Adrs = [];
|
|
195
197
|
Customer.Cons = [];
|
|
196
|
-
if (!TrUtils.IsNull(
|
|
197
|
-
Customer.Adrs.push(
|
|
198
|
-
if (!TrUtils.IsEmpty(
|
|
199
|
-
Customer.Adrs.push(
|
|
198
|
+
if (!TrUtils.IsNull(BillTo.Adrs)) {
|
|
199
|
+
Customer.Adrs.push(BillTo.Adrs.A1);
|
|
200
|
+
if (!TrUtils.IsEmpty(BillTo.Adrs.A2)) {
|
|
201
|
+
Customer.Adrs.push(BillTo.Adrs.A2);
|
|
200
202
|
}
|
|
201
|
-
if (!TrUtils.IsEmpty(
|
|
202
|
-
Customer.Adrs.push(
|
|
203
|
+
if (!TrUtils.IsEmpty(BillTo.Adrs.Ct)) {
|
|
204
|
+
Customer.Adrs.push(BillTo.Adrs.Ct);
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
|
-
Customer.GSTIN =
|
|
207
|
+
Customer.GSTIN = BillTo.GSTIN;
|
|
206
208
|
|
|
207
|
-
if (!TrUtils.IsEmpty(
|
|
209
|
+
if (!TrUtils.IsEmpty(BillTo.Ph)) {
|
|
208
210
|
Customer.Cons = [
|
|
209
211
|
{
|
|
210
212
|
Type: 'M',
|
|
211
|
-
No:
|
|
213
|
+
No: BillTo.Ph
|
|
212
214
|
}
|
|
213
215
|
];
|
|
214
216
|
}
|
|
215
217
|
SalesReceivePrintData.Customer = Customer;
|
|
216
218
|
|
|
217
|
-
if (!TrUtils.IsNull(
|
|
219
|
+
if (!TrUtils.IsNull(BillTo.InsId)) {
|
|
218
220
|
SalesReceivePrintData.Cust = this.GetCustomerDetails(OriginalSalesReceiveData);
|
|
219
221
|
}
|
|
220
222
|
return SalesReceivePrintData;
|