payservedb 8.3.3 → 8.3.5

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": "8.3.3",
3
+ "version": "8.3.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -89,10 +89,26 @@ const FacilityInvoiceSchema = new mongoose.Schema(
89
89
  },
90
90
  },
91
91
  ],
92
+ // Subtotal of all invoice items before tax and balance
93
+ subtotal: {
94
+ type: Number,
95
+ required: true,
96
+ min: [0, "Subtotal cannot be negative"],
97
+ default: 0,
98
+ },
99
+ balanceBroughtForward: {
100
+ type: Number,
101
+ default: 0,
102
+ },
103
+ // Tax amount calculated on subtotal
104
+ taxAmount: {
105
+ type: Number,
106
+ default: 0,
107
+ min: [0, "Tax amount cannot be negative"],
108
+ },
92
109
  amount: {
93
110
  type: Number,
94
111
  required: true,
95
- min: [0, "Total amount cannot be negative"],
96
112
  },
97
113
  taxRate: {
98
114
  type: Number,