Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2493-route_ticket_drag_and_drop
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
4b40038200
|
@ -79,13 +79,20 @@
|
||||||
</vn-quick-link>
|
</vn-quick-link>
|
||||||
</div>
|
</div>
|
||||||
<div ng-transclude="btnTwo">
|
<div ng-transclude="btnTwo">
|
||||||
|
<vn-quick-link
|
||||||
|
tooltip="Client invoices list"
|
||||||
|
state="['invoiceOut.index', {q: $ctrl.filter}]"
|
||||||
|
icon="icon-invoices">
|
||||||
|
</vn-quick-link>
|
||||||
|
</div>
|
||||||
|
<div ng-transclude="btnThree">
|
||||||
<vn-quick-link
|
<vn-quick-link
|
||||||
tooltip="New order"
|
tooltip="New order"
|
||||||
state="['order.create', {clientFk: $ctrl.id}]"
|
state="['order.create', {clientFk: $ctrl.id}]"
|
||||||
icon="icon-basketadd">
|
icon="icon-basketadd">
|
||||||
</vn-quick-link>
|
</vn-quick-link>
|
||||||
</div>
|
</div>
|
||||||
<div ng-transclude="btnThree">
|
<div ng-transclude="btnFour">
|
||||||
<vn-quick-link
|
<vn-quick-link
|
||||||
tooltip="Go to user"
|
tooltip="Go to user"
|
||||||
state="['account.card.summary', {id: $ctrl.id}]"
|
state="['account.card.summary', {id: $ctrl.id}]"
|
||||||
|
|
|
@ -2,4 +2,5 @@ Simple ticket: Ticket simple
|
||||||
View consumer report: Ver informe de consumo
|
View consumer report: Ver informe de consumo
|
||||||
From date: Fecha desde
|
From date: Fecha desde
|
||||||
To date: Fecha hasta
|
To date: Fecha hasta
|
||||||
Go to user: Ir al usuario
|
Go to user: Ir al usuario
|
||||||
|
Client invoices list: Listado de facturas del cliente
|
|
@ -8,6 +8,14 @@ export default class Controller extends Section {
|
||||||
|
|
||||||
const hasContactData = this.client.email || this.client.phone || this.client.mobile;
|
const hasContactData = this.client.email || this.client.phone || this.client.mobile;
|
||||||
const hasChangedTaxData = !orgData.isTaxDataChecked && this.client.isTaxDataChecked;
|
const hasChangedTaxData = !orgData.isTaxDataChecked && this.client.isTaxDataChecked;
|
||||||
|
|
||||||
|
const shouldInvoice = this.client.isActive && !this.client.hasToInvoice;
|
||||||
|
const clientActivation = this.client.isActive && (orgData.isActive != this.client.isActive);
|
||||||
|
if (shouldInvoice && clientActivation) {
|
||||||
|
this.client.hasToInvoice = true;
|
||||||
|
this.vnApp.showMessage(this.$t('Client invoices enabled'));
|
||||||
|
}
|
||||||
|
|
||||||
if (hasChangedTaxData && hasContactData)
|
if (hasChangedTaxData && hasContactData)
|
||||||
this.checkExistingClient();
|
this.checkExistingClient();
|
||||||
else this.save();
|
else this.save();
|
||||||
|
|
|
@ -50,6 +50,16 @@ describe('Client', () => {
|
||||||
expect(controller.save).not.toHaveBeenCalledWith();
|
expect(controller.save).not.toHaveBeenCalledWith();
|
||||||
expect(controller.checkExistingClient).toHaveBeenCalledWith();
|
expect(controller.checkExistingClient).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should enable the hasToInvoice property any time the form activates the client with isActive', () => {
|
||||||
|
$scope.watcher.orgData.isActive = false;
|
||||||
|
controller.client.isActive = true;
|
||||||
|
controller.client.hasToInvoice = false;
|
||||||
|
|
||||||
|
controller.onSubmit();
|
||||||
|
|
||||||
|
expect(controller.client.hasToInvoice).toBe(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('checkExistingClient()', () => {
|
describe('checkExistingClient()', () => {
|
||||||
|
|
Loading…
Reference in New Issue