@ -14,10 +14,11 @@ import javax.persistence.Table;
@Entity
@Table ( name = "ORDER_ITEM" )
public class OrderItem {
public class OrderItem
{
@Id
@Column ( name = "ID" )
@Column ( name = "ID" )
@GeneratedValue
private int id ;
@ -30,24 +31,21 @@ public class OrderItem {
@Column ( name = "TEXTITEM" )
private String textItem ;
@Column ( name = "QUANTITY" , precision = 15 , scale = 4 )
@Column ( name = "QUANTITY" , precision = 15 , scale = 4 )
private BigDecimal quantity ;
@Embedded
private MUnitEmb munit ;
@Column ( name = "UNITPRICE" , precision = 15 , scale = 4 )
@Column ( name = "UNITPRICE" , precision = 15 , scale = 4 )
private BigDecimal unitPrice ;
@Column ( name = "TOTAL" , precision = 15 , scale = 4 )
@Column ( name = "TOTAL" , precision = 15 , scale = 4 )
private BigDecimal total ;
@Column ( name = "DESCRIPTION" )
private String description ;
@Column ( name = "TOTALINVOICE" , precision = 15 , scale = 4 )
private BigDecimal totalInvoice ;
@ManyToOne ( fetch = FetchType . EAGER )
@JoinColumn ( name = "REQUIREMENT_ITEM_ID" )
private RequirementItem reqItem ;
@ -56,11 +54,13 @@ public class OrderItem {
@JoinColumn ( name = "ORDER_ID" )
private Order order ;
public OrderItem ( ) {
public OrderItem ( )
{
super ( ) ;
}
public OrderItem ( RequirementItem reqItem ) {
public OrderItem ( RequirementItem reqItem )
{
super ( ) ;
this . reqItem = reqItem ;
this . code = reqItem . getCode ( ) ;
@ -71,104 +71,115 @@ public class OrderItem {
this . munit = reqItem . getMunit ( ) ;
this . total = reqItem . getTotal ( ) ;
this . description = reqItem . getDescription ( ) ;
this . totalInvoice = BigDecimal . ZERO ;
}
public int getId ( ) {
public int getId ( )
{
return id ;
}
public void setId ( int id ) {
public void setId ( int id )
{
this . id = id ;
}
public String getCode ( ) {
public String getCode ( )
{
return code ;
}
public void setCode ( String code ) {
public void setCode ( String code )
{
this . code = code ;
}
public String getName ( ) {
public String getName ( )
{
return name ;
}
public void setName ( String name ) {
public void setName ( String name )
{
this . name = name ;
}
public String getTextItem ( ) {
public String getTextItem ( )
{
return textItem ;
}
public void setTextItem ( String textItem ) {
public void setTextItem ( String textItem )
{
this . textItem = textItem ;
}
public BigDecimal getQuantity ( ) {
public BigDecimal getQuantity ( )
{
return quantity ;
}
public void setQuantity ( BigDecimal quantity ) {
public void setQuantity ( BigDecimal quantity )
{
this . quantity = quantity ;
}
public MUnitEmb getMunit ( ) {
public MUnitEmb getMunit ( )
{
return munit ;
}
public void setMunit ( MUnitEmb munit ) {
public void setMunit ( MUnitEmb munit )
{
this . munit = munit ;
}
public BigDecimal getUnitPrice ( ) {
public BigDecimal getUnitPrice ( )
{
return unitPrice ;
}
public void setUnitPrice ( BigDecimal unitPrice ) {
public void setUnitPrice ( BigDecimal unitPrice )
{
this . unitPrice = unitPrice ;
}
public BigDecimal getTotal ( ) {
public BigDecimal getTotal ( )
{
return total ;
}
public void setTotal ( BigDecimal total ) {
public void setTotal ( BigDecimal total )
{
this . total = total ;
}
public String getDescription ( ) {
public String getDescription ( )
{
return description ;
}
public void setDescription ( String description ) {
this . description = description ;
}
public BigDecimal getTotalInvoice ( )
public void setDescription ( String description )
{
return totalInvoice ;
this . description = description ;
}
public void setTotalInvoice ( BigDecimal totalInvoice )
public RequirementItem getReqItem ( )
{
this . totalInvoice = totalInvoice ;
}
public RequirementItem getReqItem ( ) {
return reqItem ;
}
public void setReqItem ( RequirementItem reqItem ) {
public void setReqItem ( RequirementItem reqItem )
{
this . reqItem = reqItem ;
}
public Order getOrder ( ) {
public Order getOrder ( )
{
return order ;
}
public void setOrder ( Order order ) {
public void setOrder ( Order order )
{
this . order = order ;
}