@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,16 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const util = require("util");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const puppeteer = require("puppeteer");
|
|
39
|
+
const util = __importStar(require("util"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const puppeteer = __importStar(require("puppeteer"));
|
|
7
43
|
const media_1 = require("@tomei/media");
|
|
8
44
|
const enum_1 = require("../enum");
|
|
9
45
|
const document_item_repository_1 = require("./document-item.repository");
|
|
10
|
-
const document_item_1 = require("./document-item");
|
|
46
|
+
const document_item_1 = __importDefault(require("./document-item"));
|
|
11
47
|
const account_system_entity_1 = require("../account-system-entity/account-system-entity");
|
|
12
48
|
const document_repository_1 = require("./document.repository");
|
|
13
|
-
const document_item_entity_1 = require("../models/document-item.entity");
|
|
49
|
+
const document_item_entity_1 = __importDefault(require("../models/document-item.entity"));
|
|
14
50
|
const general_1 = require("@tomei/general");
|
|
15
51
|
const config_1 = require("@tomei/config");
|
|
16
52
|
const sequelize_1 = require("sequelize");
|
|
@@ -370,31 +406,31 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
370
406
|
}, imgTag);
|
|
371
407
|
const currentDate = date.toLocaleDateString('en-GB');
|
|
372
408
|
const invoiceNo = this.DocNo;
|
|
373
|
-
const invoiceTitleInfo = `
|
|
374
|
-
<div class="tm_invoice_seperator tm_gray_bg"></div>
|
|
375
|
-
<div class="tm_invoice_info_list">
|
|
376
|
-
<p class="tm_invoice_number tm_m0">
|
|
377
|
-
Invoice No: <b class="tm_primary_color">${invoiceNo}</b>
|
|
378
|
-
</p>
|
|
379
|
-
<p class="tm_invoice_date tm_m0">
|
|
380
|
-
Date: <b class="tm_primary_color">${currentDate}</b>
|
|
381
|
-
</p>
|
|
382
|
-
</div>
|
|
409
|
+
const invoiceTitleInfo = `
|
|
410
|
+
<div class="tm_invoice_seperator tm_gray_bg"></div>
|
|
411
|
+
<div class="tm_invoice_info_list">
|
|
412
|
+
<p class="tm_invoice_number tm_m0">
|
|
413
|
+
Invoice No: <b class="tm_primary_color">${invoiceNo}</b>
|
|
414
|
+
</p>
|
|
415
|
+
<p class="tm_invoice_date tm_m0">
|
|
416
|
+
Date: <b class="tm_primary_color">${currentDate}</b>
|
|
417
|
+
</p>
|
|
418
|
+
</div>
|
|
383
419
|
`;
|
|
384
420
|
const invoiceTitleInfoHandle = await page.$('.tm_invoice_info');
|
|
385
421
|
await invoiceTitleInfoHandle.evaluate((invoice, invoiceTitleInfo) => {
|
|
386
422
|
invoice.innerHTML = invoiceTitleInfo;
|
|
387
423
|
}, invoiceTitleInfo);
|
|
388
|
-
const invoiceCustomerContent = `
|
|
389
|
-
<p class="tm_mb2">
|
|
390
|
-
<b class="tm_primary_color">Invoice To:</b>
|
|
391
|
-
</p>
|
|
392
|
-
<p>
|
|
393
|
-
${customer.FullName} <br />
|
|
394
|
-
${customer.DefaultAddress.Address}, ${customer.DefaultAddress.City} <br />
|
|
395
|
-
${customer.DefaultAddress.Country} <br />
|
|
396
|
-
${customer.Email}
|
|
397
|
-
</p>
|
|
424
|
+
const invoiceCustomerContent = `
|
|
425
|
+
<p class="tm_mb2">
|
|
426
|
+
<b class="tm_primary_color">Invoice To:</b>
|
|
427
|
+
</p>
|
|
428
|
+
<p>
|
|
429
|
+
${customer.FullName} <br />
|
|
430
|
+
${customer.DefaultAddress.Address}, ${customer.DefaultAddress.City} <br />
|
|
431
|
+
${customer.DefaultAddress.Country} <br />
|
|
432
|
+
${customer.Email}
|
|
433
|
+
</p>
|
|
398
434
|
`;
|
|
399
435
|
const invoiceCustomerHandle = await page.$('.tm_customer_detail');
|
|
400
436
|
await invoiceCustomerHandle.evaluate((invoice, invoiceCustomerContent) => {
|
|
@@ -412,64 +448,64 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
412
448
|
}, invoicePaymentInfoContent);
|
|
413
449
|
const invoiceSubtotal = +this.Amount;
|
|
414
450
|
const invoiceTax = 0;
|
|
415
|
-
const invoiceRightFooterContent = `
|
|
416
|
-
<table>
|
|
417
|
-
<tbody>
|
|
418
|
-
<tr>
|
|
419
|
-
<td
|
|
420
|
-
class="tm_width_3 tm_primary_color tm_border_none tm_bold"
|
|
421
|
-
>
|
|
422
|
-
Subtotal
|
|
423
|
-
</td>
|
|
424
|
-
<td
|
|
425
|
-
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_bold"
|
|
426
|
-
>
|
|
427
|
-
${this.Currency} ${invoiceSubtotal.toFixed(2)}
|
|
428
|
-
</td>
|
|
429
|
-
</tr>
|
|
430
|
-
<tr>
|
|
431
|
-
<td
|
|
432
|
-
class="tm_width_3 tm_primary_color tm_border_none tm_pt0"
|
|
433
|
-
>
|
|
434
|
-
Tax <span class="tm_ternary_color">(0%)</span>
|
|
435
|
-
</td>
|
|
436
|
-
<td
|
|
437
|
-
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_pt0"
|
|
438
|
-
>
|
|
439
|
-
${this.Currency} ${invoiceTax.toFixed(2)}
|
|
440
|
-
</td>
|
|
441
|
-
</tr>
|
|
442
|
-
<tr class="tm_border_top tm_border_bottom">
|
|
443
|
-
<td
|
|
444
|
-
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color"
|
|
445
|
-
>
|
|
446
|
-
Grand Total
|
|
447
|
-
</td>
|
|
448
|
-
<td
|
|
449
|
-
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color tm_text_right"
|
|
450
|
-
>
|
|
451
|
-
${this.Currency} ${(invoiceSubtotal + invoiceTax).toFixed(2)}
|
|
452
|
-
</td>
|
|
453
|
-
</tr>
|
|
454
|
-
</tbody>
|
|
455
|
-
</table>
|
|
451
|
+
const invoiceRightFooterContent = `
|
|
452
|
+
<table>
|
|
453
|
+
<tbody>
|
|
454
|
+
<tr>
|
|
455
|
+
<td
|
|
456
|
+
class="tm_width_3 tm_primary_color tm_border_none tm_bold"
|
|
457
|
+
>
|
|
458
|
+
Subtotal
|
|
459
|
+
</td>
|
|
460
|
+
<td
|
|
461
|
+
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_bold"
|
|
462
|
+
>
|
|
463
|
+
${this.Currency} ${invoiceSubtotal.toFixed(2)}
|
|
464
|
+
</td>
|
|
465
|
+
</tr>
|
|
466
|
+
<tr>
|
|
467
|
+
<td
|
|
468
|
+
class="tm_width_3 tm_primary_color tm_border_none tm_pt0"
|
|
469
|
+
>
|
|
470
|
+
Tax <span class="tm_ternary_color">(0%)</span>
|
|
471
|
+
</td>
|
|
472
|
+
<td
|
|
473
|
+
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_pt0"
|
|
474
|
+
>
|
|
475
|
+
${this.Currency} ${invoiceTax.toFixed(2)}
|
|
476
|
+
</td>
|
|
477
|
+
</tr>
|
|
478
|
+
<tr class="tm_border_top tm_border_bottom">
|
|
479
|
+
<td
|
|
480
|
+
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color"
|
|
481
|
+
>
|
|
482
|
+
Grand Total
|
|
483
|
+
</td>
|
|
484
|
+
<td
|
|
485
|
+
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color tm_text_right"
|
|
486
|
+
>
|
|
487
|
+
${this.Currency} ${(invoiceSubtotal + invoiceTax).toFixed(2)}
|
|
488
|
+
</td>
|
|
489
|
+
</tr>
|
|
490
|
+
</tbody>
|
|
491
|
+
</table>
|
|
456
492
|
`;
|
|
457
493
|
const invoiceRightFooterHandle = await page.$('.tm_item_total_section');
|
|
458
494
|
await invoiceRightFooterHandle.evaluate((invoice, invoiceRightFooterContent) => {
|
|
459
495
|
invoice.innerHTML = invoiceRightFooterContent;
|
|
460
496
|
}, invoiceRightFooterContent);
|
|
461
|
-
const invoiceTNCContent = `
|
|
462
|
-
<li>
|
|
463
|
-
All payment must be made to:
|
|
464
|
-
<ul>
|
|
465
|
-
<li>Bank: <b>RHB BANK BHD</b></li>
|
|
466
|
-
<li>Account Name: <b>TXG Financial Solutions Sdn Bhd</b></li>
|
|
467
|
-
<li>Account No.: <b>2142 13000 17954</b></li>
|
|
468
|
-
</ul>
|
|
469
|
-
</li>
|
|
470
|
-
<li>
|
|
471
|
-
Once payment has been made, please email your transaction confirmation slip to <i>payment@ezcash.com.my</i>
|
|
472
|
-
</li>
|
|
497
|
+
const invoiceTNCContent = `
|
|
498
|
+
<li>
|
|
499
|
+
All payment must be made to:
|
|
500
|
+
<ul>
|
|
501
|
+
<li>Bank: <b>RHB BANK BHD</b></li>
|
|
502
|
+
<li>Account Name: <b>TXG Financial Solutions Sdn Bhd</b></li>
|
|
503
|
+
<li>Account No.: <b>2142 13000 17954</b></li>
|
|
504
|
+
</ul>
|
|
505
|
+
</li>
|
|
506
|
+
<li>
|
|
507
|
+
Once payment has been made, please email your transaction confirmation slip to <i>payment@ezcash.com.my</i>
|
|
508
|
+
</li>
|
|
473
509
|
`;
|
|
474
510
|
const invoiceTNCHandle = await page.$('.tm_tnc_content');
|
|
475
511
|
await invoiceTNCHandle.evaluate((invoice, invoiceTNCContent) => {
|
|
@@ -478,16 +514,16 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
478
514
|
const invoiceDocumentItems = await this.DocumentItems;
|
|
479
515
|
let invoiceItemContent = ``;
|
|
480
516
|
invoiceDocumentItems.forEach((documentItem, i) => {
|
|
481
|
-
invoiceItemContent += `
|
|
482
|
-
<tr>
|
|
483
|
-
<td class="tm_width_3">${i + 1}. ${documentItem.Name}</td>
|
|
484
|
-
<td class="tm_width_4">
|
|
485
|
-
${documentItem.Description}
|
|
486
|
-
</td>
|
|
487
|
-
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice}</td>
|
|
488
|
-
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
489
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${(+documentItem.UnitPrice * +documentItem.Quantity).toFixed(2)}</td>
|
|
490
|
-
</tr>
|
|
517
|
+
invoiceItemContent += `
|
|
518
|
+
<tr>
|
|
519
|
+
<td class="tm_width_3">${i + 1}. ${documentItem.Name}</td>
|
|
520
|
+
<td class="tm_width_4">
|
|
521
|
+
${documentItem.Description}
|
|
522
|
+
</td>
|
|
523
|
+
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice}</td>
|
|
524
|
+
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
525
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${(+documentItem.UnitPrice * +documentItem.Quantity).toFixed(2)}</td>
|
|
526
|
+
</tr>
|
|
491
527
|
`;
|
|
492
528
|
});
|
|
493
529
|
const invoiceDocumentItemHandle = await page.$('.tm_items_content');
|
|
@@ -543,40 +579,40 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
543
579
|
}, imgTag);
|
|
544
580
|
const currentDate = date.toLocaleDateString('en-GB');
|
|
545
581
|
const receiptNo = this.DocNo;
|
|
546
|
-
const receiptTitle = `
|
|
547
|
-
<div class="tm_primary_color tm_f50 tm_text_uppercase">
|
|
548
|
-
Receipt
|
|
549
|
-
</div>
|
|
582
|
+
const receiptTitle = `
|
|
583
|
+
<div class="tm_primary_color tm_f50 tm_text_uppercase">
|
|
584
|
+
Receipt
|
|
585
|
+
</div>
|
|
550
586
|
`;
|
|
551
587
|
const receiptTitleHandle = await page.$('.tm_invoice_title');
|
|
552
588
|
await receiptTitleHandle.evaluate((receipt, receiptTitle) => {
|
|
553
589
|
receipt.innerHTML = receiptTitle;
|
|
554
590
|
}, receiptTitle);
|
|
555
|
-
const receiptTitleInfo = `
|
|
556
|
-
<div class="tm_invoice_seperator tm_gray_bg"></div>
|
|
557
|
-
<div class="tm_invoice_info_list">
|
|
558
|
-
<p class="tm_invoice_number tm_m0">
|
|
559
|
-
Receipt No: <b class="tm_primary_color">${receiptNo}</b>
|
|
560
|
-
</p>
|
|
561
|
-
<p class="tm_invoice_date tm_m0">
|
|
562
|
-
Date: <b class="tm_primary_color">${currentDate}</b>
|
|
563
|
-
</p>
|
|
564
|
-
</div>
|
|
591
|
+
const receiptTitleInfo = `
|
|
592
|
+
<div class="tm_invoice_seperator tm_gray_bg"></div>
|
|
593
|
+
<div class="tm_invoice_info_list">
|
|
594
|
+
<p class="tm_invoice_number tm_m0">
|
|
595
|
+
Receipt No: <b class="tm_primary_color">${receiptNo}</b>
|
|
596
|
+
</p>
|
|
597
|
+
<p class="tm_invoice_date tm_m0">
|
|
598
|
+
Date: <b class="tm_primary_color">${currentDate}</b>
|
|
599
|
+
</p>
|
|
600
|
+
</div>
|
|
565
601
|
`;
|
|
566
602
|
const receiptTitleInfoHandle = await page.$('.tm_invoice_info');
|
|
567
603
|
await receiptTitleInfoHandle.evaluate((receipt, receiptTitleInfo) => {
|
|
568
604
|
receipt.innerHTML = receiptTitleInfo;
|
|
569
605
|
}, receiptTitleInfo);
|
|
570
|
-
const receiptCustomerContent = `
|
|
571
|
-
<p class="tm_mb2">
|
|
572
|
-
<b class="tm_primary_color">Issued To:</b>
|
|
573
|
-
</p>
|
|
574
|
-
<p>
|
|
575
|
-
${customer.FullName} <br />
|
|
576
|
-
${customer.DefaultAddress.Address}, ${customer.DefaultAddress.City} <br />
|
|
577
|
-
${customer.DefaultAddress.Country} <br />
|
|
578
|
-
${customer.Email}
|
|
579
|
-
</p>
|
|
606
|
+
const receiptCustomerContent = `
|
|
607
|
+
<p class="tm_mb2">
|
|
608
|
+
<b class="tm_primary_color">Issued To:</b>
|
|
609
|
+
</p>
|
|
610
|
+
<p>
|
|
611
|
+
${customer.FullName} <br />
|
|
612
|
+
${customer.DefaultAddress.Address}, ${customer.DefaultAddress.City} <br />
|
|
613
|
+
${customer.DefaultAddress.Country} <br />
|
|
614
|
+
${customer.Email}
|
|
615
|
+
</p>
|
|
580
616
|
`;
|
|
581
617
|
const receiptCustomerHandle = await page.$('.tm_customer_detail');
|
|
582
618
|
await receiptCustomerHandle.evaluate((receipt, receiptCustomerContent) => {
|
|
@@ -594,47 +630,47 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
594
630
|
}, receiptPaymentInfoContent);
|
|
595
631
|
const receiptSubtotal = +this.Amount;
|
|
596
632
|
const receiptTax = 0;
|
|
597
|
-
const receiptRightFooterContent = `
|
|
598
|
-
<table>
|
|
599
|
-
<tbody>
|
|
600
|
-
<tr>
|
|
601
|
-
<td
|
|
602
|
-
class="tm_width_3 tm_primary_color tm_border_none tm_bold"
|
|
603
|
-
>
|
|
604
|
-
Subtotal
|
|
605
|
-
</td>
|
|
606
|
-
<td
|
|
607
|
-
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_bold"
|
|
608
|
-
>
|
|
609
|
-
${this.Currency} ${receiptSubtotal}
|
|
610
|
-
</td>
|
|
611
|
-
</tr>
|
|
612
|
-
<tr>
|
|
613
|
-
<td
|
|
614
|
-
class="tm_width_3 tm_primary_color tm_border_none tm_pt0"
|
|
615
|
-
>
|
|
616
|
-
Tax <span class="tm_ternary_color">(0%)</span>
|
|
617
|
-
</td>
|
|
618
|
-
<td
|
|
619
|
-
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_pt0"
|
|
620
|
-
>
|
|
621
|
-
${this.Currency} ${receiptTax}
|
|
622
|
-
</td>
|
|
623
|
-
</tr>
|
|
624
|
-
<tr class="tm_border_top tm_border_bottom">
|
|
625
|
-
<td
|
|
626
|
-
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color"
|
|
627
|
-
>
|
|
628
|
-
Grand Total
|
|
629
|
-
</td>
|
|
630
|
-
<td
|
|
631
|
-
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color tm_text_right"
|
|
632
|
-
>
|
|
633
|
-
${this.Currency} ${receiptSubtotal + receiptTax}
|
|
634
|
-
</td>
|
|
635
|
-
</tr>
|
|
636
|
-
</tbody>
|
|
637
|
-
</table>
|
|
633
|
+
const receiptRightFooterContent = `
|
|
634
|
+
<table>
|
|
635
|
+
<tbody>
|
|
636
|
+
<tr>
|
|
637
|
+
<td
|
|
638
|
+
class="tm_width_3 tm_primary_color tm_border_none tm_bold"
|
|
639
|
+
>
|
|
640
|
+
Subtotal
|
|
641
|
+
</td>
|
|
642
|
+
<td
|
|
643
|
+
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_bold"
|
|
644
|
+
>
|
|
645
|
+
${this.Currency} ${receiptSubtotal}
|
|
646
|
+
</td>
|
|
647
|
+
</tr>
|
|
648
|
+
<tr>
|
|
649
|
+
<td
|
|
650
|
+
class="tm_width_3 tm_primary_color tm_border_none tm_pt0"
|
|
651
|
+
>
|
|
652
|
+
Tax <span class="tm_ternary_color">(0%)</span>
|
|
653
|
+
</td>
|
|
654
|
+
<td
|
|
655
|
+
class="tm_width_3 tm_primary_color tm_text_right tm_border_none tm_pt0"
|
|
656
|
+
>
|
|
657
|
+
${this.Currency} ${receiptTax}
|
|
658
|
+
</td>
|
|
659
|
+
</tr>
|
|
660
|
+
<tr class="tm_border_top tm_border_bottom">
|
|
661
|
+
<td
|
|
662
|
+
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color"
|
|
663
|
+
>
|
|
664
|
+
Grand Total
|
|
665
|
+
</td>
|
|
666
|
+
<td
|
|
667
|
+
class="tm_width_3 tm_border_top_0 tm_bold tm_f16 tm_primary_color tm_text_right"
|
|
668
|
+
>
|
|
669
|
+
${this.Currency} ${receiptSubtotal + receiptTax}
|
|
670
|
+
</td>
|
|
671
|
+
</tr>
|
|
672
|
+
</tbody>
|
|
673
|
+
</table>
|
|
638
674
|
`;
|
|
639
675
|
const receiptRightFooterHandle = await page.$('.tm_item_total_section');
|
|
640
676
|
await receiptRightFooterHandle.evaluate((receipt, receiptRightFooterContent) => {
|
|
@@ -643,29 +679,29 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
643
679
|
const receiptDocumentItems = await this.DocumentItems;
|
|
644
680
|
let receiptItemContent = ``;
|
|
645
681
|
receiptDocumentItems.forEach((documentItem, i) => {
|
|
646
|
-
receiptItemContent += `
|
|
647
|
-
<tr>
|
|
648
|
-
<td class="tm_width_3">${i + 1}. ${documentItem.Name}</td>
|
|
649
|
-
<td class="tm_width_4">
|
|
650
|
-
${documentItem.Description}
|
|
651
|
-
</td>
|
|
652
|
-
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice}</td>
|
|
653
|
-
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
654
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${+documentItem.UnitPrice * +documentItem.Quantity}</td>
|
|
655
|
-
</tr>
|
|
682
|
+
receiptItemContent += `
|
|
683
|
+
<tr>
|
|
684
|
+
<td class="tm_width_3">${i + 1}. ${documentItem.Name}</td>
|
|
685
|
+
<td class="tm_width_4">
|
|
686
|
+
${documentItem.Description}
|
|
687
|
+
</td>
|
|
688
|
+
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice}</td>
|
|
689
|
+
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
690
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${+documentItem.UnitPrice * +documentItem.Quantity}</td>
|
|
691
|
+
</tr>
|
|
656
692
|
`;
|
|
657
693
|
});
|
|
658
694
|
const receiptDocumentItemHandle = await page.$('.tm_items_content');
|
|
659
695
|
await receiptDocumentItemHandle.evaluate((receipt, receiptItemContent) => {
|
|
660
696
|
receipt.innerHTML = receiptItemContent;
|
|
661
697
|
}, receiptItemContent);
|
|
662
|
-
const receiptFooterContent = `
|
|
663
|
-
<p class="tm_mb5 tm_text_center tm_f11">
|
|
664
|
-
<i>
|
|
665
|
-
Thank you for your payment. This is computer generated receipt
|
|
666
|
-
- no signature is required.
|
|
667
|
-
</i>
|
|
668
|
-
</p>
|
|
698
|
+
const receiptFooterContent = `
|
|
699
|
+
<p class="tm_mb5 tm_text_center tm_f11">
|
|
700
|
+
<i>
|
|
701
|
+
Thank you for your payment. This is computer generated receipt
|
|
702
|
+
- no signature is required.
|
|
703
|
+
</i>
|
|
704
|
+
</p>
|
|
669
705
|
`;
|
|
670
706
|
const receiptFooterHandle = await page.$('.tm_footer_section');
|
|
671
707
|
await receiptFooterHandle.evaluate((receipt, receiptFooterContent) => {
|
|
@@ -721,7 +757,7 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
721
757
|
Description: `HTML ${this.DocType}`,
|
|
722
758
|
IsEncryptedYN: 'N',
|
|
723
759
|
};
|
|
724
|
-
const user = new login_user_1.LoginUser(userId
|
|
760
|
+
const user = new login_user_1.LoginUser(userId ?? 'System', null, null);
|
|
725
761
|
const HTMLInvoiceMedia = await media.postInternal(await Document.DEFAULT_INVOICE_TEMPLATE_HTML(), htmlPayload, user, dbTransaction);
|
|
726
762
|
const pdfPayload = {
|
|
727
763
|
ObjectId: this.DocNo,
|
|
@@ -742,7 +778,7 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
742
778
|
}
|
|
743
779
|
async generateReceipt(userId, customer, transaction, date) {
|
|
744
780
|
const media = new media_1.Medias(this.mediaCommonService);
|
|
745
|
-
const user = new login_user_1.LoginUser(userId
|
|
781
|
+
const user = new login_user_1.LoginUser(userId ?? 'System', null, null);
|
|
746
782
|
const htmlPayload = {
|
|
747
783
|
ObjectId: this.DocNo,
|
|
748
784
|
ObjectType: 'Document',
|
|
@@ -797,7 +833,6 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
797
833
|
});
|
|
798
834
|
}
|
|
799
835
|
static async findAll(loginUser, dbTransaction, page, row, search, order, accountingSystem) {
|
|
800
|
-
var _a;
|
|
801
836
|
try {
|
|
802
837
|
const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
|
|
803
838
|
const isPrivileged = await loginUser.checkPrivileges(systemCode, 'Invoice - View');
|
|
@@ -809,49 +844,65 @@ class Document extends account_system_entity_1.AccountSystemEntity {
|
|
|
809
844
|
order: [['CreatedAt', 'DESC']],
|
|
810
845
|
};
|
|
811
846
|
const searchObj = {};
|
|
812
|
-
if (search
|
|
847
|
+
if (search?.DocNo) {
|
|
813
848
|
searchObj.DocNo = search.DocNo;
|
|
814
849
|
}
|
|
815
|
-
if (search
|
|
850
|
+
if (search?.DocType) {
|
|
816
851
|
searchObj.DocType = search.DocType;
|
|
817
852
|
}
|
|
818
|
-
if (search
|
|
819
|
-
searchObj.DocDate =
|
|
853
|
+
if (search?.StartDate) {
|
|
854
|
+
searchObj.DocDate = {
|
|
855
|
+
...searchObj.DocDate,
|
|
856
|
+
[sequelize_1.Op.gte]: new Date(search.StartDate).toISOString(),
|
|
857
|
+
};
|
|
820
858
|
}
|
|
821
|
-
if (search
|
|
822
|
-
searchObj.DocDate =
|
|
859
|
+
if (search?.EndDate) {
|
|
860
|
+
searchObj.DocDate = {
|
|
861
|
+
...searchObj.DocDate,
|
|
862
|
+
[sequelize_1.Op.lte]: new Date(search.EndDate).toISOString(),
|
|
863
|
+
};
|
|
823
864
|
}
|
|
824
|
-
if (search
|
|
865
|
+
if (search?.IssuedToId) {
|
|
825
866
|
searchObj.IssuedToId = search.IssuedToId;
|
|
826
867
|
}
|
|
827
|
-
if (search
|
|
868
|
+
if (search?.IssuedToType) {
|
|
828
869
|
searchObj.IssuedToType = search.IssuedToType;
|
|
829
870
|
}
|
|
830
|
-
if (search
|
|
871
|
+
if (search?.Status) {
|
|
831
872
|
searchObj.Status = search.Status;
|
|
832
873
|
}
|
|
833
|
-
if (search
|
|
874
|
+
if (search?.RelatedObjectId) {
|
|
834
875
|
searchObj.RelatedObjectId = search.RelatedObjectId;
|
|
835
876
|
}
|
|
836
|
-
if (search
|
|
877
|
+
if (search?.RelatedObjectType) {
|
|
837
878
|
searchObj.RelatedObjectType = search.RelatedObjectType;
|
|
838
879
|
}
|
|
839
|
-
if (search
|
|
880
|
+
if (search?.Description) {
|
|
840
881
|
searchObj.Description = search.Description;
|
|
841
882
|
}
|
|
842
883
|
if (page && row) {
|
|
843
|
-
options =
|
|
884
|
+
options = {
|
|
885
|
+
...options,
|
|
886
|
+
limit: row,
|
|
887
|
+
offset: row * (page - 1),
|
|
888
|
+
};
|
|
844
889
|
}
|
|
845
890
|
if (order) {
|
|
846
|
-
options =
|
|
891
|
+
options = {
|
|
892
|
+
...options,
|
|
893
|
+
order: order,
|
|
894
|
+
};
|
|
847
895
|
}
|
|
848
896
|
if (Object.keys(searchObj).length) {
|
|
849
|
-
options =
|
|
897
|
+
options = {
|
|
898
|
+
...options,
|
|
899
|
+
where: searchObj,
|
|
900
|
+
};
|
|
850
901
|
}
|
|
851
902
|
let documents = await Document._RepositoryBase.findAllWithPagination(options);
|
|
852
903
|
let isChangesExit = false;
|
|
853
|
-
for (let i = 0; i <
|
|
854
|
-
const doc = await
|
|
904
|
+
for (let i = 0; i < documents?.rows?.length; i++) {
|
|
905
|
+
const doc = await documents?.rows[i];
|
|
855
906
|
if (doc.UseAccSystemDocYN.toLowerCase() === 'y') {
|
|
856
907
|
console.log(doc.UseAccSystemDocYN.toLowerCase());
|
|
857
908
|
if (accountingSystem === null || accountingSystem === undefined) {
|