gemcap-be-common 1.5.5 → 1.5.6

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