| Line 10... |
Line 10... |
| 10 |
import java.time.format.DateTimeFormatter;
|
10 |
import java.time.format.DateTimeFormatter;
|
| 11 |
import java.util.Objects;
|
11 |
import java.util.Objects;
|
| 12 |
|
12 |
|
| 13 |
@NamedQueries({
|
13 |
@NamedQueries({
|
| 14 |
@NamedQuery(name = "InventoryItem.selectScannedCount", query = "select ii.itemId, sum(ii.initialQuantity) from InventoryItem ii "
|
14 |
@NamedQuery(name = "InventoryItem.selectScannedCount", query = "select ii.itemId, sum(ii.initialQuantity) from InventoryItem ii "
|
| 15 |
+ "where ii.itemId in :itemIds and ii.fofoId = :fofoId and ii.purchaseId = :purchaseId group by ii.itemId") })
|
15 |
+ "where ii.itemId in :itemIds and ii.fofoId = :fofoId and ii.purchaseId = :purchaseId group by ii.itemId"),
|
| - |
|
16 |
//For Serialized models
|
| - |
|
17 |
@NamedQuery(name = "InventoryItem.selectAllLineItemIdsByInventoryIds", query = "select new com.spice.profitmandi.dao.model.InventoryItemSaleModel(ii.id, lii.id) from InventoryItem ii" +
|
| - |
|
18 |
" join Purchase p on p.id = ii.purchaseId join Order o on o.invoiceNumber = p.purchaseReference" +
|
| - |
|
19 |
" join LineItem li on li.orderId = o.id join LineItemImei lii on (lii.id=li.id and lii.serialNumber=ii.serialNumber)" +
|
| - |
|
20 |
"where ii.id in :inventoryItemIds")
|
| - |
|
21 |
})
|
| 16 |
@Entity
|
22 |
@Entity
|
| 17 |
@Table(name = "fofo.inventory_item", schema = "fofo")
|
23 |
@Table(name = "fofo.inventory_item", schema = "fofo")
|
| 18 |
public class InventoryItem implements Comparable {
|
24 |
public class InventoryItem implements Comparable {
|
| 19 |
|
25 |
|
| 20 |
public InventoryItem(String serialNumber) {
|
26 |
public InventoryItem(String serialNumber) {
|
| Line 45... |
Line 51... |
| 45 |
@Column(name = "good_quantity")
|
51 |
@Column(name = "good_quantity")
|
| 46 |
private int goodQuantity;
|
52 |
private int goodQuantity;
|
| 47 |
|
53 |
|
| 48 |
@Column(name = "bad_quantity")
|
54 |
@Column(name = "bad_quantity")
|
| 49 |
private int badQuantity;
|
55 |
private int badQuantity;
|
| 50 |
|
56 |
|
| 51 |
@Column(name = "activation_timestamp")
|
57 |
@Column(name = "activation_timestamp")
|
| 52 |
private LocalDateTime activationTimestamp;
|
58 |
private LocalDateTime activationTimestamp;
|
| 53 |
|
59 |
|
| 54 |
@Column(name = "last_scan_type")
|
60 |
@Column(name = "last_scan_type")
|
| 55 |
@Enumerated(EnumType.STRING)
|
61 |
@Enumerated(EnumType.STRING)
|