@tomei/finance 0.6.114 → 0.8.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/dist/account/account.d.ts +1 -0
- package/dist/account/account.d.ts.map +1 -0
- package/dist/account/account.js.map +1 -1
- package/dist/account/account.repository.d.ts +1 -0
- package/dist/account/account.repository.d.ts.map +1 -0
- package/dist/account/account.repository.js +4 -1
- package/dist/account/account.repository.js.map +1 -1
- package/dist/account/interfaces/account-attr.interface.d.ts +1 -0
- package/dist/account/interfaces/account-attr.interface.d.ts.map +1 -0
- package/dist/account-system-entity/account-system-entity.d.ts +1 -0
- package/dist/account-system-entity/account-system-entity.d.ts.map +1 -0
- package/dist/account-system-entity/account-system-entity.js +4 -1
- package/dist/account-system-entity/account-system-entity.js.map +1 -1
- package/dist/account-system-entity/post-history.repository.d.ts +1 -0
- package/dist/account-system-entity/post-history.repository.d.ts.map +1 -0
- package/dist/account-system-entity/post-history.repository.js +4 -1
- package/dist/account-system-entity/post-history.repository.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +17 -4
- package/dist/config.js.map +1 -1
- package/dist/customer/customer.d.ts +1 -0
- package/dist/customer/customer.d.ts.map +1 -0
- package/dist/customer/customer.js +38 -2
- package/dist/customer/customer.js.map +1 -1
- package/dist/customer/finance-customer.repository.d.ts +1 -0
- package/dist/customer/finance-customer.repository.d.ts.map +1 -0
- package/dist/customer/finance-customer.repository.js +4 -1
- package/dist/customer/finance-customer.repository.js.map +1 -1
- package/dist/customer/interfaces/customer.repository.interface.d.ts +1 -0
- package/dist/customer/interfaces/customer.repository.interface.d.ts.map +1 -0
- package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +1 -0
- package/dist/customer/interfaces/finance-customer-attr.interface.d.ts.map +1 -0
- package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +1 -0
- package/dist/customer/interfaces/finance-customer.repository.interface.d.ts.map +1 -0
- package/dist/database.d.ts +1 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +18 -15
- package/dist/database.js.map +1 -1
- package/dist/document/document-item.d.ts +3 -2
- package/dist/document/document-item.d.ts.map +1 -0
- package/dist/document/document-item.js +1 -1
- package/dist/document/document-item.js.map +1 -1
- package/dist/document/document-item.repository.d.ts +1 -0
- package/dist/document/document-item.repository.d.ts.map +1 -0
- package/dist/document/document-item.repository.js +4 -1
- package/dist/document/document-item.repository.js.map +1 -1
- package/dist/document/document.d.ts +2 -1
- package/dist/document/document.d.ts.map +1 -0
- package/dist/document/document.js +242 -191
- package/dist/document/document.js.map +1 -1
- package/dist/document/document.repository.d.ts +1 -0
- package/dist/document/document.repository.d.ts.map +1 -0
- package/dist/document/document.repository.js +4 -1
- package/dist/document/document.repository.js.map +1 -1
- package/dist/document/interfaces/document-attr.interface.d.ts +1 -0
- package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-find-all.interface.d.ts +1 -0
- package/dist/document/interfaces/document-find-all.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-item-attr.interface.d.ts +1 -0
- package/dist/document/interfaces/document-item-attr.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-item.repository.interface.d.ts +1 -0
- package/dist/document/interfaces/document-item.repository.interface.d.ts.map +1 -0
- package/dist/document-tag/document-tag.d.ts +19 -0
- package/dist/document-tag/document-tag.d.ts.map +1 -0
- package/dist/document-tag/document-tag.js +69 -0
- package/dist/document-tag/document-tag.js.map +1 -0
- package/dist/document-tag/document-tag.repository.d.ts +6 -0
- package/dist/document-tag/document-tag.repository.d.ts.map +1 -0
- package/dist/document-tag/document-tag.repository.js +15 -0
- package/dist/document-tag/document-tag.repository.js.map +1 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts +8 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts.map +1 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.js +3 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.js.map +1 -0
- package/dist/enum/collect-payment-type.d.ts +1 -0
- package/dist/enum/collect-payment-type.d.ts.map +1 -0
- package/dist/enum/doc-type.enum.d.ts +1 -0
- package/dist/enum/doc-type.enum.d.ts.map +1 -0
- package/dist/enum/document-status.enum.d.ts +1 -0
- package/dist/enum/document-status.enum.d.ts.map +1 -0
- package/dist/enum/index.d.ts +2 -2
- package/dist/enum/index.d.ts.map +1 -0
- package/dist/enum/index.js +1 -3
- package/dist/enum/index.js.map +1 -1
- package/dist/enum/payment-method.enum.d.ts +1 -0
- package/dist/enum/payment-method.enum.d.ts.map +1 -0
- package/dist/enum/payment-status.enum.d.ts +1 -0
- package/dist/enum/payment-status.enum.d.ts.map +1 -0
- package/dist/enum/payment-type.enum.d.ts +1 -0
- package/dist/enum/payment-type.enum.d.ts.map +1 -0
- package/dist/enum/quick-book-client-scopes.enum.d.ts +1 -0
- package/dist/enum/quick-book-client-scopes.enum.d.ts.map +1 -0
- package/dist/enum/quick-book-client-scopes.enum.js +34 -1
- package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
- package/dist/enum/transaction-type.enum.d.ts +1 -0
- package/dist/enum/transaction-type.enum.d.ts.map +1 -0
- package/dist/finance-company/finance-company.d.ts +20 -17
- package/dist/finance-company/finance-company.d.ts.map +1 -0
- package/dist/finance-company/finance-company.js +89 -23
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/finance-company/finance-company.repository.d.ts +1 -0
- package/dist/finance-company/finance-company.repository.d.ts.map +1 -0
- package/dist/finance-company/finance-company.repository.js +4 -1
- package/dist/finance-company/finance-company.repository.js.map +1 -1
- package/dist/helpers/login-user.d.ts +1 -0
- package/dist/helpers/login-user.d.ts.map +1 -0
- package/dist/helpers/typeof.d.ts +1 -0
- package/dist/helpers/typeof.d.ts.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -16
- package/dist/index.js.map +1 -1
- package/dist/interfaces/account-system.interface.d.ts +4 -0
- package/dist/interfaces/account-system.interface.d.ts.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.d.ts +1 -0
- package/dist/journal-entry/journal-entry.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.js +4 -1
- package/dist/journal-entry/journal-entry.js.map +1 -1
- package/dist/journal-entry/journal-entry.repository.d.ts +1 -0
- package/dist/journal-entry/journal-entry.repository.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.repository.js +4 -1
- package/dist/journal-entry/journal-entry.repository.js.map +1 -1
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts.map +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.d.ts +1 -0
- package/dist/ledger-transaction/ledger-transaction.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.d.ts +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.js +4 -1
- package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
- package/dist/models/account.entity.d.ts +1 -0
- package/dist/models/account.entity.d.ts.map +1 -0
- package/dist/models/account.entity.js +7 -4
- package/dist/models/account.entity.js.map +1 -1
- package/dist/models/customer.entity.d.ts +1 -0
- package/dist/models/customer.entity.d.ts.map +1 -0
- package/dist/models/customer.entity.js +4 -1
- package/dist/models/customer.entity.js.map +1 -1
- package/dist/models/document-item.entity.d.ts +1 -0
- package/dist/models/document-item.entity.d.ts.map +1 -0
- package/dist/models/document-item.entity.js +5 -2
- package/dist/models/document-item.entity.js.map +1 -1
- package/dist/models/document-tag.entity.d.ts +14 -0
- package/dist/models/document-tag.entity.d.ts.map +1 -0
- package/dist/models/document-tag.entity.js +64 -0
- package/dist/models/document-tag.entity.js.map +1 -0
- package/dist/models/document.entity.d.ts +3 -0
- package/dist/models/document.entity.d.ts.map +1 -0
- package/dist/models/document.entity.js +12 -4
- package/dist/models/document.entity.js.map +1 -1
- package/dist/models/finance-company.entity.d.ts +1 -0
- package/dist/models/finance-company.entity.d.ts.map +1 -0
- package/dist/models/finance-company.entity.js +5 -2
- package/dist/models/finance-company.entity.js.map +1 -1
- package/dist/models/journal-entry.entity.d.ts +1 -0
- package/dist/models/journal-entry.entity.d.ts.map +1 -0
- package/dist/models/journal-entry.entity.js +5 -2
- package/dist/models/journal-entry.entity.js.map +1 -1
- package/dist/models/ledger-transaction.entity.d.ts +1 -0
- package/dist/models/ledger-transaction.entity.d.ts.map +1 -0
- package/dist/models/ledger-transaction.entity.js +7 -4
- package/dist/models/ledger-transaction.entity.js.map +1 -1
- package/dist/models/payment-item.entity.d.ts +1 -0
- package/dist/models/payment-item.entity.d.ts.map +1 -0
- package/dist/models/payment-item.entity.js +4 -1
- package/dist/models/payment-item.entity.js.map +1 -1
- package/dist/models/payment-method-type.entity.d.ts +1 -0
- package/dist/models/payment-method-type.entity.d.ts.map +1 -0
- package/dist/models/payment-method-type.entity.js +5 -2
- package/dist/models/payment-method-type.entity.js.map +1 -1
- package/dist/models/payment-method.entity.d.ts +1 -0
- package/dist/models/payment-method.entity.d.ts.map +1 -0
- package/dist/models/payment-method.entity.js +5 -2
- package/dist/models/payment-method.entity.js.map +1 -1
- package/dist/models/payment-paid-with.entity.d.ts +1 -0
- package/dist/models/payment-paid-with.entity.d.ts.map +1 -0
- package/dist/models/payment-paid-with.entity.js +5 -2
- package/dist/models/payment-paid-with.entity.js.map +1 -1
- package/dist/models/payment.entity.d.ts +1 -0
- package/dist/models/payment.entity.d.ts.map +1 -0
- package/dist/models/payment.entity.js +6 -3
- package/dist/models/payment.entity.js.map +1 -1
- package/dist/models/post-history.entity.d.ts +1 -0
- package/dist/models/post-history.entity.d.ts.map +1 -0
- package/dist/models/tag-group.entity.d.ts +16 -0
- package/dist/models/tag-group.entity.d.ts.map +1 -0
- package/dist/models/tag-group.entity.js +95 -0
- package/dist/models/tag-group.entity.js.map +1 -0
- package/dist/models/tag.entity.d.ts +17 -0
- package/dist/models/tag.entity.d.ts.map +1 -0
- package/dist/models/tag.entity.js +100 -0
- package/dist/models/tag.entity.js.map +1 -0
- package/dist/models/tax.entity.d.ts +1 -0
- package/dist/models/tax.entity.d.ts.map +1 -0
- package/dist/models/tax.entity.js +4 -1
- package/dist/models/tax.entity.js.map +1 -1
- package/dist/payment/interfaces/payment-attr.interface.d.ts +1 -0
- package/dist/payment/interfaces/payment-attr.interface.d.ts.map +1 -0
- package/dist/payment/interfaces/payment-params.interface.d.ts +1 -0
- package/dist/payment/interfaces/payment-params.interface.d.ts.map +1 -0
- package/dist/payment/payment.d.ts +1 -0
- package/dist/payment/payment.d.ts.map +1 -0
- package/dist/payment/payment.js +5 -2
- package/dist/payment/payment.js.map +1 -1
- package/dist/payment/payment.repository.d.ts +1 -0
- package/dist/payment/payment.repository.d.ts.map +1 -0
- package/dist/payment/payment.repository.js +4 -1
- package/dist/payment/payment.repository.js.map +1 -1
- package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +1 -0
- package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts.map +1 -0
- package/dist/payment-item/payment-item.d.ts +1 -0
- package/dist/payment-item/payment-item.d.ts.map +1 -0
- package/dist/payment-item/payment-item.js +4 -4
- package/dist/payment-item/payment-item.repository.d.ts +1 -0
- package/dist/payment-item/payment-item.repository.d.ts.map +1 -0
- package/dist/payment-item/payment-item.repository.js +4 -1
- package/dist/payment-item/payment-item.repository.js.map +1 -1
- package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +1 -0
- package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts.map +1 -0
- package/dist/payment-method/payment-method.d.ts +1 -0
- package/dist/payment-method/payment-method.d.ts.map +1 -0
- package/dist/payment-method/payment-method.js +4 -1
- package/dist/payment-method/payment-method.js.map +1 -1
- package/dist/payment-method/payment-method.repository.d.ts +1 -0
- package/dist/payment-method/payment-method.repository.d.ts.map +1 -0
- package/dist/payment-method/payment-method.repository.js +4 -1
- package/dist/payment-method/payment-method.repository.js.map +1 -1
- package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +1 -0
- package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.d.ts +1 -0
- package/dist/payment-method-type/payment-method-type.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.repository.d.ts +1 -0
- package/dist/payment-method-type/payment-method-type.repository.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.repository.js +4 -1
- package/dist/payment-method-type/payment-method-type.repository.js.map +1 -1
- package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +1 -0
- package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.d.ts +1 -0
- package/dist/payment-paid-with/payment-paid-with.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.d.ts +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.js +4 -1
- package/dist/payment-paid-with/payment-paid-with.repository.js.map +1 -1
- package/dist/tag/interfaces/tag-attr.interface.d.ts +14 -0
- package/dist/tag/interfaces/tag-attr.interface.d.ts.map +1 -0
- package/dist/tag/interfaces/tag-attr.interface.js +3 -0
- package/dist/tag/interfaces/tag-attr.interface.js.map +1 -0
- package/dist/tag/tag.d.ts +26 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +110 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/tag.repository.d.ts +6 -0
- package/dist/tag/tag.repository.d.ts.map +1 -0
- package/dist/tag/tag.repository.js +15 -0
- package/dist/tag/tag.repository.js.map +1 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts +13 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts.map +1 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.js +3 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.js.map +1 -0
- package/dist/tag-group/tag-group.d.ts +25 -0
- package/dist/tag-group/tag-group.d.ts.map +1 -0
- package/dist/tag-group/tag-group.js +98 -0
- package/dist/tag-group/tag-group.js.map +1 -0
- package/dist/tag-group/tag-group.repository.d.ts +6 -0
- package/dist/tag-group/tag-group.repository.d.ts.map +1 -0
- package/dist/tag-group/tag-group.repository.js +15 -0
- package/dist/tag-group/tag-group.repository.js.map +1 -0
- package/dist/tax/interfaces/tax-attr.interface.d.ts +1 -0
- package/dist/tax/interfaces/tax-attr.interface.d.ts.map +1 -0
- package/dist/tax/tax.d.ts +1 -0
- package/dist/tax/tax.d.ts.map +1 -0
- package/dist/tax/tax.repository.d.ts +1 -0
- package/dist/tax/tax.repository.d.ts.map +1 -0
- package/dist/tax/tax.repository.js +4 -1
- package/dist/tax/tax.repository.js.map +1 -1
- package/dist/test-document.d.ts +1 -0
- package/dist/test-document.d.ts.map +1 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-document-tag-migration.js +46 -0
- package/migrations/finance-tag-group-migration.js +53 -0
- package/migrations/finance-tag-migration.js +63 -0
- package/package.json +18 -18
- package/.gitlab-ci.yml +0 -16
- package/.husky/commit-msg +0 -13
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -5
- package/CONTRIBUTING.md +0 -31
- package/README.md +0 -13
- package/eslint.config.mjs +0 -58
- package/nest-cli.json +0 -19
- package/sonar-project.properties +0 -13
- package/src/account/account.repository.ts +0 -11
- package/src/account/account.ts +0 -307
- package/src/account/interfaces/account-attr.interface.ts +0 -31
- package/src/account-system-entity/account-system-entity.ts +0 -66
- package/src/account-system-entity/post-history.repository.ts +0 -11
- package/src/config.ts +0 -382
- package/src/customer/customer.ts +0 -311
- package/src/customer/finance-customer.repository.ts +0 -13
- package/src/customer/interfaces/customer.repository.interface.ts +0 -3
- package/src/customer/interfaces/finance-customer-attr.interface.ts +0 -10
- package/src/customer/interfaces/finance-customer.repository.interface.ts +0 -4
- package/src/database.ts +0 -48
- package/src/document/document-item.repository.ts +0 -11
- package/src/document/document-item.ts +0 -146
- package/src/document/document.repository.ts +0 -11
- package/src/document/document.ts +0 -1328
- package/src/document/interfaces/document-attr.interface.ts +0 -28
- package/src/document/interfaces/document-find-all.interface.ts +0 -14
- package/src/document/interfaces/document-item-attr.interface.ts +0 -26
- package/src/document/interfaces/document-item.repository.interface.ts +0 -4
- package/src/enum/collect-payment-type.ts +0 -4
- package/src/enum/doc-type.enum.ts +0 -8
- package/src/enum/document-status.enum.ts +0 -6
- package/src/enum/index.ts +0 -19
- package/src/enum/payment-method.enum.ts +0 -3
- package/src/enum/payment-status.enum.ts +0 -11
- package/src/enum/payment-type.enum.ts +0 -4
- package/src/enum/quick-book-client-scopes.enum.ts +0 -14
- package/src/enum/transaction-type.enum.ts +0 -4
- package/src/finance-company/finance-company.repository.ts +0 -11
- package/src/finance-company/finance-company.ts +0 -2434
- package/src/helpers/login-user.ts +0 -38
- package/src/helpers/typeof.ts +0 -35
- package/src/index.ts +0 -32
- package/src/interfaces/account-system.interface.ts +0 -51
- package/src/interfaces/index.ts +0 -3
- package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +0 -12
- package/src/journal-entry/journal-entry.repository.ts +0 -17
- package/src/journal-entry/journal-entry.ts +0 -264
- package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +0 -18
- package/src/ledger-transaction/interfaces/ledger-transaction.repository.interface.ts +0 -7
- package/src/ledger-transaction/ledger-transaction.repository.ts +0 -17
- package/src/ledger-transaction/ledger-transaction.ts +0 -182
- package/src/models/account.entity.ts +0 -206
- package/src/models/customer.entity.ts +0 -93
- package/src/models/document-item.entity.ts +0 -167
- package/src/models/document.entity.ts +0 -211
- package/src/models/finance-company.entity.ts +0 -69
- package/src/models/journal-entry.entity.ts +0 -110
- package/src/models/ledger-transaction.entity.ts +0 -148
- package/src/models/payment-item.entity.ts +0 -60
- package/src/models/payment-method-type.entity.ts +0 -70
- package/src/models/payment-method.entity.ts +0 -51
- package/src/models/payment-paid-with.entity.ts +0 -133
- package/src/models/payment.entity.ts +0 -165
- package/src/models/post-history.entity.ts +0 -41
- package/src/models/tax.entity.ts +0 -75
- package/src/payment/interfaces/payment-attr.interface.ts +0 -23
- package/src/payment/interfaces/payment-params.interface.ts +0 -8
- package/src/payment/payment.repository.ts +0 -11
- package/src/payment/payment.ts +0 -236
- package/src/payment-item/interfaces/payment-item-attr.interface.ts +0 -10
- package/src/payment-item/payment-item.repository.ts +0 -11
- package/src/payment-item/payment-item.ts +0 -134
- package/src/payment-method/interfaces/payment-method-attr.interface.ts +0 -5
- package/src/payment-method/payment-method.repository.ts +0 -11
- package/src/payment-method/payment-method.ts +0 -146
- package/src/payment-method-type/interfaces/payment-method-type-attr.interface.ts +0 -8
- package/src/payment-method-type/payment-method-type.repository.ts +0 -11
- package/src/payment-method-type/payment-method-type.ts +0 -79
- package/src/payment-paid-with/interfaces/payment-paid-with.interface.ts +0 -20
- package/src/payment-paid-with/payment-paid-with.repository.ts +0 -11
- package/src/payment-paid-with/payment-paid-with.ts +0 -74
- package/src/tax/interfaces/tax-attr.interface.ts +0 -10
- package/src/tax/tax.repository.ts +0 -11
- package/src/tax/tax.ts +0 -68
- package/src/test-document.ts +0 -25
- package/src/test.ts +0 -3
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -23
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import Payment from '../payment/payment';
|
|
3
|
-
import { type } from '../helpers/typeof';
|
|
4
|
-
import { QueryTypes } from 'sequelize';
|
|
5
|
-
import { FinanceDb } from '../';
|
|
6
|
-
import { Next } from '@nestjs/common/decorators';
|
|
7
|
-
import { DocumentStatus } from '../enum/document-status.enum';
|
|
8
|
-
|
|
9
|
-
export default class PaymentItem extends ObjectBase {
|
|
10
|
-
private _PaymentId = '';
|
|
11
|
-
private _PayForObjectId = '';
|
|
12
|
-
private _PayForObjectType = '';
|
|
13
|
-
Currency = 'MYR';
|
|
14
|
-
Amount = 0;
|
|
15
|
-
Name = '';
|
|
16
|
-
Description = '';
|
|
17
|
-
Remarks = '';
|
|
18
|
-
private _ObjectType = 'PaymentItem';
|
|
19
|
-
|
|
20
|
-
get PaymentId() {
|
|
21
|
-
return this._PaymentId;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
private set PaymentId(id: string) {
|
|
25
|
-
this._PaymentId = id;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
get ObjectType() {
|
|
29
|
-
return this._ObjectType;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
get PayForObjectId() {
|
|
33
|
-
return this._PayForObjectId;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
set PayForObjectId(id: string) {
|
|
37
|
-
this._PayForObjectId = id;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get PayForObjectType(): string {
|
|
41
|
-
return this._PayForObjectType;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
set PayForObjectType(type: string) {
|
|
45
|
-
this._PayForObjectType = type;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* ObjectBase Implementation */
|
|
49
|
-
get ObjectId() {
|
|
50
|
-
return '';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
get ObjectName() {
|
|
54
|
-
return '';
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get TableName() {
|
|
58
|
-
return 'finance_PaymentItem';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
constructor(payment: Payment, objectBeingPaidFor: ObjectBase) {
|
|
62
|
-
super();
|
|
63
|
-
this.PaymentId = payment.PaymentId;
|
|
64
|
-
this.PayForObjectId = objectBeingPaidFor.ObjectId;
|
|
65
|
-
this.PayForObjectType = type(objectBeingPaidFor);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async paid(dbTransaction: any) {
|
|
69
|
-
const sequelize = FinanceDb.getConnection();
|
|
70
|
-
if (
|
|
71
|
-
this.PayForObjectType === 'Document' ||
|
|
72
|
-
this.PayForObjectType === 'FinanceDocument'
|
|
73
|
-
) {
|
|
74
|
-
const selectQuery = `SELECT Amount FROM finance_Document WHERE DocNo = '${this.PayForObjectId}'`;
|
|
75
|
-
const invoice: any[] = await sequelize.query(selectQuery, {
|
|
76
|
-
type: QueryTypes.SELECT,
|
|
77
|
-
raw: true,
|
|
78
|
-
transaction: dbTransaction,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
let paidStatus = '';
|
|
82
|
-
if (invoice[0].Amount > this.Amount) {
|
|
83
|
-
const selectPaymentItem = `SELECT * FROM finance_PaymentItem WHERE PayForObjectId = '${this.PayForObjectId}' AND PayForObjectType = 'Document'`;
|
|
84
|
-
const documentPaymentItems: any[] = await sequelize.query(
|
|
85
|
-
selectPaymentItem,
|
|
86
|
-
{
|
|
87
|
-
type: QueryTypes.SELECT,
|
|
88
|
-
raw: true,
|
|
89
|
-
transaction: dbTransaction,
|
|
90
|
-
},
|
|
91
|
-
);
|
|
92
|
-
let amountPreviouslyPaid = 0;
|
|
93
|
-
documentPaymentItems.forEach((paymentItem) => {
|
|
94
|
-
const amount =
|
|
95
|
-
typeof paymentItem.Amount === 'string'
|
|
96
|
-
? parseFloat(paymentItem.Amount).toFixed(2)
|
|
97
|
-
: paymentItem.Amount;
|
|
98
|
-
amountPreviouslyPaid += amount;
|
|
99
|
-
});
|
|
100
|
-
if (invoice[0].Amount == amountPreviouslyPaid) {
|
|
101
|
-
paidStatus = DocumentStatus.SETTLED;
|
|
102
|
-
} else {
|
|
103
|
-
paidStatus = DocumentStatus.PARTIALSETTLED;
|
|
104
|
-
}
|
|
105
|
-
} else if (invoice[0].Amount == this.Amount) {
|
|
106
|
-
paidStatus = DocumentStatus.SETTLED;
|
|
107
|
-
} else {
|
|
108
|
-
throw new Error(
|
|
109
|
-
'Payment Item amount cannot be greater than its PayForObject amount.',
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const updateQuery = `
|
|
114
|
-
UPDATE finance_Document
|
|
115
|
-
SET Status = '${paidStatus}'
|
|
116
|
-
WHERE DocNo = '${this.PayForObjectId}'
|
|
117
|
-
`;
|
|
118
|
-
// const replacements = { docNo: this.PayForObjectId };
|
|
119
|
-
await sequelize.query(updateQuery, {
|
|
120
|
-
type: QueryTypes.UPDATE,
|
|
121
|
-
raw: true,
|
|
122
|
-
transaction: dbTransaction,
|
|
123
|
-
});
|
|
124
|
-
} else if (
|
|
125
|
-
this.PayForObjectType === 'LoanSchedule' ||
|
|
126
|
-
this.PayForObjectType === 'SimpleLoans' ||
|
|
127
|
-
this.PayForObjectType === 'Loans'
|
|
128
|
-
) {
|
|
129
|
-
Next();
|
|
130
|
-
} else {
|
|
131
|
-
throw new Error('Unknown type');
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import PaymentMethodModel from '../models/payment-method.entity';
|
|
3
|
-
|
|
4
|
-
export class PaymentMethodRepository
|
|
5
|
-
extends RepositoryBase<PaymentMethodModel>
|
|
6
|
-
implements IRepositoryBase<PaymentMethodModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(PaymentMethodModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { RecordNotFoundError } from '@tomei/general/dist/class/exceptions/record-not-found.error';
|
|
3
|
-
import { PaymentMethodRepository } from './payment-method.repository';
|
|
4
|
-
import PaymentMethodType from '../payment-method-type/payment-method-type';
|
|
5
|
-
import { PaymentMethodTypeRepository } from '../payment-method-type/payment-method-type.repository';
|
|
6
|
-
import { IPaymentMethodTypeAttr } from '../payment-method-type/interfaces/payment-method-type-attr.interface';
|
|
7
|
-
|
|
8
|
-
export default class PaymentMethod extends ObjectBase {
|
|
9
|
-
MethodId = 'New';
|
|
10
|
-
Name = '';
|
|
11
|
-
CompanyId = '';
|
|
12
|
-
private _ObjectType = 'PaymentMethod';
|
|
13
|
-
|
|
14
|
-
get ObjectType() {
|
|
15
|
-
return this._ObjectType;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private static _RepositoryBase = new PaymentMethodRepository();
|
|
19
|
-
private static _PaymentMethodTypeRepository =
|
|
20
|
-
new PaymentMethodTypeRepository();
|
|
21
|
-
|
|
22
|
-
private _DbTransaction: any;
|
|
23
|
-
private _PaymentMethodTypes = [];
|
|
24
|
-
|
|
25
|
-
constructor(
|
|
26
|
-
dbTransaction?: any,
|
|
27
|
-
methodId?: string,
|
|
28
|
-
companyId?: string,
|
|
29
|
-
name?: string,
|
|
30
|
-
) {
|
|
31
|
-
super();
|
|
32
|
-
if (dbTransaction) {
|
|
33
|
-
this._DbTransaction = dbTransaction;
|
|
34
|
-
}
|
|
35
|
-
if (methodId) {
|
|
36
|
-
this.MethodId = methodId;
|
|
37
|
-
}
|
|
38
|
-
if (companyId) {
|
|
39
|
-
this.CompanyId = companyId;
|
|
40
|
-
}
|
|
41
|
-
if (name) {
|
|
42
|
-
this.Name = name;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static async initPaymentMethod(dbTransaction?: any, methodId?: string) {
|
|
47
|
-
try {
|
|
48
|
-
if (methodId) {
|
|
49
|
-
const methodData = await PaymentMethod._RepositoryBase.findOne({
|
|
50
|
-
where: {
|
|
51
|
-
MethodId: methodId,
|
|
52
|
-
},
|
|
53
|
-
transaction: dbTransaction,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
if (methodData) {
|
|
57
|
-
return new PaymentMethod(
|
|
58
|
-
dbTransaction,
|
|
59
|
-
methodData.MethodId,
|
|
60
|
-
methodData.CompanyId,
|
|
61
|
-
methodData.Name,
|
|
62
|
-
);
|
|
63
|
-
} else {
|
|
64
|
-
throw new RecordNotFoundError(
|
|
65
|
-
'PaymentMethodErrMsg',
|
|
66
|
-
'No record found.',
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return new PaymentMethod(dbTransaction);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
error;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get ObjectId() {
|
|
77
|
-
return this.MethodId;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
get ObjectName() {
|
|
81
|
-
return this.Name;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
get TableName() {
|
|
85
|
-
return 'finance_PaymentMethod';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
get PaymentMethodTypes(): Promise<PaymentMethodType[]> {
|
|
89
|
-
return new Promise((resolve, reject) => {
|
|
90
|
-
if (this.MethodId !== 'New') {
|
|
91
|
-
PaymentMethod._PaymentMethodTypeRepository
|
|
92
|
-
.findAll({
|
|
93
|
-
where: {
|
|
94
|
-
MethodId: this.MethodId,
|
|
95
|
-
},
|
|
96
|
-
transaction: this._DbTransaction,
|
|
97
|
-
})
|
|
98
|
-
.then((paymentMethodTypes) => {
|
|
99
|
-
const paymentMethodTypeObjects = paymentMethodTypes.map(
|
|
100
|
-
(paymentMethodTypeData) =>
|
|
101
|
-
new PaymentMethodType(
|
|
102
|
-
this._DbTransaction,
|
|
103
|
-
paymentMethodTypeData.MethodTypeId,
|
|
104
|
-
),
|
|
105
|
-
);
|
|
106
|
-
return Promise.all(paymentMethodTypeObjects);
|
|
107
|
-
})
|
|
108
|
-
.then((paymentMethodTypeObjects) => {
|
|
109
|
-
this._PaymentMethodTypes = paymentMethodTypeObjects;
|
|
110
|
-
resolve(this._PaymentMethodTypes);
|
|
111
|
-
})
|
|
112
|
-
.catch((err) => {
|
|
113
|
-
reject(err);
|
|
114
|
-
});
|
|
115
|
-
} else {
|
|
116
|
-
resolve(this._PaymentMethodTypes);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Create a new Payment Method Type which is automatically added to the Payment
|
|
123
|
-
* Method Type list
|
|
124
|
-
*
|
|
125
|
-
* @see {@link FinanceCompany.LoadPaymentMethods} - for implementation
|
|
126
|
-
*
|
|
127
|
-
* @param {IPaymentMethodTypeAttr} paymentMethodTypePayload
|
|
128
|
-
*
|
|
129
|
-
* @returns {void}
|
|
130
|
-
*/
|
|
131
|
-
async newPaymentMethodType(
|
|
132
|
-
payload: IPaymentMethodTypeAttr,
|
|
133
|
-
transaction?: any,
|
|
134
|
-
): Promise<any> {
|
|
135
|
-
try {
|
|
136
|
-
const newPaymentMethodType =
|
|
137
|
-
await PaymentMethod._PaymentMethodTypeRepository.create(payload, {
|
|
138
|
-
transaction: transaction,
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
this._PaymentMethodTypes.push(newPaymentMethodType);
|
|
142
|
-
} catch (err) {
|
|
143
|
-
throw err;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import PaymentMethodType from '../models/payment-method-type.entity';
|
|
3
|
-
|
|
4
|
-
export class PaymentMethodTypeRepository
|
|
5
|
-
extends RepositoryBase<PaymentMethodType>
|
|
6
|
-
implements IRepositoryBase<PaymentMethodType>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(PaymentMethodType);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { RecordNotFoundError } from '@tomei/general/dist/class/exceptions/record-not-found.error';
|
|
3
|
-
import { PaymentMethodTypeRepository } from './payment-method-type.repository';
|
|
4
|
-
|
|
5
|
-
export default class PaymentMethodType extends ObjectBase {
|
|
6
|
-
MethodTypeId = 'New';
|
|
7
|
-
MethodId = '';
|
|
8
|
-
Name = '';
|
|
9
|
-
AccountNo = '';
|
|
10
|
-
ProcessingFeeRate = 0.0;
|
|
11
|
-
ProcessingFeeAccountNo = '';
|
|
12
|
-
private _ObjectType = 'PaymentMethodType';
|
|
13
|
-
|
|
14
|
-
get ObjectType() {
|
|
15
|
-
return this._ObjectType;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private _DbTransaction: any;
|
|
19
|
-
|
|
20
|
-
private static _RepositoryBase = new PaymentMethodTypeRepository();
|
|
21
|
-
|
|
22
|
-
constructor(dbTransaction?: any, methodTypeId?: string) {
|
|
23
|
-
super();
|
|
24
|
-
if (dbTransaction) {
|
|
25
|
-
this._DbTransaction = dbTransaction;
|
|
26
|
-
}
|
|
27
|
-
if (methodTypeId) {
|
|
28
|
-
this.MethodTypeId = methodTypeId;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static async initMethodType(
|
|
33
|
-
dbTransaction: any,
|
|
34
|
-
methodTypeId: string,
|
|
35
|
-
): Promise<PaymentMethodType> {
|
|
36
|
-
try {
|
|
37
|
-
const paymentMethodTypeData = await this._RepositoryBase.findOne({
|
|
38
|
-
where: {
|
|
39
|
-
MethodTypeId: methodTypeId,
|
|
40
|
-
},
|
|
41
|
-
transaction: dbTransaction,
|
|
42
|
-
});
|
|
43
|
-
if (paymentMethodTypeData) {
|
|
44
|
-
const paymentMethodType = new PaymentMethodType(
|
|
45
|
-
dbTransaction,
|
|
46
|
-
methodTypeId,
|
|
47
|
-
);
|
|
48
|
-
paymentMethodType.MethodId = paymentMethodTypeData.MethodId;
|
|
49
|
-
paymentMethodType.Name = paymentMethodTypeData.Name;
|
|
50
|
-
paymentMethodType.AccountNo = paymentMethodTypeData.AccountNo;
|
|
51
|
-
paymentMethodType.ProcessingFeeRate =
|
|
52
|
-
paymentMethodTypeData.ProcessingFeeRate;
|
|
53
|
-
paymentMethodType.ProcessingFeeAccountNo =
|
|
54
|
-
paymentMethodTypeData.ProcessingFeeAccountNo;
|
|
55
|
-
return paymentMethodType;
|
|
56
|
-
} else {
|
|
57
|
-
const notFoundError = new RecordNotFoundError(
|
|
58
|
-
'PaymentMethodTypeErrMsg',
|
|
59
|
-
'No Record Found.',
|
|
60
|
-
);
|
|
61
|
-
throw notFoundError;
|
|
62
|
-
}
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.log('Payment method type constructor err: ', error);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get ObjectId() {
|
|
69
|
-
return this.MethodTypeId;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
get ObjectName() {
|
|
73
|
-
return this.Name;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get TableName() {
|
|
77
|
-
return 'finance_PaymentMethodType';
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PaymentStatus } from '../../enum';
|
|
2
|
-
|
|
3
|
-
export class IPaymentPaidWithAttr {
|
|
4
|
-
PaymentId: string;
|
|
5
|
-
MethodTypeId: string;
|
|
6
|
-
Currency: string;
|
|
7
|
-
Amount: number;
|
|
8
|
-
Status: PaymentStatus;
|
|
9
|
-
TransactionId?: string;
|
|
10
|
-
RefBank?: string;
|
|
11
|
-
RefName?: string;
|
|
12
|
-
RefNo?: string;
|
|
13
|
-
RefOther1?: string;
|
|
14
|
-
RefOther2?: string;
|
|
15
|
-
RefOther3?: string;
|
|
16
|
-
RefOther4?: string;
|
|
17
|
-
RefOther5?: string;
|
|
18
|
-
Remarks?: string;
|
|
19
|
-
PaymentMediaId?: string;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import PaymentPaidWithModel from '../models/payment-paid-with.entity';
|
|
3
|
-
|
|
4
|
-
export class PaymentPaidWithRepository
|
|
5
|
-
extends RepositoryBase<PaymentPaidWithModel>
|
|
6
|
-
implements IRepositoryBase<PaymentPaidWithModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(PaymentPaidWithModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import Payment from '../payment/payment';
|
|
3
|
-
import { PaymentPaidWithRepository } from './payment-paid-with.repository';
|
|
4
|
-
import { PaymentPaidWithStatus } from '../enum/payment-status.enum';
|
|
5
|
-
|
|
6
|
-
export default class PaymentPaidWith extends ObjectBase {
|
|
7
|
-
private _PaymentId = '';
|
|
8
|
-
private _MethodTypeId = '';
|
|
9
|
-
Currency = 'MYR';
|
|
10
|
-
Amount = 0;
|
|
11
|
-
Status: PaymentPaidWithStatus;
|
|
12
|
-
TransactionId = '';
|
|
13
|
-
RefBank = '';
|
|
14
|
-
RefName = '';
|
|
15
|
-
RefNo = '';
|
|
16
|
-
RefOther1 = '';
|
|
17
|
-
RefOther2 = '';
|
|
18
|
-
RefOther3 = '';
|
|
19
|
-
RefOther4 = '';
|
|
20
|
-
RefOther5 = '';
|
|
21
|
-
Remarks = '';
|
|
22
|
-
PaymentMediaId = '';
|
|
23
|
-
|
|
24
|
-
private _ObjectType = 'PaymentPaidWith';
|
|
25
|
-
|
|
26
|
-
private static _RepositoryBase = new PaymentPaidWithRepository();
|
|
27
|
-
private _DbTransaction: any;
|
|
28
|
-
|
|
29
|
-
get ObjectType() {
|
|
30
|
-
return this._ObjectType;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public get PaymentId() {
|
|
34
|
-
return this._PaymentId;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public set PaymentId(id: string) {
|
|
38
|
-
this._PaymentId = id;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public get MethodTypeId() {
|
|
42
|
-
return this._MethodTypeId;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public set MethodTypeId(id: string) {
|
|
46
|
-
this._MethodTypeId = id;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* ObjectBase Implementation */
|
|
50
|
-
get ObjectId() {
|
|
51
|
-
return '';
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
get ObjectName() {
|
|
55
|
-
return '';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get TableName() {
|
|
59
|
-
return 'finance_PaymentPaidWith';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
constructor(
|
|
63
|
-
payment: Payment,
|
|
64
|
-
paymentMethodTypeId: string,
|
|
65
|
-
dbTransaction?: any,
|
|
66
|
-
) {
|
|
67
|
-
super();
|
|
68
|
-
this.PaymentId = payment.PaymentId;
|
|
69
|
-
this.MethodTypeId = paymentMethodTypeId;
|
|
70
|
-
if (dbTransaction) {
|
|
71
|
-
this._DbTransaction = dbTransaction;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import FinanceTaxModel from '../models/tax.entity';
|
|
3
|
-
|
|
4
|
-
export class TaxRepository
|
|
5
|
-
extends RepositoryBase<FinanceTaxModel>
|
|
6
|
-
implements IRepositoryBase<FinanceTaxModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(FinanceTaxModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
package/src/tax/tax.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { ITaxAttr } from './interfaces/tax-attr.interface';
|
|
3
|
-
|
|
4
|
-
export class Tax extends ObjectBase {
|
|
5
|
-
ObjectName: string;
|
|
6
|
-
TableName: string;
|
|
7
|
-
ObjectId = 'New';
|
|
8
|
-
private _TaxCode: string;
|
|
9
|
-
private _Description: string;
|
|
10
|
-
private _CompanyId: string;
|
|
11
|
-
private _TaxRate = 0;
|
|
12
|
-
private _CreatedById: string;
|
|
13
|
-
private _CreatedAt: Date;
|
|
14
|
-
private _UpdatedById: string;
|
|
15
|
-
private _UpdatedAt: Date;
|
|
16
|
-
ObjectType = 'Tax';
|
|
17
|
-
|
|
18
|
-
get TaxCode(): string {
|
|
19
|
-
return this.ObjectId;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
set TaxCode(code: string) {
|
|
23
|
-
this._TaxCode = code;
|
|
24
|
-
this.ObjectId = code;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
constructor(taxAttr?: ITaxAttr) {
|
|
28
|
-
super();
|
|
29
|
-
if (taxAttr) {
|
|
30
|
-
this.TaxCode = taxAttr.TaxCode;
|
|
31
|
-
this._Description = taxAttr.Description;
|
|
32
|
-
this._CompanyId = taxAttr.CompanyId;
|
|
33
|
-
this._TaxRate = taxAttr.TaxRate;
|
|
34
|
-
this._CreatedById = taxAttr.CreatedById;
|
|
35
|
-
this._CreatedAt = taxAttr.CreatedAt;
|
|
36
|
-
this._UpdatedById = taxAttr.UpdatedById;
|
|
37
|
-
this._UpdatedAt = taxAttr.UpdatedAt;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get Description(): string {
|
|
42
|
-
return this._Description;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get CompanyId(): string {
|
|
46
|
-
return this._CompanyId;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
get TaxRate(): number {
|
|
50
|
-
return this._TaxRate;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
get CreatedById(): string {
|
|
54
|
-
return this._CreatedById;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get CreatedAt(): Date {
|
|
58
|
-
return this._CreatedAt;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
get UpdatedById(): string {
|
|
62
|
-
return this._UpdatedById;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
get UpdatedAt(): Date {
|
|
66
|
-
return this._UpdatedAt;
|
|
67
|
-
}
|
|
68
|
-
}
|
package/src/test-document.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export class TestDocument {
|
|
2
|
-
static test(classPath, className) {
|
|
3
|
-
// tslint:disable-next-line:no-console
|
|
4
|
-
console.log('inside test() #1');
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unused-vars,
|
|
8
|
-
const module = require(classPath);
|
|
9
|
-
// tslint:disable-next-line:no-console
|
|
10
|
-
console.log('inside test() #1: %o', module);
|
|
11
|
-
console.log(`module.${className}`);
|
|
12
|
-
// tslint:disable-next-line:no-eval
|
|
13
|
-
const classConstructor = eval(`module.${className}`);
|
|
14
|
-
// tslint:disable-next-line:no-console
|
|
15
|
-
console.log('inside test() #2: %o', classConstructor);
|
|
16
|
-
|
|
17
|
-
const docGen = new classConstructor('RECEIPT001');
|
|
18
|
-
// tslint:disable-next-line:no-console
|
|
19
|
-
console.log('inside test() #3');
|
|
20
|
-
|
|
21
|
-
docGen.generateReceipt();
|
|
22
|
-
// tslint:disable-next-line:no-console
|
|
23
|
-
console.log('inside test() #4');
|
|
24
|
-
}
|
|
25
|
-
}
|
package/src/test.ts
DELETED
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"moduleResolution": "node",
|
|
10
|
-
"target": "es2017",
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"outDir": "./dist",
|
|
13
|
-
"baseUrl": "./",
|
|
14
|
-
"incremental": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"strictNullChecks": false,
|
|
17
|
-
"noImplicitAny": false,
|
|
18
|
-
"strictBindCallApply": false,
|
|
19
|
-
"forceConsistentCasingInFileNames": false,
|
|
20
|
-
"noFallthroughCasesInSwitch": false,
|
|
21
|
-
},
|
|
22
|
-
"exclude": ["node_modules", "dist", "invoice-template", "configs"]
|
|
23
|
-
}
|