entry index changes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Bernat Exposito 2021-01-19 12:50:11 +01:00
parent 727fcddc3d
commit 426249f9bf
3 changed files with 32 additions and 18 deletions

View File

@ -148,19 +148,27 @@ module.exports = Self => {
s.name AS supplierName,
s.nickname AS supplierAlias,
co.code AS companyCode,
cu.code AS currencyCode
cu.code AS currencyCode,
IF(b.buyingValue, SUM(b.quantity * b.buyingValue), 0) AS totalEntry
FROM vn.entry e
JOIN vn.supplier s ON s.id = e.supplierFk
JOIN vn.travel t ON t.id = e.travelFk
JOIN vn.company co ON co.id = e.companyFk
JOIN vn.currency cu ON cu.id = e.currencyFk`
JOIN vn.currency cu ON cu.id = e.currencyFk
LEFT JOIN vn.buy b ON b.entryFk = e.id`
);
stmt.merge(conn.makeWhere(filter.where));
stmt.merge(conn.makeGroupBy('b.entryFk'));
stmt.merge(conn.makeOrderBy('t.landed DESC'));
stmt.merge(conn.makeLimit(filter));
// stmts.push(stmt);
stmt.merge(conn.makeSuffix(filter));
// stmt.merge(conn.makeSuffix(filter));
let itemsIndex = stmts.push(stmt) - 1;
let sql = ParameterizedSQL.join(stmts, ';');
let result = await conn.executeStmt(sql);
return itemsIndex === 0 ? result : result[itemsIndex];
};
};

View File

@ -13,12 +13,11 @@
<vn-th field="landed" center expand>Landed</vn-th>
<vn-th>Reference</vn-th>
<vn-th field="supplierFk">Supplier</vn-th>
<vn-th field="currencyFk" center>Currency</vn-th>
<vn-th field="companyFk" center>Company</vn-th>
<vn-th>Import</vn-th>
<vn-th field="isBooked" center>Booked</vn-th>
<vn-th field="isConfirmed" center>Confirmed</vn-th>
<vn-th field="isOrdered" center>Ordered</vn-th>
<vn-th>Notes</vn-th>
<vn-th shrink></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
@ -49,19 +48,17 @@
</vn-td>
<vn-td expand>{{::entry.ref}}</vn-td>
<vn-td expand>{{::entry.supplierName}}</vn-td>
<vn-td center expand>{{::entry.currencyCode}}</vn-td>
<vn-td center expand>{{::entry.companyCode}}</vn-td>
<vn-td expand>{{::entry.totalEntry | currency: 'EUR': 2}}</vn-td>
<vn-td center><vn-check ng-model="entry.isBooked" disabled="true"></vn-check></vn-td>
<vn-td center><vn-check ng-model="entry.isConfirmed" disabled="true"></vn-check></vn-td>
<vn-td center><vn-check ng-model="entry.isOrdered" disabled="true"></vn-check></vn-td>
<vn-td shrink>
<vn-icon
ng-if="entry.notes.length"
vn-tooltip="{{::entry.notes}}"
icon="insert_drive_file"
class="bright">
</vn-icon>
</vn-td>
<vn-horizontal class="buttons">
<vn-icon-button
vn-click-stop="$ctrl.preview(entry)"
vn-tooltip="Preview"
icon="preview">
</vn-icon-button>
</vn-horizontal>
</a>
</vn-tbody>
</vn-table>
@ -70,7 +67,11 @@
<vn-travel-descriptor-popover
vn-id="travelDescriptor">
</vn-travel-descriptor-popover>
<vn-popup vn-id="summary">
<vn-entry-summary
entry="$ctrl.entrySelected">
</vn-entry-summary>
</vn-popup>
<div fixed-bottom-right>
<vn-vertical style="align-items: center;">
<a ui-sref="entry.create" vn-bind="+">

View File

@ -1,7 +1,12 @@
import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {}
export default class Controller extends Section {
preview(entry) {
this.entrySelected = entry;
this.$.summary.show();
}
}
ngModule.vnComponent('vnEntryIndex', {
template: require('./index.html'),