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",
"model": "PayMethod",
"foreignKey": "payMethod"
},
"businessType": {
"type":"belongsTo",
"model": "businessType",
"foreignKey": "businessTypeFk"
}
}
}

View File

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

View File

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