2479-factura-ticket #521

Merged
jgallego merged 6 commits from 2479-factura-ticket into dev 2021-01-22 15:15:50 +00:00
2 changed files with 53 additions and 0 deletions
Showing only changes of commit 4cdbb85e30 - Show all commits

View File

@ -51,6 +51,20 @@ module.exports = function(Self) {
let serial = result.serial;
let stmts = [];
await Self.rawSql('CALL invoiceFromTicket(?)', [id], options);
await Self.rawSql('CALL invoiceOut_new(?, CURDATE(), null, @invoiceId)', [serial], options);
let [resultInvoice] = await Self.rawSql('SELECT @invoiceId id', options);
let invoiceId = resultInvoice.id;
if serial != 'R' && invoiceId && invoiceId > 0
{
await Self.rawSql('CALL invoiceOutBooking(?)', [invoiceId], options);
INSERT INTO printServerQueue(priorityFk, reportFk, param1, workerFk) VALUES(1, 3, vInvoiceId, account.myUser_getId());
stmt = new ParameterizedSQL('CALL vn.invoiceOut_newFromTicket(?, ?, ?, @invoiceId)', [
ticket.id,
serial,

View File

@ -0,0 +1,39 @@
{
"name": "PrintServerQueue",
"description": "Print server queue",
"base": "VnModel",
"options": {
"mysql": {
"table": "printServerQueue"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"priorityFk": {
"type": "number"
},
"reportFk": {
"type": "number",
"required": true
},
"param1": {
"type": "number"
},
"workerFk": {
"type": "number",
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}