Skip to content
Snippets Groups Projects
Commit 802af4f8 authored by meskio's avatar meskio :tent:
Browse files

Improve inventary presentation

parent 7d0f5ee7
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ func (d *DB) GetInventary(id int) (inventary Inventary, err error) {
func (d *DB) ListInventary() (inventaries []Inventary, err error) {
err = d.db.Preload("Products.Product").
Preload(clause.Associations).
Order("date desc").
Find(&inventaries).
Error
return
......
......@@ -44,8 +44,6 @@ function CreateInventary() {
suppliers.map((s) => <option key={s.ID}>{s.name}</option>)
);
// TODO: debug it, it doesn't send correctly
// it doesnt load picks when they change...
return (
<Sender url="/api/inventary" body={body} onSuccess={setRedirect}>
<Form.Group as={Row}>
......
......@@ -18,6 +18,7 @@ function inventaryOverlay(entry) {
return (
<div key={"I" + entry.ID + "-" + p.ID}>
{p.comment && <p>p.comment</p>}
{p.product.name + ": " + stock + " " + price}
<br />
</div>
......@@ -43,7 +44,6 @@ function InventaryList() {
<td>{printDate(i.date)}</td>
<td>{i.member.name}</td>
<td>{supplier(i)}</td>
<td>{i.comment}</td>
</tr>
</LinkContainer>
</OverlayTrigger>
......@@ -58,7 +58,6 @@ function InventaryList() {
<th>Fecha</th>
<th>Por</th>
<th>Proveedor</th>
<th>Comentario</th>
</tr>
</thead>
<tbody>{entries}</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment