Subversion Repositories SmartDukaan

Rev

Rev 33120 | Rev 33306 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33120 Rev 33182
Line 15... Line 15...
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
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" +
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" +
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)" +
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")
20
                "where ii.id in :inventoryItemIds"),
-
 
21
 
-
 
22
 
-
 
23
        @NamedQuery(name = "InventoryItem.selectItemSaleSummaryModel",
-
 
24
                query = "select new com.spice.profitmandi.dao.model.ItemSaleSummaryModel(" +
-
 
25
                        "lii.id, ii.id, o.billingTimestamp,o.invoiceNumber, cast(li.unitPrice as float), cast(foi.sellingPrice as float), li.item)" +
-
 
26
                        "from InventoryItem ii " +
-
 
27
                        "join Purchase p on p.id = ii.purchaseId " +
-
 
28
                        "join Order o on o.invoiceNumber = p.purchaseReference " +
-
 
29
                        "join LineItem li on li.orderId = o.id " +
-
 
30
                        "join LineItemImei lii on (lii.lineItemId=li.id and lii.serialNumber=ii.serialNumber) " +
-
 
31
                        "join FofoLineItem fli on fli.inventoryItemId=ii.id " +
-
 
32
                        "join FofoOrderItem foi on foi.id=fli.fofoOrderItemId " +
-
 
33
                        "join FofoOrder fo on fo.id = foi.orderId " +
-
 
34
                        "where ii.id in :inventoryItemIds and fo.cancelledTimestamp is null")
-
 
35
 
-
 
36
 
21
})
37
})
22
@Entity
38
@Entity
23
@Table(name = "fofo.inventory_item")
39
@Table(name = "fofo.inventory_item")
24
public class InventoryItem implements Comparable {
40
public class InventoryItem implements Comparable {
25
 
41