@tomei/finance 0.6.60 → 0.6.62

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.6.60",
3
+ "version": "0.6.62",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1976,6 +1976,7 @@ export default class FinanceCompany extends ObjectBase {
1976
1976
  }
1977
1977
 
1978
1978
  payment.Remarks = remarks;
1979
+ let receiptDocNo = null;
1979
1980
  switch (status) {
1980
1981
  case PaymentStatus.REJECTED:
1981
1982
  payment.Status = PaymentStatus.REJECTED;
@@ -2109,6 +2110,7 @@ export default class FinanceCompany extends ObjectBase {
2109
2110
  }
2110
2111
  //Set the receipt doc no to the payment
2111
2112
  payment.ReceiptDocNo = receipt.DocNo;
2113
+ receiptDocNo = receipt.DocNo;
2112
2114
 
2113
2115
  /*Registering the Journal Entries for the transaction*/
2114
2116
  const transactionDate = new Date();
@@ -2159,21 +2161,6 @@ export default class FinanceCompany extends ObjectBase {
2159
2161
  creditLT.RelatedObjectType = type(payment);
2160
2162
  creditLT.RelatedPaymentId = payment.PaymentId;
2161
2163
 
2162
- await FinanceCompany._PaymentRepository.update(
2163
- {
2164
- ReceiptDocNo: receipt.DocNo,
2165
- Status: payment.Status,
2166
- UpdatedAt: new Date(),
2167
- UpdatedBy: loginUser.ObjectId,
2168
- },
2169
- {
2170
- where: {
2171
- PaymentId: payment.PaymentId,
2172
- },
2173
- transaction: dbTransaction,
2174
- }
2175
- );
2176
-
2177
2164
  await this.postJournal(dbTransaction, journalEntry, loginUser);
2178
2165
  }
2179
2166
  break;
@@ -2185,6 +2172,21 @@ export default class FinanceCompany extends ObjectBase {
2185
2172
  );
2186
2173
  }
2187
2174
 
2175
+ await FinanceCompany._PaymentRepository.update(
2176
+ {
2177
+ ReceiptDocNo: receiptDocNo,
2178
+ Status: payment.Status,
2179
+ UpdatedAt: new Date(),
2180
+ UpdatedBy: loginUser.ObjectId,
2181
+ },
2182
+ {
2183
+ where: {
2184
+ PaymentId: payment.PaymentId,
2185
+ },
2186
+ transaction: dbTransaction,
2187
+ }
2188
+ );
2189
+
2188
2190
  } catch (error) {
2189
2191
  throw error;
2190
2192
  }