Merge branch 'test' into dev
gitea/salix/dev This commit has test failures Details

This commit is contained in:
Gerard 2019-04-01 08:43:22 +02:00
commit 164093af48
3 changed files with 29 additions and 34 deletions

View File

@ -22,7 +22,7 @@
<vn-table model="model"> <vn-table model="model">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th>Date</vn-th> <vn-th expand>Date</vn-th>
<vn-th number order="DESC">Ticket/Entry</vn-th> <vn-th number order="DESC">Ticket/Entry</vn-th>
<vn-th>State</vn-th> <vn-th>State</vn-th>
<vn-th>Reference</vn-th> <vn-th>Reference</vn-th>
@ -40,7 +40,7 @@
ng-repeat="sale in sales" ng-repeat="sale in sales"
vn-repeat-last vn-repeat-last
on-last="$ctrl.scrollToLine()"> on-last="$ctrl.scrollToLine()">
<vn-td> <vn-td expand>
<span class="chip" <span class="chip"
ng-class="::{warning: $ctrl.isToday(sale.date)}"> ng-class="::{warning: $ctrl.isToday(sale.date)}">
{{::sale.date | dateTime:'dd/MM/yyyy' }} {{::sale.date | dateTime:'dd/MM/yyyy' }}

View File

@ -82,7 +82,8 @@ module.exports = {
return database.pool.query( return database.pool.query(
`SELECT `SELECT
t.id, t.id,
t.shipped t.shipped,
t.companyFk
FROM ticket t FROM ticket t
JOIN client c ON c.id = t.clientFk JOIN client c ON c.id = t.clientFk
JOIN account.user u ON u.id = c.id JOIN account.user u ON u.id = c.id
@ -105,34 +106,27 @@ module.exports = {
fetchSales(ticketFk) { fetchSales(ticketFk) {
return database.pool.query( return database.pool.query(
`SELECT `SELECT
s.id, s.id,
s.itemFk, s.itemFk,
s.concept, s.concept,
s.quantity, s.quantity,
s.price, s.price,
s.price - SUM(IF(ctr.id = 6, s.price - SUM(IF(ctr.id = 6,
sc.value, sc.value,
0)) netPrice, 0)) netPrice,
s.discount, s.discount,
i.size, i.size,
i.stems, i.stems,
i.category, i.category,
it.id itemTypeId, it.id itemTypeId,
o.code AS origin, o.code AS origin,
i.inkFk, i.inkFk,
s.ticketFk, s.ticketFk,
tcl.code vatType, tcl.code vatType,
ibwg.ediBotanic, ibwg.ediBotanic, ppa.denomination, pp.number passportNumber,
ppa.denomination, be.isProtectedZone, c.code AS countryCode,
pp.number passportNumber, i.tag5, i.value5,
be.isProtectedZone, i.tag6, i.value6, i.tag7, i.value7
c.code AS countryCode,
ita.tag1,
ita.val1,
ita.tag2,
ita.val2,
ita.tag3,
ita.val3
FROM vn.sale s FROM vn.sale s
LEFT JOIN saleComponent sc ON sc.saleFk = s.id LEFT JOIN saleComponent sc ON sc.saleFk = s.id
LEFT JOIN componentRate cr ON cr.id = sc.componentFk LEFT JOIN componentRate cr ON cr.id = sc.componentFk
@ -146,7 +140,6 @@ module.exports = {
LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id
AND itc.countryFk = sp.countryFk AND itc.countryFk = sp.countryFk
LEFT JOIN taxClass tcl ON tcl.id = itc.taxClassFk LEFT JOIN taxClass tcl ON tcl.id = itc.taxClassFk
LEFT JOIN itemTagArranged ita ON ita.itemFk = s.itemFk
LEFT JOIN plantpassport pp ON pp.producerFk = i.producerFk LEFT JOIN plantpassport pp ON pp.producerFk = i.producerFk
LEFT JOIN plantpassportAuthority ppa ON ppa.id = pp.plantpassportAuthorityFk LEFT JOIN plantpassportAuthority ppa ON ppa.id = pp.plantpassportAuthorityFk
LEFT JOIN itemBotanicalWithGenus ibwg ON ibwg.itemFk = i.id LEFT JOIN itemBotanicalWithGenus ibwg ON ibwg.itemFk = i.id

View File

@ -46,12 +46,14 @@ module.exports = {
FROM client c FROM client c
JOIN account.user u ON u.id = c.id JOIN account.user u ON u.id = c.id
JOIN country ct ON ct.id = c.countryFk JOIN country ct ON ct.id = c.countryFk
JOIN mandate m ON m.clientFk = c.id AND m.finished IS NULL JOIN mandate m ON m.clientFk = c.id
AND m.companyFk = ? AND m.finished IS NULL
JOIN supplier s ON s.id = m.companyFk JOIN supplier s ON s.id = m.companyFk
JOIN country sc ON sc.id = s.countryFk JOIN country sc ON sc.id = s.countryFk
JOIN province sp ON sp.id = s.provinceFk JOIN province sp ON sp.id = s.provinceFk
LEFT JOIN province p ON p.id = c.provinceFk LEFT JOIN province p ON p.id = c.provinceFk
WHERE m.companyFk = ? AND c.id = ?`, [companyFk, clientFk]); WHERE m.companyFk = ? AND c.id = ?
ORDER BY m.created DESC LIMIT 1`, [companyFk, companyFk, clientFk]);
}, },
dated: () => { dated: () => {
return strftime('%d-%m-%Y', new Date()); return strftime('%d-%m-%Y', new Date());