#4457 implement notification system, @1h 30m
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
f21907855f
commit
e85505ee8e
|
@ -0,0 +1,2 @@
|
|||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('notificationQueue','*','*','ALLOW','ROLE','invoicing');
|
|
@ -0,0 +1 @@
|
|||
insert into `util`.`notification` (`id`, `name`,`description`) values (2, 'invoiceElectronic', 'A electronic invoice has been generated');
|
|
@ -0,0 +1,3 @@
|
|||
UPDATE `vn`.`client`
|
||||
set hasInvoiceElectronic = TRUE
|
||||
where buisnessTypeFk = 'officialOrganism'
|
|
@ -161,16 +161,10 @@ module.exports = Self => {
|
|||
delete args.ctx;
|
||||
delete args.id;
|
||||
|
||||
console.log(args);
|
||||
|
||||
const updatedClient = await client.updateAttributes(args, myOptions);
|
||||
|
||||
console.log('10');
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
||||
console.log('11');
|
||||
|
||||
return updatedClient;
|
||||
} catch (e) {
|
||||
if (tx) await tx.rollback();
|
||||
|
|
|
@ -224,8 +224,21 @@ class Controller extends Section {
|
|||
this.$.sms.open();
|
||||
}
|
||||
|
||||
makeInvoice() {
|
||||
async makeInvoice() {
|
||||
const params = {ticketsIds: [this.id]};
|
||||
|
||||
const clientData = await this.$http.get(`Clients/${this.ticket.client.id}`);
|
||||
|
||||
console.log('invoiceE', clientData);
|
||||
|
||||
if (clientData.data.hasInvoiceElectronic) {
|
||||
this.$http.post(`NotificationQueuesAdd`, {
|
||||
notificationFk: 'invoiceElectronic'
|
||||
});
|
||||
/* This should call the notification sistem to insert a new notification
|
||||
in te queue, yet to check how to handle user permissions */
|
||||
}
|
||||
|
||||
return this.$http.post(`Tickets/makeInvoice`, params)
|
||||
.then(() => this.reload())
|
||||
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
|
||||
|
|
Loading…
Reference in New Issue