@react-pakistan/util-functions 1.23.54 → 1.23.55
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.
|
@@ -110,6 +110,7 @@ var postPayment = function (_a) { return __awaiter(void 0, [_a], void 0, functio
|
|
|
110
110
|
})];
|
|
111
111
|
case 1:
|
|
112
112
|
invoice = _c.sent();
|
|
113
|
+
console.log('_>', invoice);
|
|
113
114
|
return [4 /*yield*/, prisma.payment.findMany({
|
|
114
115
|
where: {
|
|
115
116
|
quoteInvoiceId: quoteInvoiceId,
|
|
@@ -120,11 +121,13 @@ var postPayment = function (_a) { return __awaiter(void 0, [_a], void 0, functio
|
|
|
120
121
|
})];
|
|
121
122
|
case 2:
|
|
122
123
|
allPaymentsForInvoice = _c.sent();
|
|
124
|
+
console.log('_>>', allPaymentsForInvoice);
|
|
123
125
|
balance = (allPaymentsForInvoice && allPaymentsForInvoice
|
|
124
126
|
.reduce(function (acc, _a) {
|
|
125
127
|
var paymentAmount = _a.amount;
|
|
126
128
|
return acc + paymentAmount;
|
|
127
129
|
}, 0) - invoice.total) || 0;
|
|
130
|
+
console.log('_>>>', balance);
|
|
128
131
|
return [4 /*yield*/, prisma.payment.upsert({
|
|
129
132
|
where: {
|
|
130
133
|
id: id,
|
|
@@ -142,7 +145,7 @@ var postPayment = function (_a) { return __awaiter(void 0, [_a], void 0, functio
|
|
|
142
145
|
create: {
|
|
143
146
|
amount: amount,
|
|
144
147
|
attachment: attachment,
|
|
145
|
-
balance: balance,
|
|
148
|
+
balance: String(balance),
|
|
146
149
|
// createdAt,
|
|
147
150
|
currency: currency,
|
|
148
151
|
date: date,
|