tango-app-api-payment-subscription 3.4.1 → 3.4.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-payment-subscription",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"description": "paymentSubscription",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"nodemon": "^3.1.0",
|
|
27
27
|
"swagger-ui-express": "^5.0.0",
|
|
28
28
|
"tango-api-schema": "^2.5.73",
|
|
29
|
-
"tango-app-api-middleware": "^3.
|
|
29
|
+
"tango-app-api-middleware": "^3.6.18",
|
|
30
30
|
"winston": "^3.12.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -147,6 +147,10 @@ export async function createInvoice( req, res ) {
|
|
|
147
147
|
dueDate: dueDate,
|
|
148
148
|
advanceInvoice: group.advanceInvoice || false,
|
|
149
149
|
};
|
|
150
|
+
|
|
151
|
+
if ( req.body.invoiceId ) {
|
|
152
|
+
await invoiceService.deleteRecord( { invoice: req.body.invoiceId } );
|
|
153
|
+
}
|
|
150
154
|
if ( req.body.invoiceId ) {
|
|
151
155
|
let logObj = {
|
|
152
156
|
userName: req.user?.userName,
|
|
@@ -222,7 +226,7 @@ export async function invoiceDownload( req, res ) {
|
|
|
222
226
|
} );
|
|
223
227
|
|
|
224
228
|
|
|
225
|
-
let invoiceDate = dayjs( invoiceInfo.
|
|
229
|
+
let invoiceDate = dayjs( invoiceInfo.billingDate ).format( 'DD/MM/YYYY' );
|
|
226
230
|
|
|
227
231
|
invoiceInfo.totalAmount = Math.round( invoiceInfo.totalAmount );
|
|
228
232
|
let AmountinWords = inWords( invoiceInfo.totalAmount );
|
|
@@ -1688,10 +1692,18 @@ export async function updateInvoice( req, res ) {
|
|
|
1688
1692
|
|
|
1689
1693
|
allowedFields.forEach( ( field ) => {
|
|
1690
1694
|
if ( req.body[field] !== undefined ) {
|
|
1691
|
-
|
|
1695
|
+
if ( field === 'billingDate' || field === 'dueDate' ) {
|
|
1696
|
+
updateData[field] = new Date( req.body[field] );
|
|
1697
|
+
} else {
|
|
1698
|
+
updateData[field] = req.body[field];
|
|
1699
|
+
}
|
|
1692
1700
|
}
|
|
1693
1701
|
} );
|
|
1694
1702
|
|
|
1703
|
+
if ( req.body.billingDate ) {
|
|
1704
|
+
updateData.createdAt = new Date( req.body.billingDate );
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1695
1707
|
let updatedInvoice = await invoiceService.updateOne( { _id: req.body._id }, updateData );
|
|
1696
1708
|
|
|
1697
1709
|
let logObj = {
|