package com.dev.swms.client.ui.javabean;

import com.google.gwt.user.client.rpc.IsSerializable;


public class PT_DETAILS implements IsSerializable {
	
	private Long pickTicketDetailId;
	private Long itemId;
	private Long packageUnitId;
	
	private Integer packageUnitConvertFigure;

	private String itemCode;
	private String itemName;
	private String packageUnit;
	
	private double orderQuantity;
	private double orderQtyOfMasterUnit;
	private double preAllocatedQuantity;
	private double allocatedQuantity;
	private double pickedQuantity;
	private double shippedQuantity;
	
	private String newLotInfo;
	private String propC1;
	private String propC2;
	private String propC3;
	private String propC4;
	private String propC5;
	private String propC6;
	private String propC7;
	private String propC8;
	private String propC9;
	
	private String propN1;
	private String propN2;
	private String propN3;
	
	private String propD1;
	private String propD2;
	private String propD3;
	
	private String propL1;
	private String propL2;
	private String propL3;
	
	public PT_DETAILS(){
		
	}
	
	public PT_DETAILS(Object pickTicketDetailId,Object itemId,Object packageUnitId,Object packageUnitConvertFigure,
			Object itemCode,Object itemName,Object packageUnit,Object orderQuantity,Object orderQtyOfMasterUnit,
			Object preAllocatedQuantity,Object allocatedQuantity,Object pickedQuantity,Object shippedQuantity,
			Object newLotInfo,Object propC1,Object propC2,Object propC3,Object propC4,Object propC5,Object propC6,
			Object propC7,Object propC8,Object propC9,Object propN1,Object propN2,Object propN3,Object propD1,
			Object propD2,Object propD3,Object propL1,Object propL2,Object propL3){
		
		this.pickTicketDetailId = (Long)pickTicketDetailId;
		this.itemId = (Long)itemId;
		this.packageUnitId = (Long)packageUnitId;
		this.packageUnitConvertFigure = (Integer)packageUnitConvertFigure;
		this.itemCode = (String)itemCode;
		this.itemName = (String)itemName;
		this.packageUnit = (String)packageUnit;
		this.orderQuantity = (Double)orderQuantity;
		this.orderQtyOfMasterUnit = (Double)orderQtyOfMasterUnit;
		this.preAllocatedQuantity = (Double)preAllocatedQuantity;
		this.allocatedQuantity = (Double)allocatedQuantity;
		this.pickedQuantity = pickedQuantity == null? 0D : (Double)pickedQuantity;
		this.shippedQuantity = shippedQuantity == null? 0D : (Double)shippedQuantity;
		//this.newLotInfo = (NewLotInfo)newLotInfo;
		this.propC1 = propC1 == null?"" : (String)propC1;
		this.propC2 = propC2 == null?"" : (String)propC2;
		this.propC3 = propC3 == null?"" : (String)propC3;
		this.propC4 = propC4 == null?"" : (String)propC4;
		this.propC5 = propC5 == null?"" : (String)propC5;
		this.propC6 = propC6 == null?"" : (String)propC6;
		this.propC7 = propC7 == null?"" : (String)propC7;
		this.propC8 = propC8 == null?"" : (String)propC8;
		this.propC9 = propC9 == null?"" : (String)propC9;
		this.propN1 = propN1 == null?"" : (String)propN1;
		this.propN2 = propN2 == null?"" : (String)propN2;
		this.propN3 = propN3 == null?"" : (String)propN3;
		this.propD1 = propD1 == null?"" : (String)propD1;
		this.propD2 = propD2 == null?"" : (String)propD2;
		this.propD3 = propD3 == null?"" : (String)propD3;
		this.propL1 = propL1 == null?"" : (String)propL1;
		this.propL2 = propL2 == null?"" : (String)propL2;
		this.propL3 = propL3 == null?"" : (String)propL3;
		this.newLotInfo = this.toLotInfor(this.propC1, this.propC2, this.propC3, this.propC4, this.propC5, this.propC6, this.propC7, this.propC8, 
				this.propC9, this.propN1, this.propN2, this.propN3, this.propD1, this.propD2, this.propD3, this.propL1, this.propL2, this.propL3);							
	}
	
	
	public String toLotInfor(String propC1,String propC2,String propC3,String propC4,String propC5,String propC6,
			String propC7,String propC8,String propC9,String propN1,String propN2,String propN3,String propD1,
			String propD2,String propD3,String propL1,String propL2,String propL3){
		
		String result = "";
		if(propC1 != null && !"".equals(propC1)){
			result += "#" + propC1;
		}
		if(propC2 != null && !"".equals(propC2)){
			result += "#" + propC2;
		}
		if(propC3 != null && !"".equals(propC3)){
			result += "#" + propC3;
		}
		if(propC4 != null && !"".equals(propC4)){
			result += "#" + propC4;
		}
		if(propC5 != null && !"".equals(propC5)){
			result += "#" + propC5;
		}
		if(propC6 != null && !"".equals(propC6)){
			result += "#" + propC6;
		}
		if(propC7 != null && !"".equals(propC7)){
			result += "#" + propC7;
		}
		if(propC8 != null && !"".equals(propC8)){
			result += "#" + propC8;
		}
		if(propC9 != null && !"".equals(propC9)){
			result += "#" + propC9;
		}
		if(propN1 != null && !"".equals(propN1)){
			result += "#" + propN1;
		}
		if(propN2 != null && !"".equals(propN2)){
			result += "#" + propN2;
		}
		if(propN3 != null && !"".equals(propN3)){
			result += "#" + propN3;
		}
		if(propD1 != null && !"".equals(propD1)){
			result += "#" + propD1;
		}
		if(propD2 != null && !"".equals(propD2)){
			result += "#" + propD2;
		}
		if(propD3 != null && !"".equals(propD3)){
			result += "#" + propD3;
		}
		if(propL1 != null && !"".equals(propL1)){
			result += "#" + propL1;
		}
		if(this.propL2 != null && !"".equals(propL2)){
			result += "#" + propL2;
		}
		if(propL3 != null && !"".equals(propL3)){
			result += "#" + propL3;
		}

		if( result != null ){
			result = result.replaceFirst("#", "");
		}
		return result;
	}
	
