Merge pull request 'fixes #5172 Mostrar Impagado en el descriptor de Client' (!1323) from 5172-cliente-impagado into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1323
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Alexandre Riera 2023-02-24 09:40:59 +00:00
commit 335f259eba
5 changed files with 22 additions and 9 deletions

View File

@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2308.01] - 2023-03-09
### Added
-
- (Client -> Descriptor) Nuevo icono $ con barrotes para los clientes con impago
### Changed
-

View File

@ -80,6 +80,7 @@ module.exports = function(Self) {
const data = await Self.rawSql(query, [id, date], myOptions);
client.debt = data[0].debt;
client.unpaid = await Self.app.models.ClientUnpaid.findOne({id}, myOptions);
return client;
};

View File

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

View File

@ -44,6 +44,11 @@ class Controller extends Descriptor {
return this.$http.post(`Clients/${this.id}/sendSms`, sms)
.then(() => this.vnApp.showSuccess(this.$t('SMS sent')));
}
clientUnpaid() {
return this.$t(`Unpaid Dated`, {dated: this.client.unpaid.dated}) +
'<br/>' + this.$t(`Unpaid Amount`, {amount: this.client.unpaid.amount});
}
}
ngModule.vnComponent('vnClientDescriptor', {

View File

@ -6,3 +6,5 @@ Go to user: Ir al usuario
Go to supplier: Ir al proveedor
Client invoices list: Listado de facturas del cliente
Pay method: Forma de pago
Unpaid Dated: "Fecha: {{dated | date:'dd/MM/yyyy'}}"
Unpaid Amount: "Importe: {{amount | currency: 'EUR':2}}"