Merge pull request '3597-feat(print_deliveryNote): add proforma type' (#906) from 3597-ticket_descriptor_proforma into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #906 Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
commit
6e9db8b1cd
|
@ -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>
|
||||
|
@ -44,7 +44,6 @@
|
|||
vn-click-stop="sendDeliveryNoteMenu.show($event, 'left')"
|
||||
translate>
|
||||
Send Delivery Note...
|
||||
|
||||
<vn-menu vn-id="sendDeliveryNoteMenu">
|
||||
<vn-list>
|
||||
<vn-item
|
||||
|
@ -60,6 +59,11 @@
|
|||
</vn-list>
|
||||
</vn-menu>
|
||||
</vn-item>
|
||||
<vn-item
|
||||
ng-click="$ctrl.showPdfDeliveryNote('proforma')"
|
||||
translate>
|
||||
Show Proforma
|
||||
</vn-item>
|
||||
<vn-item
|
||||
ng-click="deleteConfirmation.show()"
|
||||
ng-show="$ctrl.isEditable"
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -6,3 +6,4 @@ 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
|
||||
Show Proforma: Ver proforma
|
|
@ -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>
|
||||
|
@ -281,7 +281,7 @@
|
|||
<!-- Footer block -->
|
||||
<report-footer id="pageFooter"
|
||||
v-bind:company-code="ticket.companyCode"
|
||||
v-bind:left-text="$t('ticket', [ticket.id])"
|
||||
v-bind:left-text="footerType"
|
||||
v-bind:center-text="client.socialName"
|
||||
v-bind="$props">
|
||||
</report-footer>
|
||||
|
|
|
@ -44,6 +44,10 @@ module.exports = {
|
|||
});
|
||||
|
||||
return total;
|
||||
},
|
||||
footerType() {
|
||||
const translatedType = this.$t(this.type);
|
||||
return `${translatedType} ${this.ticketId}`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -119,6 +123,10 @@ module.exports = {
|
|||
ticketId: {
|
||||
type: [Number, String],
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
@ -17,7 +17,6 @@ total: Total
|
|||
subtotal: Subtotal
|
||||
vatType: VAT Type
|
||||
digitalSignature: Digital signature
|
||||
ticket: Delivery note {0}
|
||||
plantPassport: Plant passport
|
||||
packages: Packages
|
||||
services:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue