@react-pakistan/util-functions 1.23.53 → 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.
@@ -105,11 +105,12 @@ var postPayment = function (_a) { return __awaiter(void 0, [_a], void 0, functio
105
105
  switch (_c.label) {
106
106
  case 0: return [4 /*yield*/, prisma.quoteInvoice.findUnique({
107
107
  where: {
108
- quoteInvoiceId: quoteInvoiceId,
108
+ id: quoteInvoiceId,
109
109
  },
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.53",
3
+ "version": "1.23.55",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {