gemcap-be-common 1.3.65 → 1.3.67
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/db/new-summary.js
CHANGED
|
@@ -80,7 +80,7 @@ const styles = {
|
|
|
80
80
|
},
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
|
-
const borrowerTitleLength =
|
|
83
|
+
const borrowerTitleLength = 15;
|
|
84
84
|
const dateFormat = 'MM-DD-YYYY';
|
|
85
85
|
const productsDataMap = new Map();
|
|
86
86
|
const borrowersMap = new Map();
|
|
@@ -762,30 +762,30 @@ class NewSummaryExcel {
|
|
|
762
762
|
const loanEconomicsData = await getLoanEconomics();
|
|
763
763
|
// FINANCIAL
|
|
764
764
|
const getFinancialDate = async (endDate) => {
|
|
765
|
-
const month = (0, dayjs_1.default)(endDate).month();
|
|
766
|
-
const year = (0, dayjs_1.default)(endDate).year();
|
|
765
|
+
const month = (0, dayjs_1.default)(endDate).utcOffset(0).month();
|
|
766
|
+
const year = (0, dayjs_1.default)(endDate).utcOffset(0).year();
|
|
767
767
|
const monthDeep = 11;
|
|
768
768
|
const currentMonth = (0, dayjs_1.default)(endDate).utcOffset(0).month() + 1;
|
|
769
769
|
const currentYear = (0, dayjs_1.default)(endDate).utcOffset(0).year();
|
|
770
770
|
const { data: ytdDataPL } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
771
771
|
borrowerId,
|
|
772
772
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.PROFIT_LOSS,
|
|
773
|
-
selectedMonth: { year: currentYear, month
|
|
773
|
+
selectedMonth: { year: currentYear, month },
|
|
774
774
|
}, currentMonth - 1); // jan to current
|
|
775
775
|
const { data: ytdDataBS } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
776
776
|
borrowerId,
|
|
777
777
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.BALANCE_SHEET,
|
|
778
|
-
selectedMonth: { year: currentYear, month
|
|
778
|
+
selectedMonth: { year: currentYear, month },
|
|
779
779
|
}, currentMonth - 1); // jan to current
|
|
780
780
|
const { data: lyYtdDataPL } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
781
781
|
borrowerId,
|
|
782
782
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.PROFIT_LOSS,
|
|
783
|
-
selectedMonth: { year: currentYear - 1, month
|
|
783
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
784
784
|
}, currentMonth - 1);
|
|
785
785
|
const { data: lyYtdDataBS } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
786
786
|
borrowerId,
|
|
787
787
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.BALANCE_SHEET,
|
|
788
|
-
selectedMonth: { year: currentYear - 1, month
|
|
788
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
789
789
|
}, currentMonth - 1);
|
|
790
790
|
const ytdData = [...ytdDataPL, ...ytdDataBS];
|
|
791
791
|
const lyYtdData = [...lyYtdDataPL, ...lyYtdDataBS];
|
|
@@ -802,12 +802,12 @@ class NewSummaryExcel {
|
|
|
802
802
|
const { data: sameMonthLastYearPL, sheets: sameMonthLastYearSheetsPL, } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
803
803
|
borrowerId,
|
|
804
804
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.PROFIT_LOSS,
|
|
805
|
-
selectedMonth: { year: currentYear - 1, month
|
|
805
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
806
806
|
}, 0);
|
|
807
807
|
const { data: sameMonthLastYearBS, sheets: sameMonthLastYearSheetsBS, } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
808
808
|
borrowerId,
|
|
809
809
|
financialSpreadingType: FinancialSpreadingSheet_model_1.EFinancialSpreadingType.BALANCE_SHEET,
|
|
810
|
-
selectedMonth: { year: currentYear - 1, month
|
|
810
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
811
811
|
}, 0);
|
|
812
812
|
const data = [
|
|
813
813
|
...dataPL,
|
package/db/new-summary.ts
CHANGED
|
@@ -144,7 +144,7 @@ const styles: { [styleName: string]: Partial<ExcelJS.Style> } = {
|
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
|
|
147
|
-
const borrowerTitleLength =
|
|
147
|
+
const borrowerTitleLength = 15;
|
|
148
148
|
const dateFormat = 'MM-DD-YYYY';
|
|
149
149
|
|
|
150
150
|
const productsDataMap = new Map<string, ReportRow>();
|
|
@@ -890,8 +890,8 @@ export class NewSummaryExcel {
|
|
|
890
890
|
|
|
891
891
|
// FINANCIAL
|
|
892
892
|
const getFinancialDate = async (endDate: Date): Promise<IExcelJsCell[][]> => {
|
|
893
|
-
const month = dayjs(endDate).month();
|
|
894
|
-
const year = dayjs(endDate).year();
|
|
893
|
+
const month = dayjs(endDate).utcOffset(0).month();
|
|
894
|
+
const year = dayjs(endDate).utcOffset(0).year();
|
|
895
895
|
const monthDeep = 11;
|
|
896
896
|
|
|
897
897
|
const currentMonth = dayjs(endDate).utcOffset(0).month() + 1;
|
|
@@ -900,25 +900,25 @@ export class NewSummaryExcel {
|
|
|
900
900
|
const { data: ytdDataPL } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
901
901
|
borrowerId,
|
|
902
902
|
financialSpreadingType: EFinancialSpreadingType.PROFIT_LOSS,
|
|
903
|
-
selectedMonth: { year: currentYear, month
|
|
903
|
+
selectedMonth: { year: currentYear, month },
|
|
904
904
|
}, currentMonth - 1); // jan to current
|
|
905
905
|
|
|
906
906
|
const { data: ytdDataBS } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
907
907
|
borrowerId,
|
|
908
908
|
financialSpreadingType: EFinancialSpreadingType.BALANCE_SHEET,
|
|
909
|
-
selectedMonth: { year: currentYear, month
|
|
909
|
+
selectedMonth: { year: currentYear, month },
|
|
910
910
|
}, currentMonth - 1); // jan to current
|
|
911
911
|
|
|
912
912
|
const { data: lyYtdDataPL } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
913
913
|
borrowerId,
|
|
914
914
|
financialSpreadingType: EFinancialSpreadingType.PROFIT_LOSS,
|
|
915
|
-
selectedMonth: { year: currentYear - 1, month
|
|
915
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
916
916
|
}, currentMonth - 1);
|
|
917
917
|
|
|
918
918
|
const { data: lyYtdDataBS } = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
919
919
|
borrowerId,
|
|
920
920
|
financialSpreadingType: EFinancialSpreadingType.BALANCE_SHEET,
|
|
921
|
-
selectedMonth: { year: currentYear - 1, month
|
|
921
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
922
922
|
}, currentMonth - 1);
|
|
923
923
|
|
|
924
924
|
const ytdData = [...ytdDataPL, ...ytdDataBS];
|
|
@@ -942,7 +942,7 @@ export class NewSummaryExcel {
|
|
|
942
942
|
} = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
943
943
|
borrowerId,
|
|
944
944
|
financialSpreadingType: EFinancialSpreadingType.PROFIT_LOSS,
|
|
945
|
-
selectedMonth: { year: currentYear - 1, month
|
|
945
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
946
946
|
}, 0);
|
|
947
947
|
|
|
948
948
|
const {
|
|
@@ -951,7 +951,7 @@ export class NewSummaryExcel {
|
|
|
951
951
|
} = await this.financialSpreadingService.getFinancialSpreadingData({
|
|
952
952
|
borrowerId,
|
|
953
953
|
financialSpreadingType: EFinancialSpreadingType.BALANCE_SHEET,
|
|
954
|
-
selectedMonth: { year: currentYear - 1, month
|
|
954
|
+
selectedMonth: { year: currentYear - 1, month },
|
|
955
955
|
}, 0);
|
|
956
956
|
|
|
957
957
|
const data = [
|
|
@@ -23,8 +23,8 @@ var EProspectSourceType;
|
|
|
23
23
|
exports.CRMProspectSourceValidationSchema = joi_1.default.object({
|
|
24
24
|
_id: joi_1.default.string(),
|
|
25
25
|
name: joi_1.default.string().required(),
|
|
26
|
-
contactPerson: joi_1.default.string().required().allow(null),
|
|
27
|
-
emails: joi_1.default.string().required().allow(null),
|
|
26
|
+
contactPerson: joi_1.default.string().required().default('').allow(null),
|
|
27
|
+
emails: joi_1.default.string().required().default('').allow(null),
|
|
28
28
|
order: joi_1.default.number().required().allow(null),
|
|
29
29
|
type: joi_1.default.string()
|
|
30
30
|
.valid(...Object.values(EProspectSourceType), null)
|
|
@@ -31,8 +31,8 @@ export interface ICRMProspectSourceWithId extends ICRMProspectSource {
|
|
|
31
31
|
export const CRMProspectSourceValidationSchema = Joi.object({
|
|
32
32
|
_id: Joi.string(),
|
|
33
33
|
name: Joi.string().required(),
|
|
34
|
-
contactPerson: Joi.string().required().allow(null),
|
|
35
|
-
emails: Joi.string().required().allow(null),
|
|
34
|
+
contactPerson: Joi.string().required().default('').allow(null),
|
|
35
|
+
emails: Joi.string().required().default('').allow(null),
|
|
36
36
|
order: Joi.number().required().allow(null),
|
|
37
37
|
type: Joi.string()
|
|
38
38
|
.valid(...Object.values(EProspectSourceType), null)
|