diff --git a/db/changes/240601/00-cloneAcl.sql b/db/changes/240601/00-cloneAcl.sql new file mode 100644 index 000000000..bc6e22ee0 --- /dev/null +++ b/db/changes/240601/00-cloneAcl.sql @@ -0,0 +1,4 @@ +UPDATE salix.ACL + SET property='clone' + WHERE model = 'Sale' + AND property = 'refund' \ No newline at end of file diff --git a/modules/ticket/back/methods/sale/clone.js b/modules/ticket/back/methods/sale/clone.js index 8397499f7..77c40d8a0 100644 --- a/modules/ticket/back/methods/sale/clone.js +++ b/modules/ticket/back/methods/sale/clone.js @@ -23,8 +23,8 @@ module.exports = Self => { root: true }, http: { - path: `/refund`, - verb: 'post' + path: `/clone`, + verb: 'POST' } }); Self.clone = async(ctx, salesIds, servicesIds, withWarehouse, negative, options) => { diff --git a/modules/ticket/back/methods/ticket/refund.js b/modules/ticket/back/methods/ticket/refund.js index b07995453..7365f34df 100644 --- a/modules/ticket/back/methods/ticket/refund.js +++ b/modules/ticket/back/methods/ticket/refund.js @@ -20,7 +20,7 @@ module.exports = Self => { }, http: { path: `/refund`, - verb: 'post' + verb: 'POST' } }); diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index ed6d9b10a..ce6aad5ed 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -524,7 +524,7 @@ class Controller extends Section { const salesIds = sales.map(sale => sale.id); const params = {salesIds: salesIds, withWarehouse: withWarehouse}; - const query = 'Sales/refund'; + const query = 'Sales/clone'; this.$http.post(query, params).then(res => { const [refundTicket] = res.data; this.vnApp.showSuccess(this.$t('The following refund ticket have been created', { diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index 36be32f52..6b1da108e 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -729,7 +729,7 @@ describe('Ticket', () => { salesIds: [1, 4], }; const refundTicket = {id: 99}; - $httpBackend.expect('POST', 'Sales/refund', params).respond(200, [refundTicket]); + $httpBackend.expect('POST', 'Sales/clone', params).respond(200, [refundTicket]); controller.createRefund(); $httpBackend.flush(); diff --git a/modules/ticket/front/services/index.js b/modules/ticket/front/services/index.js index d8c209ea4..08a76f9ba 100644 --- a/modules/ticket/front/services/index.js +++ b/modules/ticket/front/services/index.js @@ -56,7 +56,7 @@ class Controller extends Section { if (!this.checkeds.length) return; const params = {servicesIds: this.checkeds, withWarehouse: false}; - const query = 'Sales/refund'; + const query = 'Sales/clone'; this.$http.post(query, params).then(res => { const refundTicket = res.data; this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {