payservedb 4.9.2 → 4.9.3
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 +1 -1
- package/src/models/gl_accounts.js +4 -0
- package/src/models/invoice.js +19 -4
package/package.json
CHANGED
package/src/models/invoice.js
CHANGED
|
@@ -102,7 +102,7 @@ const invoiceSchema = new mongoose.Schema(
|
|
|
102
102
|
status: {
|
|
103
103
|
type: String,
|
|
104
104
|
required: true,
|
|
105
|
-
enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid"],
|
|
105
|
+
enum: ["Unpaid", "Pending", "Paid", "Overdue", "Cancelled", "Partially Paid", "Void"],
|
|
106
106
|
},
|
|
107
107
|
penalty: {
|
|
108
108
|
type: Number,
|
|
@@ -116,13 +116,28 @@ const invoiceSchema = new mongoose.Schema(
|
|
|
116
116
|
type: String,
|
|
117
117
|
default: null,
|
|
118
118
|
},
|
|
119
|
-
// Enhanced balanceBroughtForward field
|
|
120
|
-
// Positive values = customer owes money
|
|
121
|
-
// Negative values = credit (previously tracked in overpay field)
|
|
122
119
|
balanceBroughtForward: {
|
|
123
120
|
type: Number,
|
|
124
121
|
default: 0,
|
|
125
122
|
},
|
|
123
|
+
voidMetadata: {
|
|
124
|
+
voidedBy: {
|
|
125
|
+
userId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
|
126
|
+
name: { type: String },
|
|
127
|
+
role: { type: String }
|
|
128
|
+
},
|
|
129
|
+
voidedAt: { type: Date },
|
|
130
|
+
reason: { type: String }
|
|
131
|
+
},
|
|
132
|
+
cancelMetadata: {
|
|
133
|
+
cancelledBy: {
|
|
134
|
+
userId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
|
135
|
+
name: { type: String },
|
|
136
|
+
role: { type: String }
|
|
137
|
+
},
|
|
138
|
+
cancelledAt: { type: Date },
|
|
139
|
+
reason: { type: String }
|
|
140
|
+
},
|
|
126
141
|
lastReminderSent: Date,
|
|
127
142
|
reminderHistory: [
|
|
128
143
|
{
|