Merge pull request '5013-observaciones_facturas' (!1401) from 5013-observaciones_facturas into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1401
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Vicent Llopis 2023-03-24 09:56:27 +00:00
commit 6433e889c7
4 changed files with 25 additions and 9 deletions

View File

@ -501,7 +501,8 @@ INSERT INTO `vn`.`observationType`(`id`,`description`, `code`)
(3, 'Delivery', 'delivery'), (3, 'Delivery', 'delivery'),
(4, 'SalesPerson', 'salesPerson'), (4, 'SalesPerson', 'salesPerson'),
(5, 'Administrative', 'administrative'), (5, 'Administrative', 'administrative'),
(6, 'Weight', 'weight'); (6, 'Weight', 'weight'),
(7, 'InvoiceOut', 'invoiceOut');
INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`) INSERT INTO `vn`.`addressObservation`(`id`,`addressFk`,`observationTypeFk`,`description`)
VALUES VALUES
@ -738,7 +739,9 @@ INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `des
(9, 23, 5, 'care with the dog'), (9, 23, 5, 'care with the dog'),
(10, 23, 4, 'Reclama ticket: 8'), (10, 23, 4, 'Reclama ticket: 8'),
(11, 24, 4, 'Reclama ticket: 7'), (11, 24, 4, 'Reclama ticket: 7'),
(12, 11, 3, 'Delivery after 10am'); (12, 11, 3, 'Delivery after 10am'),
(13, 1, 7, 'observation of ticket one'),
(14, 2, 7, 'observation of ticket two');
-- FIX for state hours on local, inter_afterInsert -- FIX for state hours on local, inter_afterInsert
-- UPDATE vncontrol.inter SET odbc_date = DATE_ADD(util.VN_CURDATE(), INTERVAL -10 SECOND); -- UPDATE vncontrol.inter SET odbc_date = DATE_ADD(util.VN_CURDATE(), INTERVAL -10 SECOND);

View File

@ -240,13 +240,18 @@
</tfoot> </tfoot>
</table> </table>
</div> </div>
<div class="columns vn-mt-xl" v-if="invoice.payMethodCode == 'wireTransfer'"> <div class="columns vn-mt-xl" v-if="invoice.payMethodCode == 'wireTransfer' || ticketObservations">
<div class="size50 pull-left no-page-break"> <div class="size50 pull-left no-page-break">
<div class="panel"> <div class="panel">
<div class="header">{{$t('observations')}}</div> <div class="header">{{$t('observations')}}</div>
<div class="body"> <div class="body">
<div>{{$t('wireTransfer')}}</div> <div v-if="invoice.payMethodCode == 'wireTransfer'">
<div>{{$t('accountNumber', [invoice.iban])}}</div> <div>{{$t('wireTransfer')}}</div>
<div>{{$t('accountNumber', [invoice.iban])}}</div>
</div>
<div v-if="ticketObservations">
{{ticketObservations}}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -21,11 +21,15 @@ module.exports = {
const map = new Map(); const map = new Map();
this.ticketObservations = '';
for (let ticket of tickets) { for (let ticket of tickets) {
ticket.sales = []; ticket.sales = [];
map.set(ticket.id, ticket); map.set(ticket.id, ticket);
if (ticket.description) this.ticketObservations += ticket.description + ' ';
} }
this.ticketObservations = this.ticketObservations.trim();
for (let sale of sales) { for (let sale of sales) {
const ticket = map.get(sale.ticketFk); const ticket = map.get(sale.ticketFk);

View File

@ -1,8 +1,12 @@
SELECT SELECT
t.id, t.id,
t.shipped, t.shipped,
t.nickname t.nickname,
FROM invoiceOut io tto.description
JOIN ticket t ON t.refFk = io.ref FROM invoiceOut io
JOIN ticket t ON t.refFk = io.REF
LEFT JOIN observationType ot ON ot.code = 'invoiceOut'
LEFT JOIN ticketObservation tto ON tto.ticketFk = t.id
AND tto.observationTypeFk = ot.id
WHERE t.refFk = ? WHERE t.refFk = ?
ORDER BY t.shipped ORDER BY t.shipped