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

This commit is contained in:
Carlos Jimenez Ruiz 2021-06-16 08:19:01 +00:00
commit b9cdc5ed6a
9 changed files with 37 additions and 32 deletions

View File

@ -51,6 +51,8 @@
</vn-data-viewer> </vn-data-viewer>
<vn-float-button <vn-float-button
ng-if="$ctrl.canCreateNew()" ng-if="$ctrl.canCreateNew()"
vn-acl="insurance"
vn-acl-action="remove"
vn-tooltip="New contract" vn-tooltip="New contract"
fixed-bottom-right fixed-bottom-right
ui-sref="client.card.creditInsurance.create" ui-sref="client.card.creditInsurance.create"

View File

@ -30,6 +30,8 @@
</div> </div>
<a <a
ng-if="!$ctrl.isClosed" ng-if="!$ctrl.isClosed"
vn-acl="insurance"
vn-acl-action="remove"
ui-sref="client.card.creditInsurance.insurance.create({classificationId: {{$ctrl.$params.classificationId}}})" ui-sref="client.card.creditInsurance.insurance.create({classificationId: {{$ctrl.$params.classificationId}}})"
fixed-bottom-right fixed-bottom-right
vn-tooltip="New credit" vn-tooltip="New credit"

View File

@ -240,14 +240,12 @@
"url": "/credit-insurance", "url": "/credit-insurance",
"abstract": true, "abstract": true,
"state": "client.card.creditInsurance", "state": "client.card.creditInsurance",
"component": "ui-view", "component": "ui-view"
"acl": ["insurance"]
}, { }, {
"url": "/index", "url": "/index",
"state": "client.card.creditInsurance.index", "state": "client.card.creditInsurance.index",
"component": "vn-client-credit-insurance-index", "component": "vn-client-credit-insurance-index",
"description": "Credit contracts", "description": "Credit contracts",
"acl": ["insurance"],
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
@ -256,6 +254,7 @@
"state": "client.card.creditInsurance.create", "state": "client.card.creditInsurance.create",
"component": "vn-client-credit-insurance-create", "component": "vn-client-credit-insurance-create",
"description": "New insurance", "description": "New insurance",
"acl": ["insurance"],
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
@ -279,6 +278,7 @@
"state": "client.card.creditInsurance.insurance.create", "state": "client.card.creditInsurance.insurance.create",
"component": "vn-client-credit-insurance-insurance-create", "component": "vn-client-credit-insurance-insurance-create",
"description": "New credit", "description": "New credit",
"acl": ["insurance"],
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }

View File

