Merge pull request '5252-canRefund_withOutWarehouse2' (!1567) from 5252-canRefund_withOutWarehouse2 into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1567 Reviewed-by: Alex Moreno <alexm@verdnatura.es> Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
commit
8b92b35e29
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE `vn`.`ticket` MODIFY COLUMN warehouseFk smallint(6) unsigned DEFAULT NULL NULL;
|
|
@ -595,6 +595,8 @@ export default {
|
||||||
moreMenuUpdateDiscount: 'vn-item[name="discount"]',
|
moreMenuUpdateDiscount: 'vn-item[name="discount"]',
|
||||||
moreMenuRecalculatePrice: 'vn-item[name="calculatePrice"]',
|
moreMenuRecalculatePrice: 'vn-item[name="calculatePrice"]',
|
||||||
moreMenuRefund: 'vn-item[name="refund"]',
|
moreMenuRefund: 'vn-item[name="refund"]',
|
||||||
|
refundWithWarehouse: 'vn-item[name="refundWithWarehouse"]',
|
||||||
|
refundWithoutWarehouse: 'vn-item[name="refundWithoutWarehouse"]',
|
||||||
moreMenuUpdateDiscountInput: 'vn-input-number[ng-model="$ctrl.edit.discount"] input',
|
moreMenuUpdateDiscountInput: 'vn-input-number[ng-model="$ctrl.edit.discount"] input',
|
||||||
transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text',
|
transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text',
|
||||||
transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable',
|
transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable',
|
||||||
|
|
|
@ -220,14 +220,25 @@ describe('Ticket Edit sale path', () => {
|
||||||
|
|
||||||
it('should log in as salesAssistant and navigate to ticket sales', async() => {
|
it('should log in as salesAssistant and navigate to ticket sales', async() => {
|
||||||
await page.loginAndModule('salesAssistant', 'ticket');
|
await page.loginAndModule('salesAssistant', 'ticket');
|
||||||
await page.accessToSearchResult('16');
|
await page.accessToSearchResult('17');
|
||||||
await page.accessToSection('ticket.card.sale');
|
await page.accessToSection('ticket.card.sale');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should select the third sale and create a refund', async() => {
|
it('should select the first sale and create a refund with warehouse', async() => {
|
||||||
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
|
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenu);
|
await page.waitToClick(selectors.ticketSales.moreMenu);
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenuRefund);
|
await page.waitToClick(selectors.ticketSales.moreMenuRefund);
|
||||||
|
await page.waitToClick(selectors.ticketSales.refundWithWarehouse);
|
||||||
|
await page.waitForSnackbar();
|
||||||
|
await page.waitForState('ticket.card.sale');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should select the first sale and create a refund without warehouse', async() => {
|
||||||
|
await page.accessToSearchResult('18');
|
||||||
|
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
|
||||||
|
await page.waitToClick(selectors.ticketSales.moreMenu);
|
||||||
|
await page.waitToClick(selectors.ticketSales.moreMenuRefund);
|
||||||
|
await page.waitToClick(selectors.ticketSales.refundWithoutWarehouse);
|
||||||
await page.waitForSnackbar();
|
await page.waitForSnackbar();
|
||||||
await page.waitForState('ticket.card.sale');
|
await page.waitForState('ticket.card.sale');
|
||||||
});
|
});
|
||||||
|
@ -246,7 +257,6 @@ describe('Ticket Edit sale path', () => {
|
||||||
it('should select the third sale and create a claim of it', async() => {
|
it('should select the third sale and create a claim of it', async() => {
|
||||||
await page.accessToSearchResult('16');
|
await page.accessToSearchResult('16');
|
||||||
await page.accessToSection('ticket.card.sale');
|
await page.accessToSection('ticket.card.sale');
|
||||||
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
|
|
||||||
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenu);
|
await page.waitToClick(selectors.ticketSales.moreMenu);
|
||||||
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
|
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
|
||||||
|
|
|
@ -2,11 +2,19 @@ module.exports = Self => {
|
||||||
Self.remoteMethod('refund', {
|
Self.remoteMethod('refund', {
|
||||||
description: 'Create refund tickets with sales and services if provided',
|
description: 'Create refund tickets with sales and services if provided',
|
||||||
accessType: 'WRITE',
|
accessType: 'WRITE',
|
||||||
accepts: [{
|
accepts: [
|
||||||
arg: 'ref',
|
{
|
||||||
type: 'string',
|
arg: 'ref',
|
||||||
description: 'The invoice reference'
|
type: 'string',
|
||||||
}],
|
description: 'The invoice reference',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'withWarehouse',
|
||||||
|
type: 'boolean',
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
],
|
||||||
returns: {
|
returns: {
|
||||||
type: ['number'],
|
type: ['number'],
|
||||||
root: true
|
root: true
|
||||||
|
@ -17,7 +25,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.refund = async(ref, options) => {
|
Self.refund = async(ref, withWarehouse, options) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
let tx;
|
let tx;
|
||||||
|
@ -35,7 +43,7 @@ module.exports = Self => {
|
||||||
const tickets = await models.Ticket.find(filter, myOptions);
|
const tickets = await models.Ticket.find(filter, myOptions);
|
||||||
|
|
||||||
const ticketsIds = tickets.map(ticket => ticket.id);
|
const ticketsIds = tickets.map(ticket => ticket.id);
|
||||||
const refundedTickets = await models.Ticket.refund(ticketsIds, myOptions);
|
const refundedTickets = await models.Ticket.refund(ticketsIds, withWarehouse, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('InvoiceOut refund()', () => {
|
describe('InvoiceOut refund()', () => {
|
||||||
const userId = 5;
|
const userId = 5;
|
||||||
|
const withWarehouse = true;
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
@ -15,7 +16,7 @@ describe('InvoiceOut refund()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await models.InvoiceOut.refund('T1111111', options);
|
const result = await models.InvoiceOut.refund('T1111111', withWarehouse, options);
|
||||||
|
|
||||||
expect(result).toBeDefined();
|
expect(result).toBeDefined();
|
||||||
|
|
||||||
|
|
|
@ -76,14 +76,27 @@
|
||||||
translate>
|
translate>
|
||||||
Show CITES letter
|
Show CITES letter
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item
|
<vn-item class="dropdown"
|
||||||
ng-click="refundConfirmation.show()"
|
vn-click-stop="refundMenu.show($event, 'left')"
|
||||||
name="refundInvoice"
|
|
||||||
vn-tooltip="Create a single ticket with all the content of the current invoice"
|
vn-tooltip="Create a single ticket with all the content of the current invoice"
|
||||||
vn-acl="invoicing, claimManager, salesAssistant"
|
vn-acl="invoicing, claimManager, salesAssistant"
|
||||||
vn-acl-action="remove"
|
vn-acl-action="remove"
|
||||||
translate>
|
translate>
|
||||||
Refund
|
Refund...
|
||||||
|
<vn-menu vn-id="refundMenu">
|
||||||
|
<vn-list>
|
||||||
|
<vn-item
|
||||||
|
ng-click="$ctrl.refundInvoiceOut(true)"
|
||||||
|
translate>
|
||||||
|
with warehouse
|
||||||
|
</vn-item>
|
||||||
|
<vn-item
|
||||||
|
ng-click="$ctrl.refundInvoiceOut(false)"
|
||||||
|
translate>
|
||||||
|
without warehouse
|
||||||
|
</vn-item>
|
||||||
|
</vn-list>
|
||||||
|
</vn-menu>
|
||||||
</vn-item>
|
</vn-item>
|
||||||
</vn-list>
|
</vn-list>
|
||||||
</vn-menu>
|
</vn-menu>
|
||||||
|
@ -97,12 +110,7 @@
|
||||||
on-accept="$ctrl.bookInvoiceOut()"
|
on-accept="$ctrl.bookInvoiceOut()"
|
||||||
question="Are you sure you want to book this invoice?">
|
question="Are you sure you want to book this invoice?">
|
||||||
</vn-confirm>
|
</vn-confirm>
|
||||||
<vn-confirm
|
<vn-client-descriptor-popover
|
||||||
vn-id="refundConfirmation"
|
|
||||||
on-accept="$ctrl.refundInvoiceOut()"
|
|
||||||
question="Are you sure you want to refund this invoice?">
|
|
||||||
</vn-confirm>
|
|
||||||
<vn-client-descriptor-popover
|
|
||||||
vn-id="clientDescriptor">
|
vn-id="clientDescriptor">
|
||||||
</vn-client-descriptor-popover>
|
</vn-client-descriptor-popover>
|
||||||
|
|
||||||
|
@ -148,4 +156,4 @@
|
||||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
<button response="accept" translate>Confirm</button>
|
<button response="accept" translate>Confirm</button>
|
||||||
</tpl-buttons>
|
</tpl-buttons>
|
||||||
</vn-dialog>
|
</vn-dialog>
|
||||||
|
|
|
@ -114,9 +114,9 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
refundInvoiceOut() {
|
refundInvoiceOut(withWarehouse) {
|
||||||
const query = 'InvoiceOuts/refund';
|
const query = 'InvoiceOuts/refund';
|
||||||
const params = {ref: this.invoiceOut.ref};
|
const params = {ref: this.invoiceOut.ref, withWarehouse: withWarehouse};
|
||||||
this.$http.post(query, params).then(res => {
|
this.$http.post(query, params).then(res => {
|
||||||
const refundTicket = res.data;
|
const refundTicket = res.data;
|
||||||
this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {
|
this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {
|
||||||
|
|
|
@ -13,10 +13,11 @@ InvoiceOut deleted: Factura eliminada
|
||||||
Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura?
|
Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura?
|
||||||
Are you sure you want to clone this invoice?: Estas seguro de clonar esta factura?
|
Are you sure you want to clone this invoice?: Estas seguro de clonar esta factura?
|
||||||
InvoiceOut booked: Factura asentada
|
InvoiceOut booked: Factura asentada
|
||||||
Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura?
|
Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura?
|
||||||
Are you sure you want to refund this invoice?: Estas seguro de querer abonar esta factura?
|
Are you sure you want to refund this invoice?: Estas seguro de querer abonar esta factura?
|
||||||
Create a single ticket with all the content of the current invoice: Crear un ticket unico con todo el contenido de la factura actual
|
Create a single ticket with all the content of the current invoice: Crear un ticket unico con todo el contenido de la factura actual
|
||||||
Regenerate PDF invoice: Regenerar PDF factura
|
Regenerate PDF invoice: Regenerar PDF factura
|
||||||
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
||||||
The email can't be empty: El correo no puede estar vacío
|
The email can't be empty: El correo no puede estar vacío
|
||||||
The following refund tickets have been created: "Se han creado los siguientes tickets de abono: {{ticketIds}}"
|
The following refund tickets have been created: "Se han creado los siguientes tickets de abono: {{ticketIds}}"
|
||||||
|
Refund...: Abono...
|
||||||
|
|
|
@ -11,6 +11,11 @@ module.exports = Self => {
|
||||||
{
|
{
|
||||||
arg: 'servicesIds',
|
arg: 'servicesIds',
|
||||||
type: ['number']
|
type: ['number']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'withWarehouse',
|
||||||
|
type: 'boolean',
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -23,7 +28,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.refund = async(salesIds, servicesIds, options) => {
|
Self.refund = async(salesIds, servicesIds, withWarehouse, options) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
let tx;
|
let tx;
|
||||||
|
@ -65,7 +70,7 @@ module.exports = Self => {
|
||||||
const now = Date.vnNew();
|
const now = Date.vnNew();
|
||||||
const [firstTicketId] = ticketsIds;
|
const [firstTicketId] = ticketsIds;
|
||||||
|
|
||||||
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, myOptions);
|
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
||||||
|
|
||||||
for (const sale of sales) {
|
for (const sale of sales) {
|
||||||
const createdSale = await models.Sale.create({
|
const createdSale = await models.Sale.create({
|
||||||
|
@ -113,7 +118,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, myOptions) {
|
async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions) {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
|
|
||||||
const filter = {include: {relation: 'address'}};
|
const filter = {include: {relation: 'address'}};
|
||||||
|
@ -125,7 +130,7 @@ module.exports = Self => {
|
||||||
addressFk: ticket.address().id,
|
addressFk: ticket.address().id,
|
||||||
agencyModeFk: refundAgencyMode.id,
|
agencyModeFk: refundAgencyMode.id,
|
||||||
nickname: ticket.address().nickname,
|
nickname: ticket.address().nickname,
|
||||||
warehouseFk: ticket.warehouseFk,
|
warehouseFk: withWarehouse ? ticket.warehouseFk : null,
|
||||||
companyFk: ticket.companyFk,
|
companyFk: ticket.companyFk,
|
||||||
landed: now,
|
landed: now,
|
||||||
zoneFk: refoundZoneId
|
zoneFk: refoundZoneId
|
||||||
|
|
|
@ -6,8 +6,8 @@ describe('Sale refund()', () => {
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
|
||||||
const servicesIds = [3];
|
const servicesIds = [3];
|
||||||
|
const withWarehouse = true;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
@ -22,7 +22,7 @@ describe('Sale refund()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
const refundedTicket = await models.Sale.refund(salesIds, servicesIds, options);
|
const refundedTicket = await models.Sale.refund(salesIds, servicesIds, withWarehouse, options);
|
||||||
|
|
||||||
expect(refundedTicket).toBeDefined();
|
expect(refundedTicket).toBeDefined();
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ describe('Sale refund()', () => {
|
||||||
try {
|
try {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
const ticket = await models.Sale.refund(salesIds, servicesIds, options);
|
const ticket = await models.Sale.refund(salesIds, servicesIds, withWarehouse, options);
|
||||||
|
|
||||||
const refundedTicket = await models.Ticket.findOne({
|
const refundedTicket = await models.Ticket.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
@ -7,6 +7,11 @@ module.exports = Self => {
|
||||||
arg: 'ticketsIds',
|
arg: 'ticketsIds',
|
||||||
type: ['number'],
|
type: ['number'],
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'withWarehouse',
|
||||||
|
type: 'boolean',
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -19,7 +24,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.refund = async(ticketsIds, options) => {
|
Self.refund = async(ticketsIds, withWarehouse, options) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
let tx;
|
let tx;
|
||||||
|
@ -41,7 +46,7 @@ module.exports = Self => {
|
||||||
const services = await models.TicketService.find(filter, myOptions);
|
const services = await models.TicketService.find(filter, myOptions);
|
||||||
const servicesIds = services.map(service => service.id);
|
const servicesIds = services.map(service => service.id);
|
||||||
|
|
||||||
const refundedTickets = await models.Sale.refund(salesIds, servicesIds, myOptions);
|
const refundedTickets = await models.Sale.refund(salesIds, servicesIds, withWarehouse, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
|
|
|
@ -141,12 +141,27 @@
|
||||||
translate>
|
translate>
|
||||||
Recalculate components
|
Recalculate components
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item
|
<vn-item class="dropdown"
|
||||||
ng-click="refundAllConfirmation.show()"
|
vn-click-stop="refundMenu.show($event, 'left')"
|
||||||
vn-acl="invoicing, claimManager, salesAssistant"
|
vn-acl="invoicing, claimManager, salesAssistant"
|
||||||
vn-acl-action="remove"
|
vn-acl-action="remove"
|
||||||
|
vn-tooltip="Create a single ticket with all the content of the current ticket"
|
||||||
translate>
|
translate>
|
||||||
Refund all
|
Refund all...
|
||||||
|
<vn-menu vn-id="refundMenu">
|
||||||
|
<vn-list>
|
||||||
|
<vn-item
|
||||||
|
ng-click="$ctrl.refund(true)"
|
||||||
|
translate>
|
||||||
|
with warehouse
|
||||||
|
</vn-item>
|
||||||
|
<vn-item
|
||||||
|
ng-click="$ctrl.refund(false)"
|
||||||
|
translate>
|
||||||
|
without warehouse
|
||||||
|
</vn-item>
|
||||||
|
</vn-list>
|
||||||
|
</vn-menu>
|
||||||
</vn-item>
|
</vn-item>
|
||||||
</vn-list>
|
</vn-list>
|
||||||
</vn-menu>
|
</vn-menu>
|
||||||
|
@ -319,14 +334,6 @@
|
||||||
message="Recalculate components">
|
message="Recalculate components">
|
||||||
</vn-confirm>
|
</vn-confirm>
|
||||||
|
|
||||||
<!-- Refund all confirmation dialog -->
|
|
||||||
<vn-confirm
|
|
||||||
vn-id="refundAllConfirmation"
|
|
||||||
on-accept="$ctrl.refund()"
|
|
||||||
question="Are you sure you want to refund all?"
|
|
||||||
message="Refund all">
|
|
||||||
</vn-confirm>
|
|
||||||
|
|
||||||
<!-- Client balance popup-->
|
<!-- Client balance popup-->
|
||||||
<vn-client-balance-create
|
<vn-client-balance-create
|
||||||
vn-id="balance-create"
|
vn-id="balance-create"
|
||||||
|
|
|
@ -297,16 +297,17 @@ class Controller extends Section {
|
||||||
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
|
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
|
||||||
}
|
}
|
||||||
|
|
||||||
async refund() {
|
refund(withWarehouse) {
|
||||||
const params = {ticketsIds: [this.id]};
|
const params = {ticketsIds: [this.id], withWarehouse: withWarehouse};
|
||||||
const query = 'Tickets/refund';
|
const query = 'Tickets/refund';
|
||||||
return this.$http.post(query, params).then(res => {
|
return this.$http.post(query, params)
|
||||||
const refundTicket = res.data;
|
.then(res => {
|
||||||
this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {
|
const refundTicket = res.data;
|
||||||
ticketId: refundTicket.id
|
this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {
|
||||||
}));
|
ticketId: refundTicket.id
|
||||||
this.$state.go('ticket.card.sale', {id: refundTicket.id});
|
}));
|
||||||
});
|
this.$state.go('ticket.card.sale', {id: refundTicket.id});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onSmsSend(sms) {
|
onSmsSend(sms) {
|
||||||
|
|
|
@ -10,7 +10,9 @@ Send CSV: Enviar CSV
|
||||||
Send CSV Delivery Note: Enviar albarán en CSV
|
Send CSV Delivery Note: Enviar albarán en CSV
|
||||||
Send PDF Delivery Note: Enviar albarán en PDF
|
Send PDF Delivery Note: Enviar albarán en PDF
|
||||||
Show Proforma: Ver proforma
|
Show Proforma: Ver proforma
|
||||||
Refund all: Abonar todo
|
Refund all...: Abonar todo...
|
||||||
|
with warehouse: con almacén
|
||||||
|
without warehouse: sin almacén
|
||||||
Invoice sent: Factura enviada
|
Invoice sent: Factura enviada
|
||||||
The following refund ticket have been created: "Se ha creado siguiente ticket de abono: {{ticketId}}"
|
The following refund ticket have been created: "Se ha creado siguiente ticket de abono: {{ticketId}}"
|
||||||
Transfer client: Transferir cliente
|
Transfer client: Transferir cliente
|
||||||
|
@ -18,3 +20,4 @@ SMS Notify changes: SMS Notificar cambios
|
||||||
PDF sent!: ¡PDF enviado!
|
PDF sent!: ¡PDF enviado!
|
||||||
Already exist signed delivery note: Ya existe albarán de entrega firmado
|
Already exist signed delivery note: Ya existe albarán de entrega firmado
|
||||||
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán de entrega?
|
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán de entrega?
|
||||||
|
Create a single ticket with all the content of the current ticket: Crea un ticket único con todo el contenido del ticket actual
|
||||||
|
|
|
@ -529,11 +529,28 @@
|
||||||
ng-if="$ctrl.isEditable && $ctrl.hasReserves()">
|
ng-if="$ctrl.isEditable && $ctrl.hasReserves()">
|
||||||
Unmark as reserved
|
Unmark as reserved
|
||||||
</vn-item>
|
</vn-item>
|
||||||
<vn-item translate
|
<vn-item class="dropdown"
|
||||||
name="refund"
|
name="refund"
|
||||||
ng-click="$ctrl.createRefund()"
|
vn-click-stop="refundMenu.show($event, 'left')"
|
||||||
vn-acl="invoicing, claimManager, salesAssistant"
|
vn-acl="invoicing, claimManager, salesAssistant"
|
||||||
vn-acl-action="remove">
|
vn-acl-action="remove"
|
||||||
Refund
|
translate>
|
||||||
</vn-item>
|
Refund...
|
||||||
|
<vn-menu vn-id="refundMenu">
|
||||||
|
<vn-list>
|
||||||
|
<vn-item
|
||||||
|
name="refundWithWarehouse"
|
||||||
|
ng-click="$ctrl.createRefund(true)"
|
||||||
|
translate>
|
||||||
|
with warehouse
|
||||||
|
</vn-item>
|
||||||
|
<vn-item
|
||||||
|
name="refundWithoutWarehouse"
|
||||||
|
ng-click="$ctrl.createRefund(false)"
|
||||||
|
translate>
|
||||||
|
without warehouse
|
||||||
|
</vn-item>
|
||||||
|
</vn-list>
|
||||||
|
</vn-menu>
|
||||||
|
</vn-item>
|
||||||
</vn-menu>
|
</vn-menu>
|
||||||
|
|
|
@ -520,13 +520,12 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
createRefund() {
|
createRefund(withWarehouse) {
|
||||||
const sales = this.selectedValidSales();
|
const sales = this.selectedValidSales();
|
||||||
if (!sales) return;
|
if (!sales) return;
|
||||||
|
|
||||||
const salesIds = sales.map(sale => sale.id);
|
const salesIds = sales.map(sale => sale.id);
|
||||||
|
const params = {salesIds: salesIds, withWarehouse: withWarehouse};
|
||||||
const params = {salesIds: salesIds};
|
|
||||||
const query = 'Sales/refund';
|
const query = 'Sales/refund';
|
||||||
this.$http.post(query, params).then(res => {
|
this.$http.post(query, params).then(res => {
|
||||||
const refundTicket = res.data;
|
const refundTicket = res.data;
|
||||||
|
|
|
@ -36,10 +36,10 @@ Warehouse: Almacen
|
||||||
Agency: Agencia
|
Agency: Agencia
|
||||||
Shipped: F. envio
|
Shipped: F. envio
|
||||||
Packaging: Encajado
|
Packaging: Encajado
|
||||||
Refund: Abono
|
Refund...: Abono...
|
||||||
Promotion mana: Maná promoción
|
Promotion mana: Maná promoción
|
||||||
Claim mana: Maná reclamación
|
Claim mana: Maná reclamación
|
||||||
History: Historial
|
History: Historial
|
||||||
Do you want to continue?: ¿Desea continuar?
|
Do you want to continue?: ¿Desea continuar?
|
||||||
Claim out of time: Reclamación fuera de plazo
|
Claim out of time: Reclamación fuera de plazo
|
||||||
Do you want to create a claim?: ¿Quieres crear una reclamación?
|
Do you want to create a claim?: ¿Quieres crear una reclamación?
|
||||||
|
|
Loading…
Reference in New Issue