This commit is contained in:
parent
e5d466b697
commit
4fc780967f
|
@ -0,0 +1,4 @@
|
|||
UPDATE salix.ACL
|
||||
SET property='clone'
|
||||
WHERE model = 'Sale'
|
||||
AND property = 'refund'
|
|
@ -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) => {
|
||||
|
|
|
@ -20,7 +20,7 @@ module.exports = Self => {
|
|||
},
|
||||
http: {
|
||||
path: `/refund`,
|
||||
verb: 'post'
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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', {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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', {
|
||||
|
|
Loading…
Reference in New Issue