Merge pull request 'hotfix clientUnpaid' (!1381) from hotfix-clientUnpaid into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1381
This commit is contained in:
Joan Sanchez 2023-03-09 08:45:21 +00:00
commit 79428755db
4 changed files with 18 additions and 8 deletions

View File

@ -70,11 +70,12 @@
icon="icon-no036" icon="icon-no036"
ng-if="$ctrl.client.isTaxDataChecked == false"> ng-if="$ctrl.client.isTaxDataChecked == false">
</vn-icon> </vn-icon>
<vn-icon <vn-icon-button
vn-tooltip="{{$ctrl.clientUnpaid()}}" vn-tooltip="{{$ctrl.clientUnpaid()}}"
icon="icon-clientUnpaid" icon="icon-clientUnpaid"
ui-sref="client.card.unpaid"
ng-if="$ctrl.client.unpaid"> ng-if="$ctrl.client.unpaid">
</vn-icon> </vn-icon-button>
</div> </div>
<div class="quicklinks"> <div class="quicklinks">
<div ng-transclude="btnOne"> <div ng-transclude="btnOne">

View File

@ -46,8 +46,9 @@ class Controller extends Descriptor {
} }
clientUnpaid() { clientUnpaid() {
return this.$t(`Unpaid Dated`, {dated: this.client.unpaid.dated}) + return this.$t(`Unpaid`) + '<br/>'
'<br/>' + this.$t(`Unpaid Amount`, {amount: this.client.unpaid.amount}); + this.$t(`Unpaid Dated`, {dated: this.client.unpaid.dated}) + '<br/>'
+ this.$t(`Unpaid Amount`, {amount: this.client.unpaid.amount});
} }
} }

View File

@ -9,12 +9,12 @@
</vn-watcher> </vn-watcher>
<form <form
name="form" name="form"
ng-submit="watcher.submit()" ng-submit="$ctrl.onSubmit()"
class="vn-w-md"> class="vn-w-md">
<vn-card class="vn-pa-lg"> <vn-card class="vn-pa-lg">
<vn-vertical> <vn-vertical>
<vn-check <vn-check
label="Unpaid client" label="Unpaid client"
ng-model="watcher.hasData" ng-model="watcher.hasData"
on-change="$ctrl.setDefaultDate(watcher.hasData)"> on-change="$ctrl.setDefaultDate(watcher.hasData)">
</vn-check> </vn-check>
@ -48,4 +48,4 @@
</vn-button> </vn-button>
</vn-button-bar> </vn-button-bar>
</form> </form>
</div> </div>

View File

@ -6,9 +6,17 @@ export default class Controller extends Section {
if (hasData && !this.clientUnpaid.dated) if (hasData && !this.clientUnpaid.dated)
this.clientUnpaid.dated = Date.vnNew(); this.clientUnpaid.dated = Date.vnNew();
} }
onSubmit() {
this.$.watcher.submit()
.then(() => this.card.reload());
}
} }
ngModule.vnComponent('vnClientUnpaid', { ngModule.vnComponent('vnClientUnpaid', {
template: require('./index.html'), template: require('./index.html'),
controller: Controller controller: Controller,
require: {
card: '^vnClientCard'
}
}); });