@tomei/finance 0.3.63 → 0.3.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.3.63",
3
+ "version": "0.3.65",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -603,12 +603,17 @@ export default class FinanceCompany extends ObjectBase {
603
603
 
604
604
  for (let i = 0; i < savedItems.length; i++) {
605
605
  const journalEntry = new JournalEntry(dbTransaction);
606
+ //Temporary fix to successfully save journal entry in PostJournal
607
+ journalEntry.init({
608
+ CompanyId: this.CompanyId,
609
+ Name: 'Issue Invoice ' + invoice.DocNo,
610
+ });
606
611
  const account = await Account.initAccount(
607
612
  dbTransaction,
608
- savedItems[i].key,
613
+ savedItems[i].value[0],
609
614
  );
610
- const creditAmount = savedItems[i].value;
611
- const currency = htCreditAccountCurrency.get(savedItems[i].key);
615
+ const creditAmount = savedItems[i].value[1];
616
+ const currency = htCreditAccountCurrency.get(savedItems[i].value[0]);
612
617
 
613
618
  const dt = await journalEntry.newLedgerTransaction(
614
619
  TransactionTypeOptions.DEBIT,
@@ -806,12 +811,17 @@ export default class FinanceCompany extends ObjectBase {
806
811
 
807
812
  for (let i = 0; i < savedItems.length; i++) {
808
813
  const journalEntry = new JournalEntry(dbTransaction);
814
+ //Temporary fix to successfully save journal entry in PostJournal
815
+ journalEntry.init({
816
+ CompanyId: this.CompanyId,
817
+ Name: 'issue Invoice ' + invoice.DocNo,
818
+ });
809
819
  const account = await Account.initAccount(
810
820
  dbTransaction,
811
- savedItems[i].key,
821
+ savedItems[i].value[0],
812
822
  );
813
- const creditAmount = savedItems[i].value;
814
- const currency = htCreditAccountCurrency.get(savedItems[i].key);
823
+ const creditAmount = savedItems[i].value[1];
824
+ const currency = htCreditAccountCurrency.get(savedItems[i].value[0]);
815
825
 
816
826
  const dt = await journalEntry.newLedgerTransaction(
817
827
  TransactionTypeOptions.DEBIT,
@@ -978,6 +988,12 @@ export default class FinanceCompany extends ObjectBase {
978
988
  }
979
989
 
980
990
  const journalEntry = new JournalEntry(dbTransaction);
991
+ //Temporary fix to successfully save journal entry in PostJournal
992
+ journalEntry.init({
993
+ CompanyId: this.CompanyId,
994
+ Name: 'Issue Debit Note ' + creditNote.DocNo,
995
+ });
996
+
981
997
  const transactionDate = new Date();
982
998
 
983
999
  const creditTransaction = await journalEntry.newLedgerTransaction(