Debug logs
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4172229051
commit
d7b563c5ec
|
@ -20,6 +20,8 @@ module.exports = async function(request, response, next) {
|
||||||
if (toDate >= todayMinDate && toDate <= todayMaxDate)
|
if (toDate >= todayMinDate && toDate <= todayMaxDate)
|
||||||
throw new Error('You cannot close tickets for today');
|
throw new Error('You cannot close tickets for today');
|
||||||
|
|
||||||
|
console.log(`Making closure up to ${toDate}...`);
|
||||||
|
|
||||||
const tickets = await db.rawSql(`
|
const tickets = await db.rawSql(`
|
||||||
SELECT
|
SELECT
|
||||||
t.id,
|
t.id,
|
||||||
|
|
|
@ -7,11 +7,13 @@ const storage = require('vn-print/core/storage');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async start(tickets, reqArgs) {
|
async start(tickets, reqArgs) {
|
||||||
|
console.log(tickets);
|
||||||
if (tickets.length == 0) return;
|
if (tickets.length == 0) return;
|
||||||
|
|
||||||
const failedtickets = [];
|
const failedtickets = [];
|
||||||
for (const ticket of tickets) {
|
for (const ticket of tickets) {
|
||||||
try {
|
try {
|
||||||
|
console.log(`Closing ticket id ${ticket.id}...`);
|
||||||
await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]);
|
await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]);
|
||||||
|
|
||||||
const invoiceOut = await db.findOne(`
|
const invoiceOut = await db.findOne(`
|
||||||
|
|
Loading…
Reference in New Issue