2479-factura-ticket #521
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue