refs #4457 move sql, remove await on front @2h

This commit is contained in:
Pau 2022-11-15 10:37:12 +01:00
parent 9d0cd36afe
commit 6339634756
7 changed files with 14 additions and 16 deletions

View File

@ -1,10 +0,0 @@
INSERT INTO `util`.`notificationSubscription` (notificationFk,userFk)
VALUES
(2,3401),
(2,10549),
(2,15680),
(2,19663),
(2,20041),
(2,997),
(2,3377),
;

View File

@ -35,7 +35,8 @@ class Controller extends ModuleCard {
'credit',
'email',
'phone',
'mobile'
'mobile',
'hasInvoiceElectronic',
],
include: {
relation: 'salesPersonUser',

View File

@ -243,9 +243,7 @@ class Controller extends Section {
async makeInvoice() {
const params = {ticketsIds: [this.id]};
const clientData = await this.$http.get(`Clients/${this.ticket.client.id}`);
/* const clientData = await this.$http.get(`Clients/${this.ticket.client.id}`);
if (clientData.data.hasInvoiceElectronic) {
this.$http.post(`NotificationQueues`, {
notificationFk: 'invoiceElectronic',
@ -255,7 +253,15 @@ class Controller extends Section {
This should call the notification sistem to insert a new notification
in te queue, yet to check how to handle user permissions,
as of 08-11-2022 every employee can insert a new notification in the queue
*/
}*/
const client = this.ticket.client;
if (client.hasInvoiceElectronic) {
this.$http.post(`NotificationQueues`, {
notificationFk: 'invoiceElectronic',
authorFk: client.id,
});
}
return this.$http.post(`Tickets/makeInvoice`, params)

View File

@ -39,7 +39,8 @@ class Controller extends Descriptor {
'name',
'isActive',
'isFreezed',
'isTaxDataChecked'
'isTaxDataChecked',
'hasInvoiceElectronic',
],
include: {
relation: 'salesPersonUser',