@tomei/finance 0.3.78 → 0.3.80

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.
@@ -6,6 +6,7 @@ module.exports = {
6
6
  PaymentId: {
7
7
  type: Sequelize.STRING(30),
8
8
  allowNull: false,
9
+ primaryKey: true,
9
10
  references: {
10
11
  model: 'finance_Payment',
11
12
  key: 'PaymentId',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.3.78",
3
+ "version": "0.3.80",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -132,9 +132,10 @@ export default class Document extends AccountSystemEntity {
132
132
  this._DbTransaction = dbTransaction;
133
133
  }
134
134
  if (docNo) {
135
+ this.DocNo = docNo;
135
136
  this.RepositoryBase.findOne({
136
137
  where: {
137
- DocNo: docNo,
138
+ DocNo: this.DocNo,
138
139
  },
139
140
  transaction: dbTransaction,
140
141
  })
@@ -1118,7 +1118,7 @@ export default class FinanceCompany extends ObjectBase {
1118
1118
  { transaction: dbTransaction },
1119
1119
  );
1120
1120
 
1121
- paymentItems.forEach(async (paymentItem) => {
1121
+ for (const paymentItem of paymentItems) {
1122
1122
  await FinanceCompany._PaymentItemRepository.create(
1123
1123
  {
1124
1124
  PaymentId: payment.PaymentId,
@@ -1131,9 +1131,9 @@ export default class FinanceCompany extends ObjectBase {
1131
1131
  },
1132
1132
  { transaction: dbTransaction },
1133
1133
  );
1134
- });
1134
+ }
1135
1135
 
1136
- paymentPaidWithItems.forEach(async (paymentPaidWithItem) => {
1136
+ for (const paymentPaidWithItem of paymentPaidWithItems) {
1137
1137
  await FinanceCompany._PaymentPaidWithRepository.create(
1138
1138
  {
1139
1139
  PaymentId: payment.PaymentId,
@@ -1151,7 +1151,7 @@ export default class FinanceCompany extends ObjectBase {
1151
1151
  },
1152
1152
  { transaction: dbTransaction },
1153
1153
  );
1154
- });
1154
+ }
1155
1155
 
1156
1156
  /*Registering the Journal Entries for the transaction*/
1157
1157
  const transactionDate = new Date();
@@ -12,6 +12,7 @@ import PaymentModel from './payment.entity';
12
12
  export default class PaymentItemModel extends Model {
13
13
  @ForeignKey(() => PaymentModel)
14
14
  @Column({
15
+ primaryKey: true,
15
16
  allowNull: false,
16
17
  type: DataType.STRING(30),
17
18
  })
@@ -185,7 +185,7 @@ export default class Payment extends AccountSystemEntity {
185
185
  reject(err);
186
186
  });
187
187
  }
188
- resolve(this._PaymentItems);
188
+ resolve(this._PaymentPaidWith);
189
189
  });
190
190
  }
191
191