law-common 11.2.0 → 11.2.1
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/README.md +1 -1
- package/dist/src/api/index.d.ts +2 -0
- package/dist/src/api/index.js +2 -0
- package/dist/src/api/interface/state.update.dto.interface.d.ts +6 -3
- package/dist/src/api/interface/state.update.dto.interface.js +6 -2
- package/dist/src/api/interface/vendor-invoice.entity.response.d.ts +3 -3
- package/dist/src/api/interface/vendor-invoice.entity.response.js +2 -2
- package/dist/src/api/interface/vendor_invoice.create.dto.interface.d.ts +1 -1
- package/dist/src/api/interface/vendor_invoice.update.dto.interface.d.ts +3 -2
- package/dist/src/api/interface/vendor_invoice_payment.create.dto.interface.d.ts +5 -0
- package/dist/src/api/interface/vendor_invoice_payment.create.dto.interface.js +2 -0
- package/dist/src/api/interface/vendor_invoice_payment.update.dto.interface.d.ts +18 -0
- package/dist/src/api/interface/vendor_invoice_payment.update.dto.interface.js +13 -0
- package/dist/src/entities/enums/state_status_enum.d.ts +10 -3
- package/dist/src/entities/enums/state_status_enum.js +13 -3
- package/dist/src/entities/enums/vendor_invoice_action.enum.d.ts +3 -1
- package/dist/src/entities/enums/vendor_invoice_action.enum.js +2 -0
- package/dist/src/entities/enums/vendor_invoice_action_status_enum.autocode.js +1 -1
- package/dist/src/entities/enums/vendor_invoice_action_status_enum.d.ts +1 -1
- package/dist/src/entities/enums/vendor_invoice_action_status_enum.js +13 -13
- package/dist/src/entities/enums/vendor_invoice_payment_mode_enum.d.ts +7 -0
- package/dist/src/entities/enums/vendor_invoice_payment_mode_enum.js +11 -0
- package/dist/src/entities/enums/vendor_invoice_payment_status_enum.d.ts +10 -0
- package/dist/src/entities/enums/vendor_invoice_payment_status_enum.js +14 -0
- package/dist/src/entities/enums/vendor_invoice_status_enum.autocode.js +1 -1
- package/dist/src/entities/enums/vendor_invoice_status_enum.d.ts +1 -1
- package/dist/src/entities/enums/vendor_invoice_status_enum.js +6 -6
- package/dist/src/entities/flow-configs/state_flow.config.js +263 -58
- package/dist/src/entities/flow-configs/vendor-invoice-flow.config.d.ts +11 -2
- package/dist/src/entities/flow-configs/vendor-invoice-flow.config.js +138 -197
- package/dist/src/entities/flow-configs/vendor_invoice_payment_flow.config.d.ts +6 -0
- package/dist/src/entities/flow-configs/vendor_invoice_payment_flow.config.js +205 -0
- package/dist/src/entities/index.d.ts +5 -0
- package/dist/src/entities/index.js +5 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +5 -2
- package/dist/src/entities/interface/entity.utils.interface.js +1 -0
- package/dist/src/entities/interface/vendor_invoice.entity.interface.autocode.js +4 -4
- package/dist/src/entities/interface/vendor_invoice.entity.interface.d.ts +5 -3
- package/dist/src/entities/interface/vendor_invoice_payment.entity.interface.d.ts +14 -0
- package/dist/src/entities/interface/vendor_invoice_payment.entity.interface.js +2 -0
- package/dist/src/entities/model/bank.entity.model.d.ts +0 -1
- package/dist/src/entities/model/bank.entity.model.js +0 -7
- package/dist/src/entities/model/billing.entity.model.js +7 -7
- package/dist/src/entities/model/entity.model.interface.js +2 -0
- package/dist/src/entities/model/project.entity.model.d.ts +1 -1
- package/dist/src/entities/model/project.entity.model.js +1 -1
- package/dist/src/entities/model/state.entity.model.js +1 -1
- package/dist/src/entities/model/vendor_invoice.entity.model.autocode.js +4 -4
- package/dist/src/entities/model/vendor_invoice.entity.model.d.ts +8 -5
- package/dist/src/entities/model/vendor_invoice.entity.model.js +99 -51
- package/dist/src/entities/model/vendor_invoice_item.entity.model.js +1 -1
- package/dist/src/entities/model/vendor_invoice_payment.entity.model.d.ts +62 -0
- package/dist/src/entities/model/vendor_invoice_payment.entity.model.js +209 -0
- package/dist/src/enums/error.key.enum.d.ts +2 -1
- package/dist/src/enums/error.key.enum.js +1 -0
- package/package.json +47 -42
|
@@ -68,6 +68,7 @@ import { VendorInvoiceEntityModel } from "../model/vendor_invoice.entity.model";
|
|
|
68
68
|
import { VendorInvoiceHistoryEntityModel } from "../model/vendor_invoice_history.entity.model";
|
|
69
69
|
import { VendorInvoiceItemEntityModel } from "../model/vendor_invoice_item.entity.model";
|
|
70
70
|
import { VendorInvoiceItemHistoryEntityModel } from "../model/vendor_invoice_item_history.entity.model";
|
|
71
|
+
import { VendorInvoicePaymentEntityModel } from "../model/vendor_invoice_payment.entity.model";
|
|
71
72
|
import { VoucherTypeEntityModel } from "../model/voucher_type.entity.model";
|
|
72
73
|
import { WebsiteLeadEntityModel } from "../model/website_lead.entity.model";
|
|
73
74
|
import { WebsiteNewsletterSubscriptionEntityModel } from "../model/website_newsletter_subscription.entity.model";
|
|
@@ -134,6 +135,7 @@ import { IVendorInvoiceItemHistoryEntity } from "./vendor-invoice-item-history.e
|
|
|
134
135
|
import { IVendorEntity } from "./vendor.entity.interface";
|
|
135
136
|
import { IVendorInvoiceEntity } from "./vendor_invoice.entity.interface";
|
|
136
137
|
import { IVendorInvoiceItemEntity } from "./vendor_invoice_item.entity.interface";
|
|
138
|
+
import { IVendorInvoicePaymentEntity } from "./vendor_invoice_payment.entity.interface";
|
|
137
139
|
import { IVendorInvoiceHistoryEntity } from "./vendot-invoice-history.entity.interface";
|
|
138
140
|
import { IVoucherTypeEntity } from "./voucher_type.entity.interface";
|
|
139
141
|
import { IWebsiteLeadEntity } from "./website_lead.entity.interface";
|
|
@@ -246,6 +248,7 @@ export declare enum EntityEnum {
|
|
|
246
248
|
CLIENT_QUOTE = "client_quote",
|
|
247
249
|
CLIENT_QUOTE_RATE = "client_quote_rate",
|
|
248
250
|
ENTITY_HISTORY = "entity_history",
|
|
251
|
+
VENDOR_INVOICE_PAYMENT = "vendor_invoice_payment",
|
|
249
252
|
LEAVE_APPROVAL = "leave_approval"
|
|
250
253
|
}
|
|
251
254
|
export type EntityRelations = {
|
|
@@ -271,7 +274,7 @@ export type IBaseEntityApiResponse<T> = {
|
|
|
271
274
|
[key in EntityEnum | VirtualEntityEnum]?: AggregationFields<EnumToModel<key>>[];
|
|
272
275
|
};
|
|
273
276
|
};
|
|
274
|
-
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.MOVING_TIMESHEET ? IMovingTimesheetEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.ENTITY_HISTORY ? IEntityHistoryEntity : T extends EntityEnum.LEAVE_APPROVAL ? ILeaveApprovalEntity : never) & {
|
|
277
|
+
export type EnumEntityType<T extends EntityEnum | VirtualEntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_HISTORY ? IBillingHistoryEntity : T extends EntityEnum.MOVING_TIMESHEET ? IMovingTimesheetEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? IBillingReimbursementExpenseEntity : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? IBillingTimesheetHistoryEntity : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? IBillingReimbursementExpenseHistoryEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? IBillingTransactionHistoryEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.HOLIDAY ? IHolidayEntity : T extends EntityEnum.HOLIDAY_LIST ? IHolidayListEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.REIMBURSEMENT_HISTORY ? IReimbursementHistoryEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? IClientIntroducingMappingEntity : T extends EntityEnum.TO_DO_LIST ? IToDoListEntity : T extends EntityEnum.CRON_JOBS ? ICronJobsEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends VirtualEntityEnum.LEAVE_COUNT ? ILeaveCountVirtualEntity : T extends EntityEnum.LEAVE_HISTORY ? ILeaveHistoryEntity : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? IWorkFromHomeHistoryEntity : T extends EntityEnum.TIMESHEET_HISTORY ? ITimesheetHistoryEntity : T extends EntityEnum.ADDRESS_BOOK ? IAddressBookEntity : T extends EntityEnum.STATE ? IStateEntity : T extends EntityEnum.GST_RATE ? IGstRateEntity : T extends EntityEnum.ORGANIZATION_TYPE ? IOrganizationTypeEntity : T extends EntityEnum.TDS_RATE ? ITdsRateEntity : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? IOrganizationTypeTdsRateMappingEntity : T extends EntityEnum.VOUCHER_TYPE ? IVoucherTypeEntity : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? ITdsRateVoucherTypeMappingEntity : T extends EntityEnum.EXPENSE_HEAD ? IExpenseHeadEntity : T extends EntityEnum.DOCUMENT_UPLOAD ? IDocumentUploadEntity : T extends EntityEnum.VENDOR ? IVendorEntity : T extends EntityEnum.VENDOR_INVOICE ? IVendorInvoiceEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? IVendorInvoiceHistoryEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM ? IVendorInvoiceItemEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.BILLING_PROFILE ? IBillingProfileEntity : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? IProjectRevenueSplitMappingEntity : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? IVendorInvoiceItemHistoryEntity : T extends EntityEnum.VENDOR_HISTORY ? IVendorHistoryEntity : T extends EntityEnum.WEBSITE_LEAD ? IWebsiteLeadEntity : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? IWebsiteNewsletterSubscriptionEntity : T extends EntityEnum.CLIENT_QUOTE ? IClientQuoteEntity : T extends EntityEnum.CLIENT_QUOTE_RATE ? IClientQuoteRateEntity : T extends EntityEnum.ENTITY_HISTORY ? IEntityHistoryEntity : T extends EntityEnum.LEAVE_APPROVAL ? ILeaveApprovalEntity : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? IVendorInvoicePaymentEntity : never) & {
|
|
275
278
|
id: number;
|
|
276
279
|
};
|
|
277
280
|
export type EntityRelationConfig<T extends EntityEnum | VirtualEntityEnum> = {
|
|
@@ -403,7 +406,7 @@ export declare enum VirtualEntityEnum {
|
|
|
403
406
|
}
|
|
404
407
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
405
408
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
406
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.MOVING_TIMESHEET ? MovingTimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ENTITY_HISTORY ? EntityHistoryEntityModel : T extends EntityEnum.LEAVE_APPROVAL ? LeaveApprovalEntityModel : UserEntityModel;
|
|
409
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.BILLING_HISTORY ? BillingHistoryEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.INTERMEDIARY_BANK ? IntermediaryBankEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.BILLING_REIMBURESMENT_EXPENSE_HISTORY ? BillingReimbursementExpenseHistoryEntityModel : T extends EntityEnum.LEAVE ? LeaveEntityModel : T extends EntityEnum.WORK_FROM_HOME ? WorkFromHomeEntityModel : T extends EntityEnum.HOLIDAY ? HolidayEntityModel : T extends VirtualEntityEnum.LEAVE_COUNT ? LeaveCountVirtualEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.BILLING_TIMESHEET_HISTORY ? BillingTimesheetHistoryEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : T extends EntityEnum.MOVING_TIMESHEET ? MovingTimesheetEntityModel : T extends EntityEnum.TIMESHEET_HISTORY ? TimesheetHistoryEntityModel : T extends EntityEnum.COUNTRY ? CountryEntityModel : T extends EntityEnum.BILLING_TRANSACTION ? BillingTransactionEntityModel : T extends EntityEnum.BILLING_TRANSACTION_HISTORY ? BillingTransactionHistoryEntityModel : T extends EntityEnum.ADDRESS_BOOK ? AddressBookEntityModel : T extends EntityEnum.STATE ? StateEntityModel : T extends EntityEnum.GST_RATE ? GstRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE ? OrganizationTypeEntityModel : T extends EntityEnum.TDS_RATE ? TdsRateEntityModel : T extends EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING ? OrganizationTypeTdsRateMappingEntityModel : T extends EntityEnum.VOUCHER_TYPE ? VoucherTypeEntityModel : T extends EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING ? TdsRateVoucherTypeMappingEntityModel : T extends EntityEnum.ORGANIZATION ? OrganizationEntityModel : T extends EntityEnum.INDUSTRY ? IndustryEntityModel : T extends EntityEnum.EXPENSE_TYPE ? ExpenseTypeEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ROLE ? RoleEntityModel : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? RolePermissionMappingEntityModel : T extends EntityEnum.PERMISSION ? PermissionEntityModel : T extends EntityEnum.EXPENSE_HEAD ? ExpenseHeadEntityModel : T extends EntityEnum.DOCUMENT_UPLOAD ? DocumentUploadEntityModel : T extends EntityEnum.VENDOR ? VendorEntityModel : T extends EntityEnum.VENDOR_INVOICE ? VendorInvoiceEntityModel : T extends EntityEnum.VENDOR_INVOICE_HISTORY ? VendorInvoiceHistoryEntityModel : T extends EntityEnum.OFFICE_LOCATION ? OfficeLocationEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM ? VendorInvoiceItemEntityModel : T extends EntityEnum.VENDOR_INVOICE_ITEM_HISTORY ? VendorInvoiceItemHistoryEntityModel : T extends EntityEnum.VENDOR_HISTORY ? VendorHistoryEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.WORK_FROM_HOME_HISTORY ? WorkFromHomeHistoryEntityModel : T extends EntityEnum.LEAVE_HISTORY ? LeaveHistoryEntityModel : T extends EntityEnum.BANK_HISTORY ? BankHistoryEntityModel : T extends EntityEnum.REIMBURSEMENT_HISTORY ? ReimbursementHistoryEntityModel : T extends EntityEnum.CLIENT_USER_MAPPING ? ClientUserMappingEntityModel : T extends EntityEnum.CLIENT_INTRODUCING_MAPPING ? ClientIntroducingMappingEntityModel : T extends EntityEnum.HOLIDAY_LIST ? HolidayListEntityModel : T extends EntityEnum.CRON_JOBS ? CronJobsEntityModel : T extends EntityEnum.TO_DO_LIST ? ToDoListEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.BILLING_PROFILE ? BillingProfileEntityModel : T extends EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING ? ProjectRevenueSplitMappingEntityModel : T extends EntityEnum.WEBSITE_LEAD ? WebsiteLeadEntityModel : T extends EntityEnum.WEBSITE_NEWSLETTER_SUBSCRIPTION ? WebsiteNewsletterSubscriptionEntityModel : T extends EntityEnum.CLIENT_QUOTE ? ClientQuoteEntityModel : T extends EntityEnum.CLIENT_QUOTE_RATE ? ClientQuoteRateEntityModel : T extends EntityEnum.DESIGNATION ? DesignationEntityModel : T extends EntityEnum.RATE ? RateEntityModel : T extends EntityEnum.ENTITY_HISTORY ? EntityHistoryEntityModel : T extends EntityEnum.LEAVE_APPROVAL ? LeaveApprovalEntityModel : T extends EntityEnum.VENDOR_INVOICE_PAYMENT ? VendorInvoicePaymentEntityModel : UserEntityModel;
|
|
407
410
|
export type EntityMap = {
|
|
408
411
|
[key in EntityEnum | VirtualEntityEnum]: EnumToModel<key>[];
|
|
409
412
|
} & {
|
|
@@ -100,6 +100,7 @@ var EntityEnum;
|
|
|
100
100
|
EntityEnum["CLIENT_QUOTE"] = "client_quote";
|
|
101
101
|
EntityEnum["CLIENT_QUOTE_RATE"] = "client_quote_rate";
|
|
102
102
|
EntityEnum["ENTITY_HISTORY"] = "entity_history";
|
|
103
|
+
EntityEnum["VENDOR_INVOICE_PAYMENT"] = "vendor_invoice_payment";
|
|
103
104
|
EntityEnum["LEAVE_APPROVAL"] = "leave_approval";
|
|
104
105
|
})(EntityEnum || (exports.EntityEnum = EntityEnum = {}));
|
|
105
106
|
var VirtualEntityEnum;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
3
|
// import { Nullable } from "./entity.utils.interface";
|
|
4
|
-
// import {
|
|
5
|
-
// import {
|
|
4
|
+
// import { VendorInvoicePaidStatusEnum } from "../enums/vendor_invoice_status_enum";
|
|
5
|
+
// import { VendorInvoiceStatusEnum } from "../enums/vendor_invoice_action_status_enum";
|
|
6
6
|
// export interface IVendorInvoiceEntity extends IEntityAuditColumn {
|
|
7
7
|
// id: number;
|
|
8
8
|
// vendorId: number;
|
|
9
|
-
// status:
|
|
10
|
-
// actionStatus:
|
|
9
|
+
// status: VendorInvoicePaidStatusEnum;
|
|
10
|
+
// actionStatus: VendorInvoiceStatusEnum;
|
|
11
11
|
// serviceLocationId: string;
|
|
12
12
|
// invoiceNo: string;
|
|
13
13
|
// invoiceDate: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { VendorInvoiceStatusEnum } from "../enums/vendor_invoice_action_status_enum";
|
|
2
|
+
import { VendorInvoicePaidStatusEnum } from "../enums/vendor_invoice_status_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
4
|
import { Nullable } from "./entity.utils.interface";
|
|
5
5
|
export interface IVendorInvoiceEntity extends IEntityAuditColumn {
|
|
6
6
|
id: number;
|
|
7
7
|
vendorId: number;
|
|
8
|
+
paidStatus: VendorInvoicePaidStatusEnum;
|
|
8
9
|
status: VendorInvoiceStatusEnum;
|
|
9
|
-
actionStatus: VendorInvoiceActionStatusEnum;
|
|
10
10
|
serviceLocationId: number;
|
|
11
11
|
invoiceNo: string;
|
|
12
12
|
invoiceDate: number;
|
|
@@ -20,4 +20,6 @@ export interface IVendorInvoiceEntity extends IEntityAuditColumn {
|
|
|
20
20
|
totalGstAmount: number;
|
|
21
21
|
totalTdsAmount: number;
|
|
22
22
|
totalNetAmount: number;
|
|
23
|
+
paidAmount: number;
|
|
24
|
+
adjustedAmount: number;
|
|
23
25
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
|
+
import { VendorInvoicePaymentModeEnum } from "../enums/vendor_invoice_payment_mode_enum";
|
|
4
|
+
import { VendorInvoicePaymentStatusEnum } from "../enums/vendor_invoice_payment_status_enum";
|
|
5
|
+
export interface IVendorInvoicePaymentEntity extends IEntityAuditColumn {
|
|
6
|
+
id: number;
|
|
7
|
+
vendorInvoiceId: number;
|
|
8
|
+
paymentDate: number;
|
|
9
|
+
mode: VendorInvoicePaymentModeEnum;
|
|
10
|
+
referenceNo?: Nullable<string>;
|
|
11
|
+
amount: number;
|
|
12
|
+
remarks?: Nullable<string>;
|
|
13
|
+
status: VendorInvoicePaymentStatusEnum;
|
|
14
|
+
}
|
|
@@ -25,5 +25,4 @@ export declare class BankEntityModel extends BaseEntityModel<EntityEnum.BANK> im
|
|
|
25
25
|
getRelationConfigs(): any[];
|
|
26
26
|
static relationConfigs: RelationConfigs<[EntityEnum.INTERMEDIARY_BANK], EntityEnum.BANK>;
|
|
27
27
|
get intermediaryBankModel(): IntermediaryBankEntityModel[];
|
|
28
|
-
getPaymentContactEmails(): string[];
|
|
29
28
|
}
|
|
@@ -35,13 +35,6 @@ class BankEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
35
35
|
var _a;
|
|
36
36
|
return (_a = this.intermediaryBanks) !== null && _a !== void 0 ? _a : [];
|
|
37
37
|
}
|
|
38
|
-
getPaymentContactEmails() {
|
|
39
|
-
const emails = this.emailForPaymentInfoCsv
|
|
40
|
-
.split(",")
|
|
41
|
-
.map((email) => email.trim())
|
|
42
|
-
.filter(Boolean);
|
|
43
|
-
return emails;
|
|
44
|
-
}
|
|
45
38
|
}
|
|
46
39
|
exports.BankEntityModel = BankEntityModel;
|
|
47
40
|
BankEntityModel.relationConfigs = [
|
|
@@ -447,16 +447,16 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
447
447
|
return (_b = (_a = this.client) === null || _a === void 0 ? void 0 : _a.clientAffiliates) === null || _b === void 0 ? void 0 : _b.find((affiliate) => affiliate.id === this.invoiceEntityId);
|
|
448
448
|
}
|
|
449
449
|
get isForeignBilling() {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return
|
|
450
|
+
var _a;
|
|
451
|
+
if (this.isClientInvoice()) {
|
|
452
|
+
return ((_a = this.client) === null || _a === void 0 ? void 0 : _a.country) !== undefined && this.client.country !== "India";
|
|
453
|
+
}
|
|
454
|
+
const affiliate = this.clientAffiliate;
|
|
455
|
+
return (affiliate === null || affiliate === void 0 ? void 0 : affiliate.country) !== undefined && affiliate.country !== "India";
|
|
456
456
|
}
|
|
457
457
|
get isForeignCurrencyProject() {
|
|
458
458
|
var _a, _b;
|
|
459
|
-
return (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.
|
|
459
|
+
return (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.isForeignCurrencyProjoect()) !== null && _b !== void 0 ? _b : false;
|
|
460
460
|
}
|
|
461
461
|
get isProformaInvoice() {
|
|
462
462
|
return this.type === billing_type_enum_1.BillingTypeEnum.ADVANCE;
|
|
@@ -75,6 +75,7 @@ const vendor_invoice_entity_model_1 = require("./vendor_invoice.entity.model");
|
|
|
75
75
|
const vendor_invoice_history_entity_model_1 = require("./vendor_invoice_history.entity.model");
|
|
76
76
|
const vendor_invoice_item_entity_model_1 = require("./vendor_invoice_item.entity.model");
|
|
77
77
|
const vendor_invoice_item_history_entity_model_1 = require("./vendor_invoice_item_history.entity.model");
|
|
78
|
+
const vendor_invoice_payment_entity_model_1 = require("./vendor_invoice_payment.entity.model");
|
|
78
79
|
const voucher_type_entity_model_1 = require("./voucher_type.entity.model");
|
|
79
80
|
const website_lead_entity_model_1 = require("./website_lead.entity.model");
|
|
80
81
|
const website_newsletter_subscription_entity_model_1 = require("./website_newsletter_subscription.entity.model");
|
|
@@ -177,6 +178,7 @@ exports.entityEnumToEntityModel = {
|
|
|
177
178
|
[entity_utils_interface_1.EntityEnum.PROJECT_REVENUE_SPLIT_MAPPING]: project_revenue_split_mapping_model_1.ProjectRevenueSplitMappingEntityModel.fromEntity,
|
|
178
179
|
[entity_utils_interface_1.EntityEnum.BILLING_PROFILE]: billing_profile_entity_model_1.BillingProfileEntityModel.fromEntity,
|
|
179
180
|
[entity_utils_interface_1.EntityEnum.ENTITY_HISTORY]: entity_history_entity_model_1.EntityHistoryEntityModel.fromEntity,
|
|
181
|
+
[entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_PAYMENT]: vendor_invoice_payment_entity_model_1.VendorInvoicePaymentEntityModel.fromEntity,
|
|
180
182
|
[entity_utils_interface_1.EntityEnum.LEAVE_APPROVAL]: leave_approval_entity_model_1.LeaveApprovalEntityModel.fromEntity,
|
|
181
183
|
};
|
|
182
184
|
function entityMapToModels(entityMap) {
|
|
@@ -38,7 +38,7 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
|
|
|
38
38
|
static relationConfigs: RelationConfigs<[EntityEnum.PROJECT_USER_MAPPING, EntityEnum.CLIENT], EntityEnum.PROJECT>;
|
|
39
39
|
populateUsers(users: UserEntityModel[], projectUserMapping: ProjectUserMappingEntityModel[]): void;
|
|
40
40
|
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EntityEnum.PROJECT>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EntityEnum.PROJECT>];
|
|
41
|
-
|
|
41
|
+
isForeignCurrencyProjoect(): boolean;
|
|
42
42
|
get parsedBillingRate(): any;
|
|
43
43
|
isHourlyProject(): boolean;
|
|
44
44
|
isFixedProject(): boolean;
|
|
@@ -90,7 +90,7 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
90
90
|
getRelationConfigs() {
|
|
91
91
|
return ProjectEntityModel.relationConfigs;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
isForeignCurrencyProjoect() {
|
|
94
94
|
return this.currency !== enums_1.CurrencyEnum.INR;
|
|
95
95
|
}
|
|
96
96
|
get parsedBillingRate() {
|
|
@@ -15,7 +15,7 @@ class StateEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
15
15
|
this.id = 0;
|
|
16
16
|
this.name = "";
|
|
17
17
|
this.code = "";
|
|
18
|
-
this.status = state_status_enum_1.StateStatusEnum.
|
|
18
|
+
this.status = state_status_enum_1.StateStatusEnum.CREATED;
|
|
19
19
|
this.createdOn = 0;
|
|
20
20
|
this.updatedOn = 0;
|
|
21
21
|
this.createdBy = 0;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// import { RelationConfigs } from "../interface/relation-config.interface";
|
|
5
5
|
// import { RelationType } from "../enums/relation-type.enum";
|
|
6
6
|
// import { IVendorInvoiceEntity } from "../interface/vendor_invoice.entity.interface";
|
|
7
|
-
// import {
|
|
8
|
-
// import {
|
|
7
|
+
// import { VendorInvoicePaidStatusEnum } from "../enums/vendor_invoice_status_enum";
|
|
8
|
+
// import { VendorInvoiceStatusEnum } from "../enums/vendor_invoice_action_status_enum";
|
|
9
9
|
// import { VendorEntityModel } from "./vendor.entity.model";
|
|
10
10
|
// import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
11
11
|
// export class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE> implements IVendorInvoiceEntity {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
// voucherNo?: string;
|
|
19
19
|
// voucherDate?: number;
|
|
20
20
|
// invoiceDocuments: string = "";
|
|
21
|
-
// status:
|
|
22
|
-
// actionStatus:
|
|
21
|
+
// status: VendorInvoicePaidStatusEnum = VendorInvoicePaidStatusEnum.PENDING;
|
|
22
|
+
// actionStatus: VendorInvoiceStatusEnum = VendorInvoiceStatusEnum.PENDING_APPROVAL;
|
|
23
23
|
// createdOn: number = 0;
|
|
24
24
|
// updatedOn: number = 0;
|
|
25
25
|
// createdBy: number = 0;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
|
|
2
2
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
3
|
import { BaseEntityModel } from "./base.entity.model";
|
|
4
|
-
import { IVendorInvoiceUpdateDto } from "../../api";
|
|
5
4
|
import { VendorInvoiceActionEnum } from "../enums/vendor_invoice_action.enum";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { VendorInvoiceStatusEnum } from "../enums/vendor_invoice_action_status_enum";
|
|
6
|
+
import { VendorInvoicePaidStatusEnum } from "../enums/vendor_invoice_status_enum";
|
|
7
|
+
import { IVendorInvoiceFlowConfigContextData } from "../flow-configs/vendor-invoice-flow.config";
|
|
8
8
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
9
9
|
import { IVendorInvoiceEntity } from "../interface/vendor_invoice.entity.interface";
|
|
10
10
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
@@ -22,8 +22,8 @@ export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
22
22
|
voucherNo?: string;
|
|
23
23
|
voucherDate?: number;
|
|
24
24
|
invoiceDocuments: string;
|
|
25
|
+
paidStatus: VendorInvoicePaidStatusEnum;
|
|
25
26
|
status: VendorInvoiceStatusEnum;
|
|
26
|
-
actionStatus: VendorInvoiceActionStatusEnum;
|
|
27
27
|
remark: Nullable<string>;
|
|
28
28
|
createdOn: number;
|
|
29
29
|
updatedOn: number;
|
|
@@ -34,13 +34,14 @@ export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
34
34
|
totalGstAmount: number;
|
|
35
35
|
totalTdsAmount: number;
|
|
36
36
|
totalNetAmount: number;
|
|
37
|
+
paidAmount: number;
|
|
38
|
+
adjustedAmount: number;
|
|
37
39
|
vendor?: VendorEntityModel;
|
|
38
40
|
officeLocation?: OfficeLocationEntityModel;
|
|
39
41
|
vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
|
|
40
42
|
static relationConfigs: RelationConfigs<[EntityEnum.VENDOR, EntityEnum.OFFICE_LOCATION, EntityEnum.VENDOR_INVOICE_ITEM], EntityEnum.VENDOR_INVOICE>;
|
|
41
43
|
static fromEntity(entity: IVendorInvoiceEntity): VendorInvoiceEntityModel;
|
|
42
44
|
getRelationConfigs(): any[];
|
|
43
|
-
getNextStatusForParent(currentUser: IUserEntity, dto: IVendorInvoiceUpdateDto): VendorInvoiceActionStatusEnum;
|
|
44
45
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
45
46
|
combinedActions?: Record<string, {
|
|
46
47
|
combineActions: VendorInvoiceActionEnum[];
|
|
@@ -110,4 +111,6 @@ export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
110
111
|
* @returns The next voucher number string in format `<FY-1><FY><MM><DD><###>`
|
|
111
112
|
*/
|
|
112
113
|
static getNextVoucherNumber(existingVendorInvoices: VendorInvoiceEntityModel[]): string;
|
|
114
|
+
getNextStatus(currentUser: IUserEntity, action: VendorInvoiceActionEnum, vendorInvoiceFlowConfigContextData: IVendorInvoiceFlowConfigContextData): VendorInvoiceStatusEnum;
|
|
115
|
+
getBalanceAmount(): number;
|
|
113
116
|
}
|
|
@@ -7,7 +7,6 @@ const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
|
7
7
|
const exceptions_1 = require("../../exceptions");
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
9
|
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
10
|
-
const vendor_invoice_action_enum_1 = require("../enums/vendor_invoice_action.enum");
|
|
11
10
|
const vendor_invoice_action_status_enum_1 = require("../enums/vendor_invoice_action_status_enum");
|
|
12
11
|
const vendor_invoice_status_enum_1 = require("../enums/vendor_invoice_status_enum");
|
|
13
12
|
const vendor_invoice_flow_config_1 = require("../flow-configs/vendor-invoice-flow.config");
|
|
@@ -20,8 +19,8 @@ class VendorInvoiceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
20
19
|
this.invoiceNo = "";
|
|
21
20
|
this.invoiceDate = 0;
|
|
22
21
|
this.invoiceDocuments = "";
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
22
|
+
this.paidStatus = vendor_invoice_status_enum_1.VendorInvoicePaidStatusEnum.PENDING;
|
|
23
|
+
this.status = vendor_invoice_action_status_enum_1.VendorInvoiceStatusEnum.CREATE_APPROVAL;
|
|
25
24
|
this.remark = null;
|
|
26
25
|
this.createdOn = 0;
|
|
27
26
|
this.updatedOn = 0;
|
|
@@ -32,6 +31,8 @@ class VendorInvoiceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
32
31
|
this.totalGstAmount = 0;
|
|
33
32
|
this.totalTdsAmount = 0;
|
|
34
33
|
this.totalNetAmount = 0;
|
|
34
|
+
this.paidAmount = 0;
|
|
35
|
+
this.adjustedAmount = 0;
|
|
35
36
|
}
|
|
36
37
|
static fromEntity(entity) {
|
|
37
38
|
const result = new VendorInvoiceEntityModel(entity_utils_interface_1.EntityEnum.VENDOR_INVOICE);
|
|
@@ -41,58 +42,58 @@ class VendorInvoiceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
41
42
|
getRelationConfigs() {
|
|
42
43
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
43
44
|
}
|
|
44
|
-
getNextStatusForParent(currentUser, dto) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
45
|
+
// getNextStatusForParent(currentUser: IUserEntity, dto: IVendorInvoiceUpdateDto): VendorInvoiceStatusEnum {
|
|
46
|
+
// const flowForStatus = vendorInvoiceFlowConfig[this.actionStatus];
|
|
47
|
+
// if (!flowForStatus) {
|
|
48
|
+
// throw new AppBadRequestException({
|
|
49
|
+
// key: ErrorKeyEnum.STATUS,
|
|
50
|
+
// message: [`Status not found: ${this.status}`],
|
|
51
|
+
// });
|
|
52
|
+
// }
|
|
53
|
+
// if (!dto.actionData) {
|
|
54
|
+
// dto.actionData = { action: VendorInvoiceActionEnum.EDIT };
|
|
55
|
+
// }
|
|
56
|
+
// const matchingPermissionConfig = flowForStatus.actions[dto.actionData.action];
|
|
57
|
+
// if (!matchingPermissionConfig) {
|
|
58
|
+
// throw new AppBadRequestException({
|
|
59
|
+
// key: ErrorKeyEnum.ACTION,
|
|
60
|
+
// message: [`Action '${dto.actionData.action}' is not valid for the current status '${this.status}'.`],
|
|
61
|
+
// });
|
|
62
|
+
// }
|
|
63
|
+
// if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
64
|
+
// throw new AppBadRequestException({
|
|
65
|
+
// key: ErrorKeyEnum.PERMISSIONS,
|
|
66
|
+
// message: ["Permission not available for currentUser"],
|
|
67
|
+
// });
|
|
68
|
+
// }
|
|
69
|
+
// const hasPermission = matchingPermissionConfig.permissions.some((permission: string) => currentUser.permissions?.includes(permission));
|
|
70
|
+
// if (!hasPermission) {
|
|
71
|
+
// throw new AppBadRequestException({
|
|
72
|
+
// key: ErrorKeyEnum.PERMISSION,
|
|
73
|
+
// message: [`Current user does not have permission to ${dto.actionData.action} vendor`],
|
|
74
|
+
// });
|
|
75
|
+
// }
|
|
76
|
+
// if (!this.vendorInvoiceItems) {
|
|
77
|
+
// throw new AppBadRequestException({
|
|
78
|
+
// key: ErrorKeyEnum.VENDOR_INVOICE_ITEMS,
|
|
79
|
+
// message: [`Vendor invoice items are required for getting next status of Vendor Invoice.`],
|
|
80
|
+
// });
|
|
81
|
+
// }
|
|
82
|
+
// // const contextFlowData: IVendorInvoiceFlowContextData = {
|
|
83
|
+
// // invoice: this,
|
|
84
|
+
// // items: this.vendorInvoiceItems,
|
|
85
|
+
// // };
|
|
86
|
+
// let nextStatus: VendorInvoiceStatusEnum = VendorInvoiceStatusEnum.CREATE_APPROVAL;
|
|
87
|
+
// if (matchingPermissionConfig.next) {
|
|
88
|
+
// nextStatus = matchingPermissionConfig.next();
|
|
89
|
+
// }
|
|
90
|
+
// return nextStatus;
|
|
91
|
+
// }
|
|
91
92
|
getAvailableActions(currentUser, config) {
|
|
92
93
|
var _a;
|
|
93
94
|
const params = {
|
|
94
95
|
flowConfig: vendor_invoice_flow_config_1.vendorInvoiceFlowConfig,
|
|
95
|
-
currentStatus: this.
|
|
96
|
+
currentStatus: this.status,
|
|
96
97
|
userPermissions: (_a = currentUser.permissions) !== null && _a !== void 0 ? _a : [],
|
|
97
98
|
visibilityData: this.getUpdateActionVisibility.bind(this, currentUser),
|
|
98
99
|
combinedActions: config === null || config === void 0 ? void 0 : config.combinedActions,
|
|
@@ -194,6 +195,53 @@ class VendorInvoiceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
194
195
|
}
|
|
195
196
|
return `${basePrefix}${String(maxSequence + 1).padStart(3, "0")}`;
|
|
196
197
|
}
|
|
198
|
+
getNextStatus(currentUser, action, vendorInvoiceFlowConfigContextData) {
|
|
199
|
+
const actionStatus = this.status;
|
|
200
|
+
if (!actionStatus) {
|
|
201
|
+
throw new exceptions_1.AppBadRequestException({
|
|
202
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
203
|
+
message: [`Status not found: ${actionStatus}`],
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const flowForStatus = vendor_invoice_flow_config_1.vendorInvoiceFlowConfig[actionStatus];
|
|
207
|
+
if (!flowForStatus) {
|
|
208
|
+
throw new exceptions_1.AppBadRequestException({
|
|
209
|
+
key: error_key_enum_1.ErrorKeyEnum.STATUS,
|
|
210
|
+
message: [`No flow configuration found for status: ${actionStatus}`],
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (!action) {
|
|
214
|
+
throw new exceptions_1.AppBadRequestException({
|
|
215
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION_DATA,
|
|
216
|
+
message: ["actionData is required"],
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const matchingPermissionConfig = flowForStatus.actions[action];
|
|
220
|
+
if (!matchingPermissionConfig) {
|
|
221
|
+
throw new exceptions_1.AppBadRequestException({
|
|
222
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
223
|
+
message: [`Action '${action}' is not valid for the current status '${actionStatus}'.`],
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
if (!currentUser.permissions || currentUser.permissions.length === 0) {
|
|
227
|
+
throw new exceptions_1.AppBadRequestException({
|
|
228
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSIONS,
|
|
229
|
+
message: ["Permission not available for currentUser"],
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const hasPermission = matchingPermissionConfig.permissions.some((permission) => currentUser.permissions.includes(permission));
|
|
233
|
+
if (!hasPermission) {
|
|
234
|
+
throw new exceptions_1.AppBadRequestException({
|
|
235
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
236
|
+
message: [`Current user does not have permission to ${action} leaveApproval. Required permissions: ${matchingPermissionConfig.permissions.join(", ")}`],
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const nextStatus = matchingPermissionConfig.next(vendorInvoiceFlowConfigContextData);
|
|
240
|
+
return nextStatus;
|
|
241
|
+
}
|
|
242
|
+
getBalanceAmount() {
|
|
243
|
+
return this.totalInvoiceAmount - this.paidAmount - this.adjustedAmount;
|
|
244
|
+
}
|
|
197
245
|
}
|
|
198
246
|
exports.VendorInvoiceEntityModel = VendorInvoiceEntityModel;
|
|
199
247
|
VendorInvoiceEntityModel.relationConfigs = [
|
|
@@ -106,7 +106,7 @@ class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
106
106
|
}
|
|
107
107
|
// getNextStatus(dto: IVendorInvoiceItemUpdateDto, currentUser: IUserEntity): VendorInvoiceItemStatus {
|
|
108
108
|
// // const flow = vendorInvoiceConfigFlow as FlowConfig<
|
|
109
|
-
// //
|
|
109
|
+
// // VendorInvoiceStatusEnum,
|
|
110
110
|
// // VendorInvoiceActionEnum,
|
|
111
111
|
// // VendorInvoiceItemStatus,
|
|
112
112
|
// // VendorInvoiceItemActionEnum
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { IUserEntity } from "../interface/user.entity.interface";
|
|
5
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
+
import { IRowActions } from "./interface/row-actions.interface";
|
|
7
|
+
import { IVendorInvoicePaymentEntity } from "../interface/vendor_invoice_payment.entity.interface";
|
|
8
|
+
import { VendorInvoicePaymentModeEnum } from "../enums/vendor_invoice_payment_mode_enum";
|
|
9
|
+
import { VendorInvoicePaymentStatusEnum } from "../enums/vendor_invoice_payment_status_enum";
|
|
10
|
+
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
11
|
+
import { VendorEntityModel } from "./vendor.entity.model";
|
|
12
|
+
import { StateEntityModel } from "./state.entity.model";
|
|
13
|
+
import { CountryEntityModel } from "./country.entity.model";
|
|
14
|
+
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
15
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
16
|
+
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
17
|
+
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
18
|
+
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
19
|
+
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
20
|
+
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
21
|
+
import { VendorInvoicePaymentActionEnum } from "../../api";
|
|
22
|
+
import { IVendorInvoicePaymentFlowConfigContextData } from "../flow-configs/vendor_invoice_payment_flow.config";
|
|
23
|
+
export declare class VendorInvoicePaymentEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE_PAYMENT> implements IVendorInvoicePaymentEntity {
|
|
24
|
+
id: number;
|
|
25
|
+
vendorInvoiceId: number;
|
|
26
|
+
paymentDate: number;
|
|
27
|
+
mode: VendorInvoicePaymentModeEnum;
|
|
28
|
+
referenceNo?: string;
|
|
29
|
+
amount: number;
|
|
30
|
+
remarks?: string;
|
|
31
|
+
status: VendorInvoicePaymentStatusEnum;
|
|
32
|
+
createdOn: number;
|
|
33
|
+
updatedOn: number;
|
|
34
|
+
createdBy: number;
|
|
35
|
+
updatedBy: number;
|
|
36
|
+
vendorInvoice?: VendorInvoiceEntityModel;
|
|
37
|
+
static relationConfigs: RelationConfigs<[EntityEnum.VENDOR_INVOICE], EntityEnum.VENDOR_INVOICE_PAYMENT>;
|
|
38
|
+
static fromEntity(entity: IVendorInvoicePaymentEntity): VendorInvoicePaymentEntityModel;
|
|
39
|
+
getRelationConfigs(): any[];
|
|
40
|
+
get vendor(): VendorEntityModel | undefined;
|
|
41
|
+
get state(): StateEntityModel | undefined;
|
|
42
|
+
get country(): CountryEntityModel | undefined;
|
|
43
|
+
get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
|
|
44
|
+
get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
|
|
45
|
+
get tdsRates(): TdsRateEntityModel[] | undefined;
|
|
46
|
+
get voucherTypes(): VoucherTypeEntityModel[] | undefined;
|
|
47
|
+
get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
|
|
48
|
+
get gstRates(): GstRateEntityModel[] | undefined;
|
|
49
|
+
get officeLocation(): OfficeLocationEntityModel | undefined;
|
|
50
|
+
getNextStatus(currentUser: IUserEntity, action: VendorInvoicePaymentActionEnum, vendorInvoicePaymentFlowConfigContextData: IVendorInvoicePaymentFlowConfigContextData): VendorInvoicePaymentStatusEnum;
|
|
51
|
+
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
52
|
+
combinedActions?: Record<string, {
|
|
53
|
+
combineActions: VendorInvoicePaymentActionEnum[];
|
|
54
|
+
label: string;
|
|
55
|
+
}>;
|
|
56
|
+
customLabels?: Partial<Record<VendorInvoicePaymentActionEnum, string>>;
|
|
57
|
+
}): IRowActions<EntityEnum.VENDOR_INVOICE_PAYMENT>[];
|
|
58
|
+
getUpdateActionVisibility(currentUser: UserEntityModel): {
|
|
59
|
+
[key: string]: () => boolean;
|
|
60
|
+
};
|
|
61
|
+
static getTotalAmount(vendorInvoicePayments: VendorInvoicePaymentEntityModel[]): number;
|
|
62
|
+
}
|