7806_devToTest_2332 #2801

Merged
alexm merged 126 commits from 7806_devToTest_2330 into test 2024-07-30 06:14:09 +00:00
9 changed files with 37 additions and 41 deletions
Showing only changes of commit c6bcf6f488 - Show all commits

View File

@ -29,7 +29,7 @@ module.exports = Self => {
SELECT COUNT(*) > 0 isCustomer SELECT COUNT(*) > 0 isCustomer
FROM salix.Account A FROM salix.Account A
JOIN salix.Role r ON r.id = A.roleFK JOIN salix.Role r ON r.id = A.roleFK
WHERE r.name = 'customer' WHERE r.name IN ('customer', 'supplier')
AND A.id IN (?)`; AND A.id IN (?)`;
const [result] = await Self.rawSql(query, [id], myOptions); const [result] = await Self.rawSql(query, [id], myOptions);
const {isCustomer} = result; const {isCustomer} = result;

View File

@ -95,6 +95,16 @@ module.exports = Self => {
type: 'date', type: 'date',
description: `The to date filter` description: `The to date filter`
}, },
{
arg: 'fromShipped',
type: 'date',
description: `The from shipped date filter`
},
{
arg: 'toShipped',
type: 'date',
description: `The to shipped date filter`
},
{ {
arg: 'days', arg: 'days',
type: 'number', type: 'number',
@ -133,8 +143,12 @@ module.exports = Self => {
return {'e.created': {gte: value}}; return {'e.created': {gte: value}};
case 'from': case 'from':
return {'t.landed': {gte: value}}; return {'t.landed': {gte: value}};
case 'fromShipped':
return {'t.shipped': {gte: value}};
case 'to': case 'to':
return {'t.landed': {lte: value}}; return {'t.landed': {lte: value}};
case 'toShipped':
return {'t.shipped': {lte: value}};
case 'id': case 'id':
case 'isBooked': case 'isBooked':
case 'isConfirmed': case 'isConfirmed':

View File

@ -62,8 +62,11 @@ export default class Controller extends Section {
setDefaultFilter() { setDefaultFilter() {
let today = Date.vnNew(); let today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const tomorrow = new Date(today); const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1); tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(23, 59, 59, 999);
this.$http.get(`UserConfigs/getUserConfig`) this.$http.get(`UserConfigs/getUserConfig`)
.then(res => { .then(res => {
this.filterParams = { this.filterParams = {
@ -86,15 +89,6 @@ export default class Controller extends Section {
return checkedLines; return checkedLines;
} }
dateRange(value) {
const minHour = new Date(value);
minHour.setHours(0, 0, 0, 0);
const maxHour = new Date(value);
maxHour.setHours(23, 59, 59, 59);
return [minHour, maxHour];
}
totalPriceColor(totalWithVat) { totalPriceColor(totalWithVat) {
return this.isLessThan50(totalWithVat) ? 'warning' : ''; return this.isLessThan50(totalWithVat) ? 'warning' : '';
} }

View File

@ -36,24 +36,6 @@ describe('Component vnTicketAdvance', () => {
}); });
}); });
describe('dateRange()', () => {
it('should return two dates with the hours at the start and end of the given date', () => {
const now = Date.vnNew();
const today = now.getDate();
const dateRange = controller.dateRange(now);
const start = dateRange[0].toString();
const end = dateRange[1].toString();
expect(start).toContain(today);
expect(start).toContain('00:00:00');
expect(end).toContain(today);
expect(end).toContain('23:59:59');
});
});
describe('moveTicketsAdvance()', () => { describe('moveTicketsAdvance()', () => {
it('should make an HTTP Post query', () => { it('should make an HTTP Post query', () => {
jest.spyOn(controller.$.model, 'refresh'); jest.spyOn(controller.$.model, 'refresh');

View File

@ -33,9 +33,6 @@ span {
.barcode { .barcode {
text-align: center; text-align: center;
} }
#variant { .one-third {
width: 314px; width: 314px;
} }
#producer {
width: 471px;
}

View File

@ -4,7 +4,7 @@
<tbody> <tbody>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div id="variant" class="cell"> <div class="cell one-third">
<span class="lbl">{{$t('variety')}}</span> <span class="lbl">{{$t('variety')}}</span>
{{buy.name}} {{buy.name}}
</div> </div>
@ -63,18 +63,24 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="2">
<div id="producer" class="cell"> <div class="cell one-third">
<span class="lbl">{{$t('producer')}}</span> <span class="lbl">{{$t('producer')}}</span>
{{buy.producer}} {{buy.producer}}
</div> </div>
</td> </td>
<td>
<div class="cell">
<span class="lbl">{{$t('control')}}</span>
{{`${weekNum} / ${dayNum}`}}
</div>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<div class="cell"> <div class="cell one-third">
<span class="lbl">{{$t('control')}}</span> <span class="lbl">{{$t('reference')}}</span>
{{`${weekNum} / ${dayNum}`}} {{buy.comment}}
</div> </div>
</td> </td>
<td> <td>

View File

@ -10,3 +10,4 @@ unitSale: Un. sale
producer: Producer producer: Producer
control: Control control: Control
boxNum: Box no. boxNum: Box no.
reference: Reference

View File

@ -10,3 +10,4 @@ saleUnit: Sale un.
producer: Productor producer: Productor
control: Control control: Control
boxNum: Caja nº boxNum: Caja nº
reference: Referencia

View File

@ -20,7 +20,8 @@ SELECT ROW_NUMBER() OVER(ORDER BY b.id, num.n) labelNum,
i.stems, i.stems,
b.id, b.id,
b.itemFk, b.itemFk,
p.name producer p.name producer,
i.comment
FROM buy b FROM buy b
JOIN item i ON i.id = b.itemFk JOIN item i ON i.id = b.itemFk
LEFT JOIN producer p ON p.id = i.producerFk LEFT JOIN producer p ON p.id = i.producerFk