@ -48,21 +48,15 @@ module.exports = Self => {
switch (field) { switch (field) {
case 'size': case 'size':
case 'density': case 'density':
case 'minPrice':
case 'description': case 'description':
case 'packingOut':
modelName = 'Item'; modelName = 'Item';
identifier = 'itemFk'; identifier = 'itemFk';
break; break;
case 'quantity':
case 'buyingValue':
case 'freightValue':
case 'packing': case 'packing':
case 'grouping': case 'grouping':
case 'groupingMode': case 'groupingMode':
case 'comissionValue':
case 'packageValue': case 'packageValue':
case 'price2':
case 'price3':
case 'weight': case 'weight':
modelName = 'Buy'; modelName = 'Buy';
identifier = 'id'; identifier = 'id';

View File

@ -10,54 +10,59 @@ module.exports = Self => {
accepts: [ accepts: [
{ {
arg: 'filter', arg: 'filter',
type: 'Object', type: 'object',
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string', description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
}, },
{ {
arg: 'search', arg: 'search',
type: 'String', type: 'string',
description: `If it's and integer searchs by id, otherwise it searchs by name`, description: `If it's and integer searchs by id, otherwise it searchs by name`,
}, },
{ {
arg: 'id', arg: 'id',
type: 'Integer', type: 'integer',
description: 'Item id', description: 'Item id',
}, },
{ {
arg: 'tags', arg: 'tags',
type: ['Object'], type: ['object'],
description: 'List of tags to filter with', description: 'List of tags to filter with',
http: {source: 'query'} http: {source: 'query'}
}, },
{ {
arg: 'description', arg: 'description',
type: 'String', type: 'string',
description: 'The item description', description: 'The item description',
}, },
{ {
arg: 'salesPersonFk', arg: 'salesPersonFk',
type: 'Integer', type: 'integer',
description: 'The buyer of the item', description: 'The buyer of the item',
}, },
{ {
arg: 'active', arg: 'active',
type: 'Boolean', type: 'boolean',
description: 'Whether the item is or not active', description: 'Whether the item is or not active',
}, },
{ {
arg: 'visible', arg: 'visible',
type: 'Boolean', type: 'boolean',
description: 'Whether the item is or not visible', description: 'Whether the item is or not visible',
}, },
{ {
arg: 'typeFk', arg: 'typeFk',
type: 'Integer', type: 'integer',
description: 'Type id', description: 'Type id',
}, },
{ {
arg: 'categoryFk', arg: 'categoryFk',
type: 'Integer', type: 'integer',
description: 'Category id', description: 'Category id',
},
{
arg: 'packingOut',
type: 'integer',
description: 'the packingOut',
} }
], ],
returns: { returns: {
@ -84,7 +89,10 @@ module.exports = Self => {
? {'i.id': value} ? {'i.id': value}
: {'i.name': {like: `%${value}%`}}; : {'i.name': {like: `%${value}%`}};
case 'id': case 'id':
return {'i.id': value}; case 'packingOut':
case 'typeFk':
param = `i.${param}`;
return {[param]: value};
case 'description': case 'description':
return {'i.description': {like: `%${value}%`}}; return {'i.description': {like: `%${value}%`}};
case 'categoryFk': case 'categoryFk':
@ -93,8 +101,6 @@ module.exports = Self => {
return {'it.workerFk': value}; return {'it.workerFk': value};
case 'code': case 'code':
return {'it.code': value}; return {'it.code': value};
case 'typeFk':
return {'i.typeFk': value};
case 'active': case 'active':
return {'i.isActive': value}; return {'i.isActive': value};
case 'visible': case 'visible':
@ -126,6 +132,7 @@ module.exports = Self => {
i.description, i.description,
i.name, i.name,
i.subName, i.subName,
i.packingOut,
i.tag5, i.tag5,
i.value5, i.value5,
i.tag6, i.tag6,

View File

@ -57,6 +57,7 @@
<vn-th field="ektFk">Ekt</vn-th> <vn-th field="ektFk">Ekt</vn-th>
<vn-th field="weight">Weight</vn-th> <vn-th field="weight">Weight</vn-th>
<vn-th field="packageFk" expand>PackageName</vn-th> <vn-th field="packageFk" expand>PackageName</vn-th>
<vn-th field="packingOut" expand>PackingOut</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
@ -147,6 +148,7 @@
<vn-td number>{{::buy.ektFk | dashIfEmpty}}</vn-td> <vn-td number>{{::buy.ektFk | dashIfEmpty}}</vn-td>
<vn-td number>{{::buy.weight}}</vn-td> <vn-td number>{{::buy.weight}}</vn-td>
<vn-td number>{{::buy.packageFk}}</vn-td> <vn-td number>{{::buy.packageFk}}</vn-td>
<vn-td number>{{::buy.packingOut}}</vn-td>
</a> </a>
</vn-tbody> </vn-tbody>
</vn-table> </vn-table>

View File

@ -16,20 +16,14 @@ export default class Controller extends Section {
if (this._columns) return this._columns; if (this._columns) return this._columns;
this._columns = [ this._columns = [
{field: 'quantity', displayName: this.$t('Quantity')},
{field: 'buyingValue', displayName: this.$t('Buying value')},
{field: 'freightValue', displayName: this.$t('Freight value')},
{field: 'packing', displayName: this.$t('Packing')}, {field: 'packing', displayName: this.$t('Packing')},
{field: 'grouping', displayName: this.$t('Grouping')}, {field: 'grouping', displayName: this.$t('Grouping')},
{field: 'comissionValue', displayName: this.$t('Commission value')},
{field: 'packageValue', displayName: this.$t('Package value')}, {field: 'packageValue', displayName: this.$t('Package value')},
{field: 'price2', displayName: this.$t('Grouping price')},
{field: 'price3', displayName: this.$t('Packing price')},
{field: 'weight', displayName: this.$t('Weight')}, {field: 'weight', displayName: this.$t('Weight')},
{field: 'description', displayName: this.$t('Description')}, {field: 'description', displayName: this.$t('Description')},
{field: 'minPrice', displayName: this.$t('Min price')},
{field: 'size', displayName: this.$t('Size')}, {field: 'size', displayName: this.$t('Size')},
{field: 'density', displayName: this.$t('Density')} {field: 'density', displayName: this.$t('Density')},
{field: 'packingOut', displayName: this.$t('PackingOut')}
]; ];
return this._columns; return this._columns;

View File

@ -14,3 +14,4 @@ Field to edit: Campo a editar
PackageName: Cubo PackageName: Cubo
Edit: Editar Edit: Editar
buy(s): compra(s) buy(s): compra(s)
PackingOut: Packing envíos

View File

@ -137,6 +137,9 @@
"minPrice": { "minPrice": {
"type": "number" "type": "number"
}, },
"packingOut": {
"type": "number"
},
"hasMinPrice": { "hasMinPrice": {
"type": "boolean" "type": "boolean"
}, },