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

This commit is contained in:
Alex Moreno 2022-03-22 15:13:34 +01:00
parent 19df1fe382
commit 0dc1848870
5 changed files with 26 additions and 15 deletions

View File

@ -21,7 +21,7 @@
<vn-list> <vn-list>
<vn-item <vn-item
ng-if="!$ctrl.hasDocuwareFile" ng-if="!$ctrl.hasDocuwareFile"
ng-click="$ctrl.showPdfDeliveryNote()" ng-click="$ctrl.showPdfDeliveryNote('deliveryNote')"
translate> translate>
as PDF as PDF
</vn-item> </vn-item>
@ -32,6 +32,12 @@
translate> translate>
as PDF as PDF
</a> </a>
<vn-item
ng-if="!$ctrl.hasDocuwareFile"
ng-click="$ctrl.showPdfDeliveryNote('withoutPrices')"
translate>
as PDF without prices
</vn-item>
<vn-item <vn-item
ng-click="$ctrl.showCsvDeliveryNote()" ng-click="$ctrl.showCsvDeliveryNote()"
translate> translate>
@ -44,7 +50,6 @@
vn-click-stop="sendDeliveryNoteMenu.show($event, 'left')" vn-click-stop="sendDeliveryNoteMenu.show($event, 'left')"
translate> translate>
Send Delivery Note... Send Delivery Note...
<vn-menu vn-id="sendDeliveryNoteMenu"> <vn-menu vn-id="sendDeliveryNoteMenu">
<vn-list> <vn-list>
<vn-item <vn-item

View File

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

View File

@ -2,6 +2,7 @@ Show Delivery Note...: Ver albarán...
Send Delivery Note...: Enviar albarán... Send Delivery Note...: Enviar albarán...
as PDF: como PDF as PDF: como PDF
as CSV: como CSV as CSV: como CSV
as PDF without prices: como PDF sin precios
Send PDF: Enviar PDF Send PDF: Enviar PDF
Send CSV: Enviar CSV Send CSV: Enviar CSV
Send CSV Delivery Note: Enviar albarán en CSV Send CSV Delivery Note: Enviar albarán en CSV

View File

@ -15,7 +15,7 @@
<div class="columns"> <div class="columns">
<div class="size50"> <div class="size50">
<div class="size75 vn-mt-ml"> <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"> <table class="row-oriented ticket-info">
<tbody> <tbody>
<tr> <tr>
@ -23,7 +23,7 @@
<th>{{client.id}}</th> <th>{{client.id}}</th>
</tr> </tr>
<tr> <tr>
<td class="font gray uppercase">{{$t('ticketId')}}</td> <td class="font gray uppercase">{{$t(type)}}</td>
<th>{{ticket.id}}</th> <th>{{ticket.id}}</th>
</tr> </tr>
<tr> <tr>
@ -77,10 +77,10 @@
<th width="5%">{{$t('reference')}}</th> <th width="5%">{{$t('reference')}}</th>
<th class="number">{{$t('quantity')}}</th> <th class="number">{{$t('quantity')}}</th>
<th width="50%">{{$t('concept')}}</th> <th width="50%">{{$t('concept')}}</th>
<th class="number">{{$t('price')}}</th> <th class="number" v-if="type != 'withoutPrices'">{{$t('price')}}</th>
<th class="centered" width="5%">{{$t('discount')}}</th> <th class="centered" width="5%" v-if="type != 'withoutPrices'">{{$t('discount')}}</th>
<th class="centered">{{$t('vat')}}</th> <th class="centered" v-if="type != 'withoutPrices'">{{$t('vat')}}</th>
<th class="number">{{$t('amount')}}</th> <th class="number" v-if="type != 'withoutPrices'">{{$t('amount')}}</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="sale in sales" class="no-page-break"> <tbody v-for="sale in sales" class="no-page-break">
@ -88,10 +88,10 @@
<td width="5%">{{sale.itemFk | zerofill('000000')}}</td> <td width="5%">{{sale.itemFk | zerofill('000000')}}</td>
<td class="number">{{sale.quantity}}</td> <td class="number">{{sale.quantity}}</td>
<td width="50%">{{sale.concept}}</td> <td width="50%">{{sale.concept}}</td>
<td class="number">{{sale.price | currency('EUR', $i18n.locale)}}</td> <td class="number" v-if="type != 'withoutPrices'">{{sale.price | currency('EUR', $i18n.locale)}}</td>
<td class="centered" width="5%">{{(sale.discount / 100) | percentage}}</td> <td class="centered" width="5%" v-if="type != 'withoutPrices'">{{(sale.discount / 100) | percentage}}</td>
<td class="centered">{{sale.vatType}}</td> <td class="centered" v-if="type != 'withoutPrices'">{{sale.vatType}}</td>
<td class="number">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td> <td class="number" v-if="type != 'withoutPrices'">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
<tr class="description font light-gray"> <tr class="description font light-gray">
<td colspan="7"> <td colspan="7">
@ -107,7 +107,7 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot v-if="type != 'withoutPrices'">
<tr> <tr>
<td colspan="6" class="font bold"> <td colspan="6" class="font bold">
<span class="pull-right">{{$t('subtotal')}}</span> <span class="pull-right">{{$t('subtotal')}}</span>
@ -181,7 +181,7 @@
</div> </div>
<!-- End of packages block --> <!-- End of packages block -->
</div> </div>
<div class="columns vn-mt-xl"> <div class="columns vn-mt-xl" v-if="type != 'withoutPrices'">
<!-- Taxes block --> <!-- Taxes block -->
<div id="taxes" class="size50 pull-right no-page-break" v-if="taxes"> <div id="taxes" class="size50 pull-right no-page-break" v-if="taxes">
<table class="column-oriented"> <table class="column-oriented">

View File

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