Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/test This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-02-22 14:38:45 +01:00
commit 961eb6edaf
9 changed files with 48 additions and 9 deletions

View File

@ -16,10 +16,6 @@ vn-check {
}
md-checkbox {
margin-bottom: 0
}
md-checkbox .md-label {
margin-bottom: .5em;
margin-bottom: 0.8em
}
}

View File

@ -174,4 +174,7 @@ vn-table {
float: right;
margin: 0!important;
}
md-checkbox {
margin: 0;
}
}

View File

@ -2,7 +2,6 @@
<div style="position: absolute; top: 0; left: 0; padding: .3em; z-index: 1">
<vn-icon-button
icon="menu"
style="font-size: .4em;"
ng-click="$ctrl.showUvc($event)">
</vn-icon-button>
<vn-dialog

View File

@ -0,0 +1,10 @@
const app = require('vn-loopback/server/server');
describe('item-barcode toItem()', () => {
it('should return the same number if there is a barcode and a item with the same ID', async() => {
let barcode = 3;
let result = await app.models.ItemBarcode.toItem(barcode);
expect(result).toBe(3);
});
});

View File

@ -0,0 +1,28 @@
module.exports = Self => {
Self.remoteMethod('toItem', {
description: 'Returns last entries',
accessType: 'READ',
accepts: [{
arg: 'barcode',
type: 'Number',
required: true,
description: 'barcode'
}],
returns: {
type: 'Number',
root: true
},
http: {
path: `/:barcode/toItem`,
verb: 'GET'
}
});
Self.toItem = async barcode => {
let query = `SELECT vn.barcodeToItem(?)`;
let [item] = await Self.rawSql(query, [barcode]);
if (item)
item = Object.values(item);
return item[0];
};
};

View File

@ -1,4 +1,6 @@
module.exports = Self => {
require('../methods/item-barcode/toItem')(Self);
Self.validatesUniquenessOf('code', {
message: `Barcode must be unique`
});

View File

@ -95,7 +95,7 @@
<span translate>Regularize stock</span>
</h5>
<vn-textfield
label="Quantity"
label="Type the visible quantity"
model="$ctrl.quantity"
name="user"
vn-id="userField"

View File

@ -1 +1,2 @@
Regularize stock: Regularizar stock
Type the visible quantity: Introduce la cantidad visible

View File

@ -20,7 +20,7 @@
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sale in sales">
<vn-td center>
<vn-td center shrink>
<vn-check
vn-one field="sale.isChecked.isChecked"
disabled="true">