Merge branch 'dev' into 7146-route.createdToDated
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
df51b93e5b
|
@ -133,6 +133,9 @@
|
|||
"Postcode": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Prefix": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ReferenceRate": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "Prefix",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "pbx.prefix"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"country": {
|
||||
"type": "string",
|
||||
"id": true
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"property": "*",
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "employee",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -54,7 +54,7 @@ module.exports = Self => {
|
|||
{
|
||||
relation: 'country',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
fields: ['id', 'name', 'code'],
|
||||
include: {
|
||||
relation: 'saySimpleCountry',
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('print', {
|
||||
Self.remoteMethodCtx('labelSupplier', {
|
||||
description: 'Print stickers of all entries',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
|
@ -28,13 +28,13 @@ module.exports = Self => {
|
|||
}
|
||||
],
|
||||
http: {
|
||||
path: '/:id/print',
|
||||
path: '/:id/labelSupplier',
|
||||
verb: 'GET'
|
||||
},
|
||||
accessScopes: ['DEFAULT', 'read:multimedia']
|
||||
});
|
||||
|
||||
Self.print = async function(ctx, id, options) {
|
||||
Self.labelSupplier = async function(ctx, id, options) {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
if (typeof options == 'object')
|
||||
|
@ -48,7 +48,8 @@ module.exports = Self => {
|
|||
for (const buy of buys) {
|
||||
if (buy.stickers < 1) continue;
|
||||
ctx.args.id = buy.id;
|
||||
const pdfBuffer = await models.Entry.buyLabel(ctx, myOptions);
|
||||
ctx.args.copies = buy.stickers;
|
||||
const pdfBuffer = await models.Entry.buyLabelSupplier(ctx, myOptions);
|
||||
await merger.add(new Uint8Array(pdfBuffer[0]));
|
||||
}
|
||||
|
|
@ -12,7 +12,8 @@ module.exports = Self => {
|
|||
require('../methods/entry/addFromPackaging')(Self);
|
||||
require('../methods/entry/addFromBuy')(Self);
|
||||
require('../methods/entry/buyLabel')(Self);
|
||||
require('../methods/entry/print')(Self);
|
||||
require('../methods/entry/labelSupplier')(Self);
|
||||
require('../methods/entry/buyLabelSupplier')(Self);
|
||||
|
||||
Self.observe('before save', async function(ctx, options) {
|
||||
if (ctx.isNewInstance) return;
|
||||
|
|
|
@ -33,7 +33,9 @@ td {
|
|||
font-size: 26px;
|
||||
}
|
||||
.lg-txt {
|
||||
font-size: 32px;
|
||||
font-size: 40px;
|
||||
padding: 0px;
|
||||
line-height: 1;
|
||||
}
|
||||
.xl-txt {
|
||||
font-size: 50px;
|
||||
|
|
|
@ -36,12 +36,12 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="lg-txt xl-width bold center">
|
||||
<td class="bold center lg-txt xl-width">
|
||||
<div class="overflow-line">
|
||||
{{formatNumber(buy.itemFk)}}
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" class="md-txt md-width center">
|
||||
<td colspan="2" class="center md-txt md-width">
|
||||
<div class="overflow-line">
|
||||
{{`${(packing || buy.packing)} x ${buy.stems || ''}`}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue