refs #5836 check fix
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2023-06-27 10:27:39 +02:00
parent 24ea18aeb0
commit 5216f12001
3 changed files with 18 additions and 25 deletions

View File

@ -39,11 +39,6 @@
"type": "belongsTo", "type": "belongsTo",
"model": "PayMethod", "model": "PayMethod",
"foreignKey": "payMethod" "foreignKey": "payMethod"
},
"businessType": {
"type":"belongsTo",
"model": "businessType",
"foreignKey": "businessTypeFk"
} }
} }
} }

View File

@ -4,7 +4,7 @@
filter="::$ctrl.filter" filter="::$ctrl.filter"
limit="20" limit="20"
order="amount DESC" order="amount DESC"
data="defaulters" data="$ctrl.defaulters"
on-data-change="$ctrl.reCheck()" on-data-change="$ctrl.reCheck()"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
@ -54,7 +54,7 @@
<th field="clientFk"> <th field="clientFk">
<span translate>Client</span> <span translate>Client</span>
</th> </th>
<th field="businessType"> <th>
<span translate>Es trabajador</span> <span translate>Es trabajador</span>
</th> </th>
<th field="salesPersonFk"> <th field="salesPersonFk">
@ -97,7 +97,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="defaulter in defaulters"> <tr ng-repeat="defaulter in $ctrl.defaulters">
<td shrink> <td shrink>
<vn-check <vn-check
ng-model="defaulter.checked" ng-model="defaulter.checked"
@ -115,8 +115,7 @@
</td> </td>
<td> <td>
<vn-check <vn-check
label="isWorker" ng-model="defaulter.isWorker"
ng-model="$ctrl.isWorker"
disabled="true"> disabled="true">
</vn-check> </vn-check>
</td> </td>

View File

@ -5,7 +5,7 @@ import UserError from 'core/lib/user-error';
export default class Controller extends Section { export default class Controller extends Section {
constructor($element, $) { constructor($element, $) {
super($element, $); super($element, $);
this.defaulter = {}; this.defaulters = [];
this.checkedDefaulers = []; this.checkedDefaulers = [];
this.smartTableOptions = { this.smartTableOptions = {
@ -62,14 +62,6 @@ export default class Controller extends Section {
{ {
field: 'defaulterSinced', field: 'defaulterSinced',
datepicker: true datepicker: true
},
{
field: 'businessType',
autocomplete: {
url: 'Clients',
showField: 'businessTypeFk',
valueField: 'id'
}
} }
] ]
}; };
@ -77,6 +69,18 @@ export default class Controller extends Section {
this.getBalanceDueTotal(); this.getBalanceDueTotal();
} }
set defaulters(value) {
if (!value || !value.length) return;
for (let defaulter of value)
defaulter.isWorker = defaulter.businessType === 'worker';
this._defaulters = value;
}
get defaulters() {
return this._defaulters;
}
get checked() { get checked() {
const clients = this.$.model.data || []; const clients = this.$.model.data || [];
const checkedLines = []; const checkedLines = [];
@ -160,7 +164,7 @@ export default class Controller extends Section {
switch (param) { switch (param) {
case 'creditInsurance': case 'creditInsurance':
case 'amount': case 'amount':
case 'businessTypeFk': case 'businessType':
case 'clientFk': case 'clientFk':
case 'workerFk': case 'workerFk':
case 'country': case 'country':
@ -186,11 +190,6 @@ export default class Controller extends Section {
return [minHour, maxHour]; return [minHour, maxHour];
} }
isWorker() {
if (businessType === 'worker')
return true;
}
} }
ngModule.vnComponent('vnClientDefaulter', { ngModule.vnComponent('vnClientDefaulter', {