Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
4005d6f82a
|
@ -210,6 +210,9 @@
|
|||
</slot-table>
|
||||
</smart-table>
|
||||
</vn-card>
|
||||
<vn-ticket-descriptor-popover
|
||||
vn-id="ticketDescriptor">
|
||||
</vn-ticket-descriptor-popover>
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
for (let attachment of options.attachments) {
|
||||
const fileName = attachment.filename;
|
||||
const filePath = attachment.path;
|
||||
if (fileName.includes('.png')) return;
|
||||
if (fileName.includes('.png')) continue;
|
||||
|
||||
if (fileName || filePath)
|
||||
attachments.push(filePath ? filePath : fileName);
|
||||
|
|
|
@ -11,15 +11,17 @@ module.exports = async function(request, response, next) {
|
|||
if (reqArgs.to) toDate = reqArgs.to;
|
||||
|
||||
const todayMinDate = new Date();
|
||||
minDate.setHours(0, 0, 0, 0);
|
||||
todayMinDate.setHours(0, 0, 0, 0);
|
||||
|
||||
const todayMaxDate = new Date();
|
||||
maxDate.setHours(23, 59, 59, 59);
|
||||
todayMinDate.setHours(23, 59, 59, 59);
|
||||
|
||||
// Prevent closure for current day
|
||||
if (toDate >= todayMinDate && toDate <= todayMaxDate)
|
||||
throw new Error('You cannot close tickets for today');
|
||||
|
||||
console.log(`Making closure up to ${toDate}...`);
|
||||
|
||||
const tickets = await db.rawSql(`
|
||||
SELECT
|
||||
t.id,
|
||||
|
|
|
@ -7,11 +7,13 @@ const storage = require('vn-print/core/storage');
|
|||
|
||||
module.exports = {
|
||||
async start(tickets, reqArgs) {
|
||||
console.log(tickets);
|
||||
if (tickets.length == 0) return;
|
||||
|
||||
const failedtickets = [];
|
||||
for (const ticket of tickets) {
|
||||
try {
|
||||
console.log(`Closing ticket id ${ticket.id}...`);
|
||||
await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]);
|
||||
|
||||
const invoiceOut = await db.findOne(`
|
||||
|
|
Loading…
Reference in New Issue