#6276 createNewWarehouse methods migrated from silex to salix #1850
|
@ -42,7 +42,12 @@ module.exports = Self => {
|
|||
|
||||
const [tickets] = await Self.rawSql('CALL vn.collection_getTickets(?)', [id], myOptions);
|
||||
|
||||
await setState(source, id, myOptions);
|
||||
if (source) {
|
||||
await Self.rawSql(
|
||||
'CALL vn.ticketStateToday_setState(?,?)', [id, source], options
|
||||
);
|
||||
}
|
||||
jorgep marked this conversation as resolved
Outdated
|
||||
|
||||
const [sales] = await Self.rawSql('CALL vn.sale_getFromTicketOrCollection(?)',
|
||||
[id], myOptions);
|
||||
|
||||
|
@ -151,16 +156,4 @@ module.exports = Self => {
|
|||
AND tr.landed >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)`;
|
||||
return Self.rawSql(query, [ticketId], options);
|
||||
jorgep marked this conversation as resolved
Outdated
jgallego
commented
@sergiodt ací no pots pasar desde front el codi correcte i evitem fer esta conversió? @sergiodt ací no pots pasar desde front el codi correcte i evitem fer esta conversió?
jorgep
commented
Corregido, lo pasará desde el front. Corregido, lo pasará desde el front.
|
||||
}
|
||||
|
||||
async function setState(source, id, options) {
|
||||
const states = {
|
||||
'PRECHECKER': 'PREVIOUS_CONTROL',
|
||||
'CHECKER': 'ON_CHECKING'
|
||||
};
|
||||
if (states[source]) {
|
||||
await Self.rawSql(
|
||||
'CALL vn.ticketStateToday_setState(?,?)', [id, states[source]], options
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
picker i checker no son el mateix..