payservedb 5.3.3 → 5.3.4

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": "payservedb",
3
- "version": "5.3.3",
3
+ "version": "5.3.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,5 +1,4 @@
1
1
  const mongoose = require('mongoose');
2
-
3
2
  // Define the schema for ValueAddedServices
4
3
  const valueAddedServiceSchema = new mongoose.Schema({
5
4
  facilityId: {
@@ -27,11 +26,55 @@ const valueAddedServiceSchema = new mongoose.Schema({
27
26
  },
28
27
  taxName: String,
29
28
  taxRate: Number
30
- }]
29
+ }],
30
+ // GL Account configurations
31
+ invoiceDoubleEntryAccount: {
32
+ type: mongoose.Schema.Types.ObjectId,
33
+ ref: 'GLAccountDoubleEntries'
34
+ },
35
+ paymentDoubleEntryAccount: {
36
+ type: mongoose.Schema.Types.ObjectId,
37
+ ref: 'GLAccountDoubleEntries'
38
+ },
39
+ taxDoubleEntryAccount: {
40
+ type: mongoose.Schema.Types.ObjectId,
41
+ ref: 'GLAccountDoubleEntries'
42
+ },
43
+ // GL Account direct configurations (used when creating double entry records)
44
+ glAccounts: {
45
+ invoice: {
46
+ debit: {
47
+ type: mongoose.Schema.Types.ObjectId,
48
+ ref: 'GLAccount'
49
+ },
50
+ credit: {
51
+ type: mongoose.Schema.Types.ObjectId,
52
+ ref: 'GLAccount'
53
+ }
54
+ },
55
+ payment: {
56
+ debit: {
57
+ type: mongoose.Schema.Types.ObjectId,
58
+ ref: 'GLAccount'
59
+ },
60
+ credit: {
61
+ type: mongoose.Schema.Types.ObjectId,
62
+ ref: 'GLAccount'
63
+ }
64
+ },
65
+ tax: {
66
+ debit: {
67
+ type: mongoose.Schema.Types.ObjectId,
68
+ ref: 'GLAccount'
69
+ },
70
+ credit: {
71
+ type: mongoose.Schema.Types.ObjectId,
72
+ ref: 'GLAccount'
73
+ }
74
+ }
75
+ }
31
76
  }, {
32
77
  timestamps: true
33
78
  });
34
-
35
79
  const ValueAddedService = mongoose.model('ValueAddedService', valueAddedServiceSchema);
36
-
37
80
  module.exports = ValueAddedService;
@@ -139,7 +139,40 @@ const vasInvoiceSchema = new mongoose.Schema({
139
139
  overpay: {
140
140
  type: Number,
141
141
  default: 0
142
- }
142
+ },
143
+ // GL Integration Fields
144
+ invoiceGLEntryId: {
145
+ type: mongoose.Schema.Types.ObjectId,
146
+ ref: 'GLEntry'
147
+ },
148
+ taxGLEntryId: {
149
+ type: mongoose.Schema.Types.ObjectId,
150
+ ref: 'GLEntry'
151
+ },
152
+ glDoubleEntryId: {
153
+ type: mongoose.Schema.Types.ObjectId,
154
+ ref: 'GLAccountDoubleEntries'
155
+ },
156
+ // Tax GL details
157
+ taxDetails: [{
158
+ taxId: {
159
+ type: mongoose.Schema.Types.ObjectId,
160
+ ref: 'CountryTaxRate'
161
+ },
162
+ taxName: {
163
+ type: String
164
+ },
165
+ taxRate: {
166
+ type: Number
167
+ },
168
+ taxAmount: {
169
+ type: Number
170
+ },
171
+ glEntryId: {
172
+ type: mongoose.Schema.Types.ObjectId,
173
+ ref: 'GLEntry'
174
+ }
175
+ }]
143
176
  }, {
144
177
  timestamps: true
145
178
  });