shareneus 1.5.22 → 1.5.24
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.
|
@@ -479,7 +479,7 @@ export declare class ReceiptPDFService {
|
|
|
479
479
|
}[];
|
|
480
480
|
})[];
|
|
481
481
|
};
|
|
482
|
-
static GetTowards(Ids: any, IsRepairOrder: boolean, Sts: any, RemAmt: any): {
|
|
482
|
+
static GetTowards(Ids: any, IsRepairOrder: boolean, Sts: any, RemAmt: any, RefundAmt: any): {
|
|
483
483
|
columns: {
|
|
484
484
|
stack: ({
|
|
485
485
|
text: ({
|
|
@@ -25,7 +25,7 @@ class ReceiptPDFService {
|
|
|
25
25
|
this.GetPayment(ReceiptData.PaymentId, isHC),
|
|
26
26
|
this.GetName(ReceiptData.FullName),
|
|
27
27
|
this.GetRupee(ReceiptData.TotalAmount),
|
|
28
|
-
this.GetTowards(ReceiptData.Ids, ReceiptData.RepairOrder, ReceiptData.Sts, ReceiptData.RemAmt),
|
|
28
|
+
this.GetTowards(ReceiptData.Ids, ReceiptData.RepairOrder, ReceiptData.Sts, ReceiptData.RemAmt, ReceiptData.RefundAmount),
|
|
29
29
|
this.GetAmount(ReceiptData.PaymentType, ReceiptData.TypeNumber, ReceiptData.PaidDate),
|
|
30
30
|
// this.GetDrawDate(ReceiptData.PaymentType,ReceiptData.PaidDate),
|
|
31
31
|
this.GetCompanyName(ReceiptData.Entity.CName),
|
|
@@ -180,12 +180,12 @@ class ReceiptPDFService {
|
|
|
180
180
|
]
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
static GetTowards(Ids, IsRepairOrder, Sts, RemAmt) {
|
|
183
|
+
static GetTowards(Ids, IsRepairOrder, Sts, RemAmt, RefundAmt) {
|
|
184
184
|
let data = '';
|
|
185
185
|
let toward = '';
|
|
186
186
|
for (let i = 0; i < Ids.length; i++) {
|
|
187
187
|
if (i + 1 < Ids.length) {
|
|
188
|
-
data = data + Ids[i] + ',';
|
|
188
|
+
data = data + Ids[i] + ', ';
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
191
|
data = data + Ids[i];
|
|
@@ -197,6 +197,9 @@ class ReceiptPDFService {
|
|
|
197
197
|
}
|
|
198
198
|
else {
|
|
199
199
|
toward = 'INVOICE - ' + data;
|
|
200
|
+
if (RefundAmt > 0) {
|
|
201
|
+
toward += ' (refunded Rs.' + RefundAmt + ' )';
|
|
202
|
+
}
|
|
200
203
|
if (RemAmt > 0) {
|
|
201
204
|
toward += ' (remaining Rs.' + RemAmt + ' as advance)';
|
|
202
205
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReceiptPrintService = void 0;
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
4
5
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
5
6
|
const my_date_1 = require("../../utils/my-date");
|
|
6
7
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
8
|
class ReceiptPrintService {
|
|
8
9
|
static GetReceiptPrint(argPaymentViewData, EntityData, image) {
|
|
10
|
+
var _a;
|
|
9
11
|
let PaymentViewData = tr_utils_1.TrUtils.Stringify(argPaymentViewData);
|
|
10
12
|
let ReceiptData = {};
|
|
11
13
|
ReceiptData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, "Receipt", argPaymentViewData);
|
|
@@ -25,6 +27,14 @@ class ReceiptPrintService {
|
|
|
25
27
|
}
|
|
26
28
|
ReceiptData.TotalAmount = PaymentViewData.Amt;
|
|
27
29
|
ReceiptData.RemAmt = PaymentViewData.RemAmt;
|
|
30
|
+
let Refunds = (_a = PaymentViewData === null || PaymentViewData === void 0 ? void 0 : PaymentViewData.AllocRefs) === null || _a === void 0 ? void 0 : _a.filter((ref) => ref.Type === 'CR');
|
|
31
|
+
if (!tr_utils_1.TrUtils.IsNull(Refunds) && Refunds.length > 0) {
|
|
32
|
+
let Amount = 0;
|
|
33
|
+
for (let i = 0; i < Refunds.length; i++) {
|
|
34
|
+
Amount = (0, math_operations_1.Add)(Amount, Refunds[i].Amt);
|
|
35
|
+
}
|
|
36
|
+
ReceiptData.RefundAmount = Amount;
|
|
37
|
+
}
|
|
28
38
|
ReceiptData.PaidDate = my_date_1.MyDate.ConvertUTCDateToReadable(PaymentViewData.Date);
|
|
29
39
|
ReceiptData.Ids = this.GetRecordIds(PaymentViewData);
|
|
30
40
|
ReceiptData.Type = 'Receipt';
|
|
@@ -34,13 +44,24 @@ class ReceiptPrintService {
|
|
|
34
44
|
return ReceiptData;
|
|
35
45
|
}
|
|
36
46
|
static GetRecordIds(PaymentViewData) {
|
|
47
|
+
var _a;
|
|
37
48
|
let IdList = [];
|
|
38
49
|
var i = 0;
|
|
39
50
|
if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.AllocRefs) && PaymentViewData.AllocRefs.length !== 0) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
let Invoices = (_a = PaymentViewData === null || PaymentViewData === void 0 ? void 0 : PaymentViewData.AllocRefs) === null || _a === void 0 ? void 0 : _a.filter((ref) => ref.Type === 'INV');
|
|
52
|
+
for (i = 0; i < Invoices.length; i++) {
|
|
53
|
+
let Id = Invoices[i].Code;
|
|
54
|
+
if (!tr_utils_1.TrUtils.IsNull(Invoices[i].RegNo)) {
|
|
55
|
+
Id = Id + '(' + Invoices[i].RegNo + ')';
|
|
56
|
+
}
|
|
57
|
+
IdList.push(Id);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.Invs) && PaymentViewData.Invs.length !== 0) {
|
|
61
|
+
for (i = 0; i < PaymentViewData.Invs.length; i++) {
|
|
62
|
+
let Id = PaymentViewData.Invs[i].Code;
|
|
63
|
+
if (!tr_utils_1.TrUtils.IsNull(PaymentViewData.Invs[i].RegNo)) {
|
|
64
|
+
Id = Id + '(' + PaymentViewData.Invs[i].RegNo + ')';
|
|
44
65
|
}
|
|
45
66
|
IdList.push(Id);
|
|
46
67
|
}
|