gemcap-be-common 1.5.7 → 1.5.8
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
|
@@ -289,19 +289,21 @@ class LoanStatementService {
|
|
|
289
289
|
};
|
|
290
290
|
fee = checkMinAmount(fee);
|
|
291
291
|
if (fee !== null && fee > 0) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
292
|
+
if ((0, dayjs_1.default)(statementDate).isSame((0, dayjs_1.default)(charge.applyFrom)) || (0, dayjs_1.default)(statementDate).isAfter((0, dayjs_1.default)(charge.applyFrom))) {
|
|
293
|
+
const newStatement = {
|
|
294
|
+
order: orderIndex,
|
|
295
|
+
date: statementDate,
|
|
296
|
+
chargeId: charge._id,
|
|
297
|
+
amount: fee,
|
|
298
|
+
amountPaid: 0,
|
|
299
|
+
isSystem: true,
|
|
300
|
+
memo: 'System Generated',
|
|
301
|
+
balance: 0,
|
|
302
|
+
};
|
|
303
|
+
const newStatementDoc = await LoanStatementTransaction_model_1.LoanStatementTransactionModel.create(newStatement);
|
|
304
|
+
await newStatementDoc.save();
|
|
305
|
+
orderIndex = orderIndex + 1;
|
|
306
|
+
}
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
}
|
|
@@ -333,19 +333,21 @@ export class LoanStatementService {
|
|
|
333
333
|
fee = checkMinAmount(fee);
|
|
334
334
|
|
|
335
335
|
if (fee !== null && fee > 0) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
336
|
+
if (dayjs(statementDate).isSame(dayjs(charge.applyFrom)) || dayjs(statementDate).isAfter(dayjs(charge.applyFrom))) {
|
|
337
|
+
const newStatement: ILoanStatementTransaction = {
|
|
338
|
+
order: orderIndex,
|
|
339
|
+
date: statementDate,
|
|
340
|
+
chargeId: charge._id,
|
|
341
|
+
amount: fee,
|
|
342
|
+
amountPaid: 0,
|
|
343
|
+
isSystem: true,
|
|
344
|
+
memo: 'System Generated',
|
|
345
|
+
balance: 0,
|
|
346
|
+
};
|
|
347
|
+
const newStatementDoc = await LoanStatementTransactionModel.create(newStatement);
|
|
348
|
+
await newStatementDoc.save();
|
|
349
|
+
orderIndex = orderIndex + 1;
|
|
350
|
+
}
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
353
|
}
|