7691-testToMaster #2703
|
@ -1,6 +1,6 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('entryLabel', {
|
||||
description: 'Returns the entry labels',
|
||||
Self.remoteMethodCtx('buyLabel', {
|
||||
description: 'Returns the entry buys labels',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
|
@ -27,10 +27,10 @@ module.exports = Self => {
|
|||
}
|
||||
],
|
||||
http: {
|
||||
path: '/:id/entry-label',
|
||||
path: '/:id/buy-label',
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.entryLabel = (ctx, id) => Self.printReport(ctx, id, 'entry-label');
|
||||
Self.buyLabel = (ctx, id) => Self.printReport(ctx, id, 'buy-label');
|
||||
};
|
|
@ -9,7 +9,7 @@ module.exports = Self => {
|
|||
require('../methods/entry/entryOrderPdf')(Self);
|
||||
require('../methods/entry/addFromPackaging')(Self);
|
||||
require('../methods/entry/addFromBuy')(Self);
|
||||
require('../methods/entry/entryLabel')(Self);
|
||||
require('../methods/entry/buyLabel')(Self);
|
||||
|
||||
Self.observe('before save', async function(ctx, options) {
|
||||
if (ctx.isNewInstance) return;
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
<tr>
|
||||
<td colspan="2">
|
||||
<div id="variant" class="cell">
|
||||
<span class="lbl">Variedad</span>
|
||||
<span class="lbl">{{$t('variety')}}</span>
|
||||
{{buy.name}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Medida</span>
|
||||
<span class="lbl">{{$t('size')}}</span>
|
||||
{{buy.size}}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -19,19 +19,19 @@
|
|||
<tr>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Categoría</span>
|
||||
<span class="lbl">{{$t('category')}}</span>
|
||||
{{buy.category}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Color</span>
|
||||
<span class="lbl">{{$t('color')}}</span>
|
||||
{{buy.color}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Origen</span>
|
||||
<span class="lbl">{{$t('origin')}}</span>
|
||||
{{buy.code}}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -39,19 +39,19 @@
|
|||
<tr>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Packing</span>
|
||||
<span class="lbl">{{$t('packing')}}</span>
|
||||
{{buy.packing}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Grouping</span>
|
||||
<span class="lbl">{{$t('grouping')}}</span>
|
||||
{{buy.grouping}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Ud. venta</span>
|
||||
<span class="lbl">{{$t('saleUnit')}}</span>
|
||||
{{buy.stems}}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -65,7 +65,7 @@
|
|||
<tr>
|
||||
<td colspan="3">
|
||||
<div id="producer" class="cell">
|
||||
<span class="lbl">Productor</span>
|
||||
<span class="lbl">{{$t('producer')}}</span>
|
||||
{{buy.producer}}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -73,13 +73,13 @@
|
|||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="cell">
|
||||
<span class="lbl">Control</span>
|
||||
<span class="lbl">{{$t('control')}}</span>
|
||||
{{`${weekNum} / ${dayNum}`}}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="cell">
|
||||
<span class="lbl">Caja nº</span>
|
||||
<span class="lbl">{{$t('boxNum')}}</span>
|
||||
{{`${buy.labelNum} / ${maxLabelNum}`}}
|
||||
</div>
|
||||
</td>
|
|
@ -4,10 +4,10 @@ const jsBarcode = require('jsbarcode');
|
|||
const moment = require('moment');
|
||||
|
||||
module.exports = {
|
||||
name: 'entry-label',
|
||||
name: 'buy-label',
|
||||
mixins: [vnReport],
|
||||
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));
|
||||
const date = new Date();
|
||||
this.weekNum = moment(date).isoWeek();
|
|
@ -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.
|
|
@ -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º
|
|
@ -1 +0,0 @@
|
|||
reportName: Etiqueta
|
Loading…
Reference in New Issue