Merge branch 'dev' into 3363-sale_update_price
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-11-24 09:15:13 +00:00
commit f98b0c7bbe
6 changed files with 64 additions and 2 deletions

View File

@ -0,0 +1,5 @@
UPDATE `salix`.`defaultViewConfig`
SET `columns` = '{"intrastat":false,"description":false,"density":false,"isActive":false,
"freightValue":false,"packageValue":false,"isIgnored":false,"price2":false,"ektFk":false,"weight":false,
"size":false,"comissionValue":false,"landing":false}'
WHERE tableCode = 'latestBuys'

View File

@ -73,6 +73,16 @@ module.exports = Self => {
arg: 'packingOut',
type: 'integer',
description: 'the packingOut',
},
{
arg: 'from',
type: 'date',
description: `The from date filter`
},
{
arg: 'to',
type: 'date',
description: `The to date filter`
}
],
returns: {
@ -117,6 +127,10 @@ module.exports = Self => {
return {'i.isActive': value};
case 'floramondo':
return {'i.isFloramondo': value};
case 'from':
return {'lb.landing': {gte: value}};
case 'to':
return {'lb.landing': {lte: value}};
case 'visible':
if (value)
return {'v.visible': {gt: 0}};
@ -176,7 +190,8 @@ module.exports = Self => {
b.price3,
b.ektFk,
b.weight,
b.packageFk
b.packageFk,
lb.landing
FROM cache.last_buy lb
LEFT JOIN cache.visible v ON v.item_id = lb.item_id
AND v.calc_id = @calc_id

View File

@ -172,5 +172,24 @@ describe('Buy latests buys filter()', () => {
expect(results.length).toBe(2);
});
it('should return results matching "from" and "to"', async() => {
const from = new Date();
from.setHours(0, 0, 0, 0);
const to = new Date();
to.setHours(23, 59, 59, 999);
let ctx = {
args: {
from: from,
to: to
}
};
let results = await app.models.Buy.latestBuysFilter(ctx);
expect(results.length).toBe(2);
});
});

View File

@ -58,6 +58,18 @@
<tpl-item>{{name}}: {{nickname}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-date-picker
vn-one
label="From"
ng-model="filter.from">
</vn-date-picker>
<vn-date-picker
vn-one
label="To"
ng-model="filter.to">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal>
<vn-check
label="Is active"

View File

@ -112,6 +112,9 @@
<th field="packingOut">
<span translate>Package out</span>
</th>
<th field="landing">
<span translate>Landing</span>
</th>
</tr>
</thead>
<tbody>
@ -207,6 +210,7 @@
<td>{{::buy.weight}}</td>
<td>{{::buy.packageFk}}</td>
<td>{{::buy.packingOut}}</td>
<td>{{::buy.landing | date: 'dd/MM/yyyy'}}</td>
</tr>
</tbody>
</table>

View File

@ -61,6 +61,10 @@ export default class Controller extends Section {
field: 'isIgnored',
searchable: false
},
{
field: 'landing',
searchable: false
}
]
};
}
@ -76,7 +80,8 @@ export default class Controller extends Section {
{field: 'description', displayName: this.$t('Description')},
{field: 'size', displayName: this.$t('Size')},
{field: 'density', displayName: this.$t('Density')},
{field: 'packingOut', displayName: this.$t('PackingOut')}
{field: 'packingOut', displayName: this.$t('PackingOut')},
{field: 'landing', displayName: this.$t('Landing')}
];
return this._columns;
@ -112,6 +117,8 @@ export default class Controller extends Section {
return {'intr.description': value};
case 'origin':
return {'ori.code': value};
case 'landing':
return {[`lb.${param}`]: value};
case 'packing':
case 'grouping':
case 'quantity':