| Line 26... |
Line 26... |
| 26 |
|
26 |
|
| 27 |
@NamedQueries({
|
27 |
@NamedQueries({
|
| 28 |
@NamedQuery(name = "InventoryItem.selectCount", query = "select count(ii) from InventoryItem ii"),
|
28 |
@NamedQuery(name = "InventoryItem.selectCount", query = "select count(ii) from InventoryItem ii"),
|
| 29 |
@NamedQuery(name = "InventoryItem.selectByItemId", query = "select ii from InventoryItem ii where ii.itemId = :itemId"),
|
29 |
@NamedQuery(name = "InventoryItem.selectByItemId", query = "select ii from InventoryItem ii where ii.itemId = :itemId"),
|
| 30 |
@NamedQuery(name = "InventoryItem.selectByFofoId", query = "select ii from InventoryItem ii where ii.fofoId = :fofoId"),
|
30 |
@NamedQuery(name = "InventoryItem.selectByFofoId", query = "select ii from InventoryItem ii where ii.fofoId = :fofoId"),
|
| 31 |
//@NamedQuery(name = "InventoryItem.selectBySerialNumber", query = "select ii from InventoryItem ii join Imei i on ii.imeiId = i.id where i.imei = :serialNumber"),
|
- |
|
| 32 |
//@NamedQuery(name = "InventoryItem.selectQuantitySum", query = "select sum(ii.initialQuantity) as inventoryQuantity from InventoryItem ii where ii.itemId = :itemId and ii.fofoId = :fofoId and ii.purchaseReference = :purchaseReference")
|
- |
|
| 33 |
|
- |
|
| 34 |
@NamedQuery(
|
31 |
@NamedQuery(
|
| 35 |
name = "InventoryItem.selectScannedCount",
|
32 |
name = "InventoryItem.selectScannedCount",
|
| 36 |
query = "select ii.itemId, sum(ii.initialQuantity) from InventoryItem ii "
|
33 |
query = "select ii.itemId, sum(ii.initialQuantity) from InventoryItem ii "
|
| 37 |
+ "where ii.itemId in :itemIds and ii.fofoId = :fofoId and ii.purchaseId = :purchaseId group by ii.itemId"),
|
34 |
+ "where ii.itemId in :itemIds and ii.fofoId = :fofoId and ii.purchaseId = :purchaseId group by ii.itemId"),
|
| 38 |
|
35 |
|
| Line 110... |
Line 107... |
| 110 |
private LocalDateTime updateTimestamp = LocalDateTime.now();
|
107 |
private LocalDateTime updateTimestamp = LocalDateTime.now();
|
| 111 |
|
108 |
|
| 112 |
@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
109 |
@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
| 113 |
@JoinColumn(name="item_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
|
110 |
@JoinColumn(name="item_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
|
| 114 |
private Item item;
|
111 |
private Item item;
|
| - |
|
112 |
|
| - |
|
113 |
@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
|
| - |
|
114 |
@JoinColumn(name="purchase_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
|
| - |
|
115 |
private Purchase purchase;
|
| 115 |
|
116 |
|
| 116 |
public int getId() {
|
117 |
public int getId() {
|
| 117 |
return id;
|
118 |
return id;
|
| 118 |
}
|
119 |
}
|
| 119 |
|
120 |
|
| Line 251... |
Line 252... |
| 251 |
|
252 |
|
| 252 |
public void setBuyBack(boolean buyBack) {
|
253 |
public void setBuyBack(boolean buyBack) {
|
| 253 |
this.buyBack = buyBack;
|
254 |
this.buyBack = buyBack;
|
| 254 |
}
|
255 |
}
|
| 255 |
|
256 |
|
| - |
|
257 |
public Purchase getPurchase() {
|
| - |
|
258 |
return purchase;
|
| - |
|
259 |
}
|
| - |
|
260 |
|
| - |
|
261 |
public void setPurchase(Purchase purchase) {
|
| - |
|
262 |
this.purchase = purchase;
|
| - |
|
263 |
}
|
| - |
|
264 |
|
| 256 |
@Override
|
265 |
@Override
|
| 257 |
public int hashCode() {
|
266 |
public int hashCode() {
|
| 258 |
final int prime = 31;
|
267 |
final int prime = 31;
|
| 259 |
int result = 1;
|
268 |
int result = 1;
|
| 260 |
result = prime * result + id;
|
269 |
result = prime * result + id;
|
| Line 281... |
Line 290... |
| 281 |
+ serialNumber + ", initialQuantity=" + initialQuantity + ", goodQuantity=" + goodQuantity
|
290 |
+ serialNumber + ", initialQuantity=" + initialQuantity + ", goodQuantity=" + goodQuantity
|
| 282 |
+ ", badQuantity=" + badQuantity + ", lastScanType=" + lastScanType + ", purchaseId=" + purchaseId
|
291 |
+ ", badQuantity=" + badQuantity + ", lastScanType=" + lastScanType + ", purchaseId=" + purchaseId
|
| 283 |
+ ", unitPrice=" + unitPrice + ", priceDropAmount=" + priceDropAmount + ", buyBack=" + buyBack
|
292 |
+ ", unitPrice=" + unitPrice + ", priceDropAmount=" + priceDropAmount + ", buyBack=" + buyBack
|
| 284 |
+ ", igstRate=" + igstRate + ", cgstRate=" + cgstRate + ", sgstRate=" + sgstRate + ", hsnCode="
|
293 |
+ ", igstRate=" + igstRate + ", cgstRate=" + cgstRate + ", sgstRate=" + sgstRate + ", hsnCode="
|
| 285 |
+ hsnCode + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + ", item="
|
294 |
+ hsnCode + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + ", item="
|
| 286 |
+ item + "]";
|
295 |
+ item + ", purchase=" + purchase + "]";
|
| 287 |
}
|
296 |
}
|
| 288 |
|
- |
|
| 289 |
|
297 |
|
| 290 |
}
|
298 |
}
|