@tomei/finance 0.3.21 → 0.3.23
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/finance-company/finance-company.js +6 -5
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +4 -4
- package/dist/journal-entry/journal-entry.js +17 -8
- package/dist/journal-entry/journal-entry.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/finance-company/finance-company.ts +6 -5
- package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +4 -4
- package/src/journal-entry/journal-entry.ts +9 -8
package/package.json
CHANGED
|
@@ -923,17 +923,17 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
923
923
|
}
|
|
924
924
|
|
|
925
925
|
creditTransaction.Currency = creditNote.Currency;
|
|
926
|
-
creditTransaction.
|
|
926
|
+
creditTransaction.CreditAmount = creditNote.Amount;
|
|
927
927
|
creditTransaction.Date = transactionDate;
|
|
928
928
|
creditTransaction.Name = creditNote.DocNo;
|
|
929
929
|
|
|
930
930
|
for (const invoiceItem of documentItems) {
|
|
931
931
|
const itemLedger = await journalEntry.newLedgerTransaction(
|
|
932
|
-
TransactionTypeOptions.
|
|
932
|
+
TransactionTypeOptions.DEBIT,
|
|
933
933
|
);
|
|
934
934
|
itemLedger.AccountNo = invoiceItem.CtAccountNo;
|
|
935
935
|
itemLedger.Currency = invoiceItem.Currency;
|
|
936
|
-
itemLedger.
|
|
936
|
+
itemLedger.DebitAmount = invoiceItem.Amount;
|
|
937
937
|
itemLedger.Date = transactionDate;
|
|
938
938
|
itemLedger.Name = invoiceItem.Name;
|
|
939
939
|
}
|
|
@@ -1034,6 +1034,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1034
1034
|
});
|
|
1035
1035
|
|
|
1036
1036
|
const journalEntry = new JournalEntry(dbTransaction);
|
|
1037
|
+
journalEntry.init({ CompanyId: this.CompanyId });
|
|
1037
1038
|
const transactionDate = new Date();
|
|
1038
1039
|
|
|
1039
1040
|
const debitLT = await journalEntry.newLedgerTransaction(
|
|
@@ -1041,7 +1042,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1041
1042
|
);
|
|
1042
1043
|
debitLT.AccountNo = paymentMethodType.AccountNo;
|
|
1043
1044
|
debitLT.Currency = payment.Currency;
|
|
1044
|
-
debitLT.
|
|
1045
|
+
debitLT.DebitAmount = payment.Amount;
|
|
1045
1046
|
debitLT.Date = transactionDate;
|
|
1046
1047
|
debitLT.Name = customer.FullName;
|
|
1047
1048
|
|
|
@@ -1056,7 +1057,7 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
1056
1057
|
creditLT.AccountNo = customer.CustSystemCode + '-AR';
|
|
1057
1058
|
}
|
|
1058
1059
|
creditLT.Currency = payment.Currency;
|
|
1059
|
-
creditLT.
|
|
1060
|
+
creditLT.CreditAmount = payment.Amount;
|
|
1060
1061
|
creditLT.Date = transactionDate;
|
|
1061
1062
|
creditLT.Name = paymentMethodType.Name;
|
|
1062
1063
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface IJournalEntryAttr {
|
|
2
|
-
CompanyId
|
|
3
|
-
JournalEntryId
|
|
2
|
+
CompanyId?: string;
|
|
3
|
+
JournalEntryId?: string;
|
|
4
4
|
Date?: Date;
|
|
5
|
-
Name
|
|
5
|
+
Name?: string;
|
|
6
6
|
Description?: string;
|
|
7
7
|
AccSystemRefId?: string;
|
|
8
|
-
PostedToAccSystemYN
|
|
8
|
+
PostedToAccSystemYN?: string;
|
|
9
9
|
PostedById?: string;
|
|
10
10
|
PostedDateTime?: Date;
|
|
11
11
|
}
|
|
@@ -80,7 +80,7 @@ export default class JournalEntry extends AccountSystemEntity {
|
|
|
80
80
|
} else {
|
|
81
81
|
this.init({
|
|
82
82
|
JournalEntryId: cuid(),
|
|
83
|
-
CompanyId:
|
|
83
|
+
CompanyId: '',
|
|
84
84
|
Date: new Date(),
|
|
85
85
|
Name: '',
|
|
86
86
|
Description: '',
|
|
@@ -214,13 +214,14 @@ export default class JournalEntry extends AccountSystemEntity {
|
|
|
214
214
|
// }
|
|
215
215
|
|
|
216
216
|
init(params: IJournalEntryAttr) {
|
|
217
|
-
this.JournalEntryId = params.JournalEntryId;
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
221
|
-
this.
|
|
222
|
-
this.
|
|
223
|
-
this.
|
|
217
|
+
if(params.JournalEntryId) this.JournalEntryId = params.JournalEntryId;
|
|
218
|
+
if(params.CompanyId) this.CompanyId = params.CompanyId;
|
|
219
|
+
if(params.Date) this.Date = params.Date;
|
|
220
|
+
if(params.Name) this.Name = params.Name;
|
|
221
|
+
if(params.Description) this.Description = params.Description;
|
|
222
|
+
if(params.PostedById) this.PostedById = params.PostedById;
|
|
223
|
+
if(params.PostedToAccSystemYN) this.PostedToAccSystemYN = params.PostedToAccSystemYN;
|
|
224
|
+
if(params.PostedDateTime) this.PostedDateTime = params.PostedDateTime;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
getData() {
|