@tomei/finance 0.6.56 → 0.6.58
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/document/document.js +4 -4
- package/dist/document/document.js.map +1 -1
- package/dist/enum/collect-payment-type.d.ts +4 -0
- package/dist/enum/collect-payment-type.js +9 -0
- package/dist/enum/collect-payment-type.js.map +1 -0
- package/dist/finance-company/finance-company.d.ts +3 -2
- package/dist/finance-company/finance-company.js +5 -4
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/document/document.ts +12 -16
- package/src/enum/collect-payment-type.ts +4 -0
- package/src/finance-company/finance-company.ts +5 -2
package/package.json
CHANGED
package/src/document/document.ts
CHANGED
|
@@ -497,13 +497,11 @@ export default class Document extends AccountSystemEntity {
|
|
|
497
497
|
<td class="tm_width_4">
|
|
498
498
|
${documentItem.Description}
|
|
499
499
|
</td>
|
|
500
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
501
|
-
|
|
502
|
-
}</td>
|
|
500
|
+
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice
|
|
501
|
+
}</td>
|
|
503
502
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
504
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
505
|
-
|
|
506
|
-
}</td>
|
|
503
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${+documentItem.UnitPrice * +documentItem.Quantity
|
|
504
|
+
}</td>
|
|
507
505
|
</tr>
|
|
508
506
|
`;
|
|
509
507
|
});
|
|
@@ -718,13 +716,11 @@ export default class Document extends AccountSystemEntity {
|
|
|
718
716
|
<td class="tm_width_4">
|
|
719
717
|
${documentItem.Description}
|
|
720
718
|
</td>
|
|
721
|
-
<td class="tm_width_2">${documentItem.Currency} ${
|
|
722
|
-
|
|
723
|
-
}</td>
|
|
719
|
+
<td class="tm_width_2">${documentItem.Currency} ${documentItem.UnitPrice
|
|
720
|
+
}</td>
|
|
724
721
|
<td class="tm_width_1">${documentItem.Quantity}</td>
|
|
725
|
-
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${
|
|
726
|
-
|
|
727
|
-
}</td>
|
|
722
|
+
<td class="tm_width_2 tm_text_right">${documentItem.Currency} ${+documentItem.UnitPrice * +documentItem.Quantity
|
|
723
|
+
}</td>
|
|
728
724
|
</tr>
|
|
729
725
|
`;
|
|
730
726
|
});
|
|
@@ -827,7 +823,7 @@ export default class Document extends AccountSystemEntity {
|
|
|
827
823
|
/* insert FileStream on htmlPayload */
|
|
828
824
|
const htmlPayload: InternalMediaDto = {
|
|
829
825
|
ObjectId: this.DocNo,
|
|
830
|
-
ObjectType:
|
|
826
|
+
ObjectType: 'Document',
|
|
831
827
|
Type: MediaType.Document,
|
|
832
828
|
FileName: `${this.DocType}-${this.DocNo}`,
|
|
833
829
|
FileStream: await Document.DEFAULT_INVOICE_TEMPLATE_HTML(),
|
|
@@ -849,7 +845,7 @@ export default class Document extends AccountSystemEntity {
|
|
|
849
845
|
/* insert FileStream on pdfPayload */
|
|
850
846
|
const pdfPayload: InternalMediaDto = {
|
|
851
847
|
ObjectId: this.DocNo,
|
|
852
|
-
ObjectType:
|
|
848
|
+
ObjectType: 'Document',
|
|
853
849
|
Type: MediaType.Document,
|
|
854
850
|
FileName: `${this.DocType}-${this.DocNo}`,
|
|
855
851
|
FileStream: await this.DEFAULT_INVOICE_TEMPLATE_PDF(customer),
|
|
@@ -916,7 +912,7 @@ export default class Document extends AccountSystemEntity {
|
|
|
916
912
|
/* insert FileStream on htmlPayload */
|
|
917
913
|
const htmlPayload: InternalMediaDto = {
|
|
918
914
|
ObjectId: this.DocNo,
|
|
919
|
-
ObjectType:
|
|
915
|
+
ObjectType: 'Document',
|
|
920
916
|
Type: MediaType.Document,
|
|
921
917
|
FileName: `${this.DocType}-${this.DocNo}`,
|
|
922
918
|
FileStream: await Document.DEFAULT_INVOICE_TEMPLATE_HTML(),
|
|
@@ -937,7 +933,7 @@ export default class Document extends AccountSystemEntity {
|
|
|
937
933
|
/* insert FileStream on pdfPayload */
|
|
938
934
|
const pdfPayload: InternalMediaDto = {
|
|
939
935
|
ObjectId: this.DocNo,
|
|
940
|
-
ObjectType:
|
|
936
|
+
ObjectType: 'Document',
|
|
941
937
|
Type: MediaType.Document,
|
|
942
938
|
FileName: `${this.DocType}-${this.DocNo}`,
|
|
943
939
|
FileStream: await this.DEFAULT_RECEIPT_TEMPLATE_PDF(customer),
|
|
@@ -40,6 +40,7 @@ import { ActionEnum, Activity } from '@tomei/activity-history';
|
|
|
40
40
|
import { ApplicationConfig } from '@tomei/config';
|
|
41
41
|
import { TaxRepository } from '../tax/tax.repository';
|
|
42
42
|
import { Tax } from '../tax/tax';
|
|
43
|
+
import { CollectPaymentType } from '../enum/collect-payment-type';
|
|
43
44
|
|
|
44
45
|
export default class FinanceCompany extends ObjectBase {
|
|
45
46
|
private _CompanyId = 'New';
|
|
@@ -1183,6 +1184,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1183
1184
|
dbTransaction: any,
|
|
1184
1185
|
loginUser: LoginUserBase,
|
|
1185
1186
|
payment: Payment,
|
|
1187
|
+
collectPaymentType: CollectPaymentType = CollectPaymentType.AUTOMATIC,
|
|
1186
1188
|
): Promise<Payment> {
|
|
1187
1189
|
try {
|
|
1188
1190
|
/*validation 1: Make sure that the payment has at least 1 payment item*/
|
|
@@ -1215,7 +1217,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1215
1217
|
Description: payment.Description,
|
|
1216
1218
|
Currency: payment.Currency,
|
|
1217
1219
|
Amount: payment.Amount,
|
|
1218
|
-
Status: PaymentStatus.PENDING,
|
|
1220
|
+
Status: collectPaymentType === CollectPaymentType.AUTOMATIC ? PaymentStatus.CONFIRMED : PaymentStatus.PENDING,
|
|
1219
1221
|
PostedToAccSystemYN: 'N',
|
|
1220
1222
|
ReceivedBy: payment.ReceivedBy,
|
|
1221
1223
|
IssuedBy: payment.IssuedBy,
|
|
@@ -1731,6 +1733,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1731
1733
|
Amount: number;
|
|
1732
1734
|
}[],
|
|
1733
1735
|
receiptNo?: string,
|
|
1736
|
+
collectPaymentType: CollectPaymentType = CollectPaymentType.AUTOMATIC,
|
|
1734
1737
|
): Promise<Payment> {
|
|
1735
1738
|
//Method to collect payment for multiple customer.
|
|
1736
1739
|
try {
|
|
@@ -1809,7 +1812,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1809
1812
|
Description: payment.Description,
|
|
1810
1813
|
Currency: payment.Currency,
|
|
1811
1814
|
Amount: payment.Amount,
|
|
1812
|
-
Status: PaymentStatus.PENDING,
|
|
1815
|
+
Status: collectPaymentType === CollectPaymentType.MANUAL ? PaymentStatus.PENDING : PaymentStatus.CONFIRMED,
|
|
1813
1816
|
PostedToAccSystemYN: 'N',
|
|
1814
1817
|
ReceivedBy: payment.ReceivedBy,
|
|
1815
1818
|
IssuedBy: payment.IssuedBy,
|