gemcap-be-common 1.5.76 → 1.5.77

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.
@@ -25,7 +25,7 @@ class SalesItem {
25
25
  if (options && options.salesPeriodEnd) {
26
26
  item.salesPeriodEnd = dayjs_1.default.utc(options.salesPeriodEnd).toDate();
27
27
  }
28
- const salesPeriod = dayjs_1.default.utc(item.salesPeriodStart).diff(dayjs_1.default.utc(options.salesPeriodEnd), 'day');
28
+ const salesPeriod = dayjs_1.default.utc(item.salesPeriodEnd).diff(dayjs_1.default.utc(item.salesPeriodStart), 'day');
29
29
  this.salesPerDay = salesPeriod > 0 ? item.unitsSold / salesPeriod : 0;
30
30
  const itemWithDates = (0, column_desciptions_helper_1.convertIntoDates)(item, collaterals_enum_1.ECollaterals.SALES);
31
31
  const itemWithoutNulls = lodash_1.default.omitBy(itemWithDates, (value) => value === null);
@@ -35,7 +35,7 @@ export class SalesItem implements ISalesLocal {
35
35
  if (options && options.salesPeriodEnd) {
36
36
  item.salesPeriodEnd = dayjs.utc(options.salesPeriodEnd).toDate();
37
37
  }
38
- const salesPeriod = dayjs.utc(item.salesPeriodStart).diff(dayjs.utc(options.salesPeriodEnd), 'day');
38
+ const salesPeriod = dayjs.utc(item.salesPeriodEnd).diff(dayjs.utc(item.salesPeriodStart), 'day');
39
39
  this.salesPerDay = salesPeriod > 0 ? item.unitsSold / salesPeriod : 0;
40
40
  const itemWithDates = convertIntoDates(item, ECollaterals.SALES);
41
41
  const itemWithoutNulls = _.omitBy(itemWithDates, (value) => value === null);
@@ -255,20 +255,6 @@ exports.COLLATERALS = {
255
255
  items: [],
256
256
  validators: [validators_enums_1.EValidators.IS_NUMBER],
257
257
  },
258
- {
259
- db_title: 'salesPeriodStart',
260
- title: 'Sales period start',
261
- required: true,
262
- items: [],
263
- validators: [validators_enums_1.EValidators.IS_DATE],
264
- },
265
- {
266
- db_title: 'salesPeriodEnd',
267
- title: 'Sales period end',
268
- required: true,
269
- items: [],
270
- validators: [validators_enums_1.EValidators.IS_DATE],
271
- },
272
258
  ],
273
259
  [collaterals_enum_1.ECollaterals.LOAN_TRANSACTIONS]: [
274
260
  {
@@ -255,20 +255,6 @@ COLLATERALS = {
255
255
  items: [],
256
256
  validators: [EValidators.IS_NUMBER],
257
257
  },
258
- {
259
- db_title: 'salesPeriodStart',
260
- title: 'Sales period start',
261
- required: true,
262
- items: [],
263
- validators: [EValidators.IS_DATE],
264
- },
265
- {
266
- db_title: 'salesPeriodEnd',
267
- title: 'Sales period end',
268
- required: true,
269
- items: [],
270
- validators: [EValidators.IS_DATE],
271
- },
272
258
  ],
273
259
  [ECollaterals.LOAN_TRANSACTIONS]: [
274
260
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemcap-be-common",
3
- "version": "1.5.76",
3
+ "version": "1.5.77",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {