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) { ...@@ -75,6 +75,7 @@ func (d *DB) GetInventary(id int) (inventary Inventary, err error) {
func (d *DB) ListInventary() (inventaries []Inventary, err error) { func (d *DB) ListInventary() (inventaries []Inventary, err error) {
err = d.db.Preload("Products.Product"). err = d.db.Preload("Products.Product").
Preload(clause.Associations). Preload(clause.Associations).
Order("date desc").
Find(&inventaries). Find(&inventaries).
Error Error
return return
......
...@@ -44,8 +44,6 @@ function CreateInventary() { ...@@ -44,8 +44,6 @@ function CreateInventary() {
suppliers.map((s) => <option key={s.ID}>{s.name}</option>) 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 ( return (
<Sender url="/api/inventary" body={body} onSuccess={setRedirect}> <Sender url="/api/inventary" body={body} onSuccess={setRedirect}>
<Form.Group as={Row}> <Form.Group as={Row}>
......
...@@ -18,6 +18,7 @@ function inventaryOverlay(entry) { ...@@ -18,6 +18,7 @@ function inventaryOverlay(entry) {
return ( return (
<div key={"I" + entry.ID + "-" + p.ID}> <div key={"I" + entry.ID + "-" + p.ID}>
{p.comment && <p>p.comment</p>}
{p.product.name + ": " + stock + " " + price} {p.product.name + ": " + stock + " " + price}
<br /> <br />
</div> </div>
...@@ -43,7 +44,6 @@ function InventaryList() { ...@@ -43,7 +44,6 @@ function InventaryList() {
<td>{printDate(i.date)}</td> <td>{printDate(i.date)}</td>
<td>{i.member.name}</td> <td>{i.member.name}</td>
<td>{supplier(i)}</td> <td>{supplier(i)}</td>
<td>{i.comment}</td>
</tr> </tr>
</LinkContainer> </LinkContainer>
</OverlayTrigger> </OverlayTrigger>
...@@ -58,7 +58,6 @@ function InventaryList() { ...@@ -58,7 +58,6 @@ function InventaryList() {
<th>Fecha</th> <th>Fecha</th>
<th>Por</th> <th>Por</th>
<th>Proveedor</th> <th>Proveedor</th>
<th>Comentario</th>
</tr> </tr>
</thead> </thead>
<tbody>{entries}</tbody> <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