	public Long getPickTicketDetailId() {
		return pickTicketDetailId;
	}
	public void setPickTicketDetailId(Long pickTicketDetailId) {
		this.pickTicketDetailId = pickTicketDetailId;
	}
	public Long getItemId() {
		return itemId;
	}
	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}
	public Long getPackageUnitId() {
		return packageUnitId;
	}
	public void setPackageUnitId(Long packageUnitId) {
		this.packageUnitId = packageUnitId;
	}
	public Integer getPackageUnitConvertFigure() {
		return packageUnitConvertFigure;
	}
	public void setPackageUnitConvertFigure(Integer packageUnitConvertFigure) {
		this.packageUnitConvertFigure = packageUnitConvertFigure;
	}
	public String getItemCode() {
		return itemCode;
	}
	public void setItemCode(String itemCode) {
		this.itemCode = itemCode;
	}
	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public String getPackageUnit() {
		return packageUnit;
	}
	public void setPackageUnit(String packageUnit) {
		this.packageUnit = packageUnit;
	}
	public double getOrderQuantity() {
		return orderQuantity;
	}
	public void setOrderQuantity(double orderQuantity) {
		this.orderQuantity = orderQuantity;
	}
	public double getPreAllocatedQuantity() {
		return preAllocatedQuantity;
	}
	public void setPreAllocatedQuantity(double preAllocatedQuantity) {
		this.preAllocatedQuantity = preAllocatedQuantity;
	}
	public double getAllocatedQuantity() {
		return allocatedQuantity;
	}
	public void setAllocatedQuantity(double allocatedQuantity) {
		this.allocatedQuantity = allocatedQuantity;
	}
	public double getPickedQuantity() {
		return pickedQuantity;
	}
	public void setPickedQuantity(double pickedQuantity) {
		this.pickedQuantity = pickedQuantity;
	}
	public double getShippedQuantity() {
		return shippedQuantity;
	}
	public void setShippedQuantity(double shippedQuantity) {
		this.shippedQuantity = shippedQuantity;
	}
	public String getLotInfor() {
		return newLotInfo;
	}
	public void setLotInfor(String newLotInfo) {
		this.newLotInfo = newLotInfo;
	}

	public String getPropC1() {
		return propC1;
	}
	public void setPropC1(String propC1) {
		this.propC1 = propC1;
	}
	public String getPropC2() {
		return propC2;
	}
	public void setPropC2(String propC2) {
		this.propC2 = propC2;
	}
	public String getPropC3() {
		return propC3;
	}
	public void setPropC3(String propC3) {
		this.propC3 = propC3;
	}
	public String getPropC4() {
		return propC4;
	}
	public void setPropC4(String propC4) {
		this.propC4 = propC4;
	}
	public String getPropC5() {
		return propC5;
	}
	public void setPropC5(String propC5) {
		this.propC5 = propC5;
	}
	public String getPropC6() {
		return propC6;
	}
	public void setPropC6(String propC6) {
		this.propC6 = propC6;
	}
	public String getPropC7() {
		return propC7;
	}
	public void setPropC7(String propC7) {
		this.propC7 = propC7;
	}
	public String getPropC8() {
		return propC8;
	}
	public void setPropC8(String propC8) {
		this.propC8 = propC8;
	}
	public String getPropC9() {
		return propC9;
	}
	public void setPropC9(String propC9) {
		this.propC9 = propC9;
	}
	public String getPropN1() {
		return propN1;
	}
	public void setPropN1(String propN1) {
		this.propN1 = propN1;
	}
	public String getPropN2() {
		return propN2;
	}
	public void setPropN2(String propN2) {
		this.propN2 = propN2;
	}
	public String getPropN3() {
		return propN3;
	}
	public void setPropN3(String propN3) {
		this.propN3 = propN3;
	}
	public String getPropD1() {
		return propD1;
	}
	public void setPropD1(String propD1) {
		this.propD1 = propD1;
	}
	public String getPropD2() {
		return propD2;
	}
	public void setPropD2(String propD2) {
		this.propD2 = propD2;
	}
	public String getPropD3() {
		return propD3;
	}
	public void setPropD3(String propD3) {
		this.propD3 = propD3;
	}
	public String getPropL1() {
		return propL1;
	}
	public void setPropL1(String propL1) {
		this.propL1 = propL1;
	}
	public String getPropL2() {
		return propL2;
	}
	public void setPropL2(String propL2) {
		this.propL2 = propL2;
	}
	public String getPropL3() {
		return propL3;
	}
	public void setPropL3(String propL3) {
		this.propL3 = propL3;
	}

	public double getOrderQtyOfMasterUnit() {
		return orderQtyOfMasterUnit;
	}

	public void setOrderQtyOfMasterUnit(double orderQtyOfMasterUnit) {
		this.orderQtyOfMasterUnit = orderQtyOfMasterUnit;
	}

	public Object[] toArray(){		
		return  new Object[]{this.pickTicketDetailId,this.itemId,this.packageUnitId,this.packageUnitConvertFigure,
		this.itemCode,this.itemName,this.packageUnit,this.orderQuantity,this.orderQtyOfMasterUnit,
		this.preAllocatedQuantity,this.allocatedQuantity,this.pickedQuantity,this.shippedQuantity,
		this.newLotInfo,this.propC1,this.propC2,this.propC3,this.propC4,this.propC5,this.propC6,
		this.propC7,this.propC8,this.propC9,this.propN1,this.propN2,this.propN3,this.propD1,
		this.propD2,this.propD3,this.propL1,this.propL2,this.propL3		
		};

	}
}
