feat(print_deliveryNote): add proforma type
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-03-22 07:38:14 +01:00
parent 19df1fe382
commit ca35c88be4
10 changed files with 28 additions and 16 deletions

View File

@ -21,7 +21,7 @@
<vn-list>
<vn-item
ng-if="!$ctrl.hasDocuwareFile"
ng-click="$ctrl.showPdfDeliveryNote()"
ng-click="$ctrl.showPdfDeliveryNote('deliveryNote')"
translate>
as PDF
</vn-item>
@ -40,6 +40,11 @@
</vn-list>
</vn-menu>
</vn-item>
<vn-item
ng-click="$ctrl.showPdfDeliveryNote('proforma')"
translate>
Show Proforma
</vn-item>
<vn-item class="dropdown"
vn-click-stop="sendDeliveryNoteMenu.show($event, 'left')"
translate>

View File

@ -116,10 +116,11 @@ class Controller extends Section {
});
}
showPdfDeliveryNote() {
showPdfDeliveryNote(type) {
this.vnReport.show('delivery-note', {
recipientId: this.ticket.client.id,
ticketId: this.id,
type: type
});
}

View File

@ -122,14 +122,15 @@ describe('Ticket Component vnTicketDescriptorMenu', () => {
describe('showPdfDeliveryNote()', () => {
it('should open a new window showing a delivery note PDF document', () => {
jest.spyOn(window, 'open').mockReturnThis();
const type = 'deliveryNote';
const expectedParams = {
ticketId: ticket.id,
recipientId: ticket.client.id
recipientId: ticket.client.id,
type: type
};
const serializedParams = $httpParamSerializer(expectedParams);
const expectedPath = `api/report/delivery-note?${serializedParams}`;
controller.showPdfDeliveryNote();
controller.showPdfDeliveryNote(type);
expect(window.open).toHaveBeenCalledWith(expectedPath);
});

View File

@ -5,4 +5,5 @@ as CSV: como CSV
Send PDF: Enviar PDF
Send CSV: Enviar 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

View File

@ -15,7 +15,7 @@
<div class="columns">
<div class="size50">
<div class="size75 vn-mt-ml">
<h1 class="title uppercase">{{$t('title')}}</h1>
<h1 class="title uppercase">{{$t(type)}}</h1>
<table class="row-oriented ticket-info">
<tbody>
<tr>
@ -23,7 +23,7 @@
<th>{{client.id}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('ticketId')}}</td>
<td class="font gray uppercase">{{$t(type)}}</td>
<th>{{ticket.id}}</th>
</tr>
<tr>

View File

@ -119,6 +119,10 @@ module.exports = {
ticketId: {
type: [Number, String],
required: true
},
type: {
type: String,
required: true
}
}
};

View File

@ -1,6 +1,6 @@
reportName: delivery-note
title: Delivery note
ticketId: Delivery note
deliveryNote: Delivery note
proforma: Proforma
clientId: Client
deliveryAddress: Delivery address
fiscalData: Fiscal data

View File

@ -1,6 +1,6 @@
reportName: albaran
title: Albarán
ticketId: Albarán
deliveryNote: Albarán
proforma: Proforma
clientId: Cliente
deliveryAddress: Dirección de entrega
fiscalData: Datos fiscales

View File

@ -1,6 +1,6 @@
reportName: bon-de-livraison
title: Bon de livraison
ticketId: BL
deliveryNote: Bon de livraison
proforma: Proforma
clientId: Client
deliveryAddress: Adresse de livraison
fiscalData: Coordonnées

View File

@ -1,6 +1,6 @@
reportName: nota-de-entrega
title: Nota de Entrega
ticketId: Nota de Entrega
deliveryNote: Nota de Entrega
proforma: Proforma
clientId: Cliente
deliveryAddress: Morada de Entrega
fiscalData: Dados Fiscais