hotfix savesign dms hasFile #1474
|
@ -53,7 +53,7 @@ async function test() {
|
|||
const JunitReporter = require('jasmine-reporters');
|
||||
jasmine.addReporter(new JunitReporter.JUnitXmlReporter());
|
||||
|
||||
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
|
||||
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
|
||||
jasmine.exitOnCompletion = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,6 @@
|
|||
</vn-tr>
|
||||
</vn-tbody>
|
||||
</vn-table>
|
||||
<vn-pagination model="model"></vn-pagination>
|
||||
</vn-card>
|
||||
</vn-data-viewer>
|
||||
<vn-worker-descriptor-popover vn-id="workerDescriptor">
|
||||
|
|
|
@ -68,7 +68,9 @@
|
|||
<th field="stateFk">
|
||||
<span translate>State</span>
|
||||
</th>
|
||||
<th field="isFragile"></th>
|
||||
<th field="isFragile" number>
|
||||
<span translate>Fragile</span>
|
||||
</th>
|
||||
<th field="zoneFk">
|
||||
<span translate>Zone</span>
|
||||
</th>
|
||||
|
|
|
@ -30,35 +30,47 @@ module.exports = Self => {
|
|||
const ticketLogs = await models.TicketLog.find(
|
||||
{
|
||||
where: {
|
||||
and: [
|
||||
{originFk: id},
|
||||
{action: 'update'},
|
||||
{changedModel: 'Sale'}
|
||||
or: [
|
||||
{
|
||||
and: [
|
||||
{originFk: id},
|
||||
{action: 'update'},
|
||||
{changedModel: 'Sale'}
|
||||
]
|
||||
},
|
||||
{
|
||||
and: [
|
||||
{originFk: id},
|
||||
{action: 'delete'},
|
||||
{changedModel: 'Sale'}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
fields: [
|
||||
'oldInstance',
|
||||
'newInstance',
|
||||
'changedModelId'
|
||||
'changedModelId',
|
||||
'changedModelValue'
|
||||
],
|
||||
}, myOptions);
|
||||
|
||||
const changes = [];
|
||||
for (const ticketLog of ticketLogs) {
|
||||
const oldQuantity = ticketLog.oldInstance.quantity;
|
||||
const newQuantity = ticketLog.newInstance.quantity;
|
||||
|
||||
for (const log of ticketLogs) {
|
||||
const oldQuantity = log.oldInstance.quantity;
|
||||
const newQuantity = log.newInstance?.quantity || 0;
|
||||
|
||||
if (oldQuantity || newQuantity) {
|
||||
const sale = await models.Sale.findById(ticketLog.changedModelId, null, myOptions);
|
||||
const message = $t('Change quantity', {
|
||||
concept: sale.concept,
|
||||
oldQuantity: oldQuantity || 0,
|
||||
newQuantity: newQuantity || 0,
|
||||
});
|
||||
|
||||
changes.push(message);
|
||||
const changeMessage = $t('Change quantity', {
|
||||
concept: log.changedModelValue,
|
||||
oldQuantity: oldQuantity || 0,
|
||||
newQuantity: newQuantity || 0,
|
||||
});
|
||||
changes.push(changeMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changes.join('\n');
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue