gemcap-be-common 1.5.5 → 1.5.7

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": "gemcap-be-common",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -236,11 +236,14 @@ class PdfService {
236
236
  }],
237
237
  [{ text: 'Commitment amount' }, { text: (0, numbers_helper_1.formatNumbers)(product.commitment), alignment: 'right' }],
238
238
  ];
239
+ const endDate = product.deactivationDate
240
+ ? (0, dayjs_1.default)(product.deactivationDate).isBefore((0, dayjs_1.default)(end.slice(0, 10))) ? (0, dayjs_1.default)(product.deactivationDate) : (0, dayjs_1.default)(end.slice(0, 10))
241
+ : (0, dayjs_1.default)(end.slice(0, 10));
239
242
  const preparedStatementHeader = [
240
243
  { text: `STATEMENT FOR PRODUCT: ${product.name}`, bold: true },
241
244
  { text: `Client: ${borrower.code}`, bold: true },
242
245
  {
243
- text: `PERIOD FROM ${(0, dayjs_1.default)(start.slice(0, 10)).format(defaultDateFormat)} PERIOD TO ${(0, dayjs_1.default)(end.slice(0, 10)).format(defaultDateFormat)}`,
246
+ text: `PERIOD FROM ${dayjs_1.default.utc(start).format(defaultDateFormat)} TO ${endDate.format(defaultDateFormat)}`,
244
247
  bold: true,
245
248
  },
246
249
  {
@@ -272,11 +272,15 @@ export class PdfService {
272
272
  [{ text: 'Commitment amount' }, { text: formatNumbers(product.commitment), alignment: 'right' }],
273
273
  ];
274
274
 
275
+ const endDate = product.deactivationDate
276
+ ? dayjs(product.deactivationDate).isBefore(dayjs(end.slice(0, 10))) ? dayjs(product.deactivationDate) : dayjs(end.slice(0, 10))
277
+ : dayjs(end.slice(0, 10));
278
+
275
279
  const preparedStatementHeader = [
276
280
  { text: `STATEMENT FOR PRODUCT: ${product.name}`, bold: true },
277
281
  { text: `Client: ${borrower.code}`, bold: true },
278
282
  {
279
- text: `PERIOD FROM ${dayjs(start.slice(0, 10)).format(defaultDateFormat)} PERIOD TO ${dayjs(end.slice(0, 10)).format(defaultDateFormat)}`,
283
+ text: `PERIOD FROM ${dayjs.utc(start).format(defaultDateFormat)} TO ${endDate.format(defaultDateFormat)}`,
280
284
  bold: true,
281
285
  },
282
286
  {