7691-testToMaster #2703

Merged
alexm merged 268 commits from 7691-testToMaster into master 2024-07-09 05:38:28 +00:00
11 changed files with 42 additions and 19 deletions
Showing only changes of commit 5c8d8ba280 - Show all commits

View File

@ -1,6 +1,6 @@
module.exports = Self => { module.exports = Self => {
Self.remoteMethodCtx('entryLabel', { Self.remoteMethodCtx('buyLabel', {
description: 'Returns the entry labels', description: 'Returns the entry buys labels',
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
{ {
@ -27,10 +27,10 @@ module.exports = Self => {
} }
], ],
http: { http: {
path: '/:id/entry-label', path: '/:id/buy-label',
verb: 'GET' verb: 'GET'
} }
}); });
Self.entryLabel = (ctx, id) => Self.printReport(ctx, id, 'entry-label'); Self.buyLabel = (ctx, id) => Self.printReport(ctx, id, 'buy-label');
}; };

View File

@ -9,7 +9,7 @@ module.exports = Self => {
require('../methods/entry/entryOrderPdf')(Self); require('../methods/entry/entryOrderPdf')(Self);
require('../methods/entry/addFromPackaging')(Self); require('../methods/entry/addFromPackaging')(Self);
require('../methods/entry/addFromBuy')(Self); require('../methods/entry/addFromBuy')(Self);
require('../methods/entry/entryLabel')(Self); require('../methods/entry/buyLabel')(Self);
Self.observe('before save', async function(ctx, options) { Self.observe('before save', async function(ctx, options) {
if (ctx.isNewInstance) return; if (ctx.isNewInstance) return;

View File

@ -5,13 +5,13 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div id="variant" class="cell"> <div id="variant" class="cell">
<span class="lbl">Variedad</span> <span class="lbl">{{$t('variety')}}</span>
{{buy.name}} {{buy.name}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Medida</span> <span class="lbl">{{$t('size')}}</span>
{{buy.size}} {{buy.size}}
</div> </div>
</td> </td>
@ -19,19 +19,19 @@
<tr> <tr>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Categoría</span> <span class="lbl">{{$t('category')}}</span>
{{buy.category}} {{buy.category}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Color</span> <span class="lbl">{{$t('color')}}</span>
{{buy.color}} {{buy.color}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Origen</span> <span class="lbl">{{$t('origin')}}</span>
{{buy.code}} {{buy.code}}
</div> </div>
</td> </td>
@ -39,19 +39,19 @@
<tr> <tr>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Packing</span> <span class="lbl">{{$t('packing')}}</span>
{{buy.packing}} {{buy.packing}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Grouping</span> <span class="lbl">{{$t('grouping')}}</span>
{{buy.grouping}} {{buy.grouping}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Ud. venta</span> <span class="lbl">{{$t('saleUnit')}}</span>
{{buy.stems}} {{buy.stems}}
</div> </div>
</td> </td>
@ -65,7 +65,7 @@
<tr> <tr>
<td colspan="3"> <td colspan="3">
<div id="producer" class="cell"> <div id="producer" class="cell">
<span class="lbl">Productor</span> <span class="lbl">{{$t('producer')}}</span>
{{buy.producer}} {{buy.producer}}
</div> </div>
</td> </td>
@ -73,13 +73,13 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div class="cell"> <div class="cell">
<span class="lbl">Control</span> <span class="lbl">{{$t('control')}}</span>
{{`${weekNum} / ${dayNum}`}} {{`${weekNum} / ${dayNum}`}}
</div> </div>
</td> </td>
<td> <td>
<div class="cell"> <div class="cell">
<span class="lbl">Caja nº</span> <span class="lbl">{{$t('boxNum')}}</span>
{{`${buy.labelNum} / ${maxLabelNum}`}} {{`${buy.labelNum} / ${maxLabelNum}`}}
</div> </div>
</td> </td>

View File

@ -4,10 +4,10 @@ const jsBarcode = require('jsbarcode');
const moment = require('moment'); const moment = require('moment');
module.exports = { module.exports = {
name: 'entry-label', name: 'buy-label',
mixins: [vnReport], mixins: [vnReport],
async serverPrefetch() { async serverPrefetch() {
this.buys = await this.rawSqlFromDef('entry', [this.id]); this.buys = await this.rawSqlFromDef('buys', [this.id]);
this.maxLabelNum = Math.max(...this.buys.map(buy => buy.labelNum)); this.maxLabelNum = Math.max(...this.buys.map(buy => buy.labelNum));
const date = new Date(); const date = new Date();
this.weekNum = moment(date).isoWeek(); this.weekNum = moment(date).isoWeek();

View File

@ -0,0 +1,12 @@
reportName: Entry buys
variety: Bariety
size: Size
category: Category
color: Color
origin: Origin
packing: Packing
grouping: Grouping
unitSale: Un. sale
producer: Producer
control: Control
boxNum: Box no.

View File

@ -0,0 +1,12 @@
reportName: Etiqueta de compras
variety: Variedad
size: Medida
category: Categoría
color: Color
origin: Origen
packing: Packing
grouping: Grouping
saleUnit: Sale un.
producer: Productor
control: Control
boxNum: Caja nº

View File

@ -1 +0,0 @@
reportName: Etiqueta