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

@ -18,26 +18,26 @@
<slot-body>
<div class="attributes">
<vn-label-value
label="Pay method"
label="Pay method"
value="{{$ctrl.client.payMethod.name}}">
</vn-label-value>
<vn-label-value
label="Credit"
label="Credit"
value="{{$ctrl.client.credit | currency: 'EUR': 2}}">
</vn-label-value>
<vn-label-value
label="Secured credit"
label="Secured credit"
value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}">
</vn-label-value>
<vn-label-value
label="Risk"
label="Risk"
value="{{$ctrl.client.debt | currency: 'EUR':2}}"
ng-class="{alert: $ctrl.client.debt > $ctrl.client.credit}"
info="Invoices minus payments plus orders not yet invoiced">
info="Invoices minus payments plus orders not yet invoiced">
</vn-label-value>
<vn-label-value
label="Sales person">
<span
<span
ng-click="workerDescriptor.show($event, $ctrl.client.salesPersonFk)"
class="link">
{{$ctrl.client.salesPersonUser.name}}
@ -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">
@ -118,7 +123,7 @@
on-send="$ctrl.onSmsSend($sms)"
sms="$ctrl.newSMS">
</vn-sms-dialog>
<vn-worker-descriptor-popover
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>
<vn-popup vn-id="summary">

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

@ -5,4 +5,6 @@ To date: Fecha hasta
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
Pay method: Forma de pago
Unpaid Dated: "Fecha: {{dated | date:'dd/MM/yyyy'}}"
Unpaid Amount: "Importe: {{amount | currency: 'EUR':2}}"