⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 morder.java

📁 Java写的ERP系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
		return (Timestamp)getValue ("DateOrdered");
	}

	public static final String InvoiceRule_AfterOrderDelivered = "O";
	public static final String InvoiceRule_AfterDelivery = "D";
	public static final String InvoiceRule_CustomerScheduleAfterDelivery = "S";
	public static final String InvoiceRule_Immediate = "I";

	public void setInvoiceRule (String InvoiceRule)
	{
		if (InvoiceRule.equals ("D") || InvoiceRule.equals ("I")
		  || InvoiceRule.equals ("O") || InvoiceRule.equals ("S"))
			;
		else
			throw new IllegalArgumentException (
			  "InvoiceRule Invalid value - Reference_ID=150 - D - I - O - S");
		if (InvoiceRule == null)
			throw new IllegalArgumentException ("InvoiceRule is mandatory");
		setValue ("InvoiceRule", InvoiceRule);
	}

	public String getInvoiceRule ()
	{
		return (String)getValue ("InvoiceRule");
	}

	void setC_Currency_ID (int C_Currency_ID)
	{
		setValueNoCheck ("C_Currency_ID", new Integer (C_Currency_ID));
	}

	public int getC_Currency_ID ()
	{
		Integer ii = (Integer)getValue ("C_Currency_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public static final String DocStatus_Drafted = "DR";
	public static final String DocStatus_Completed = "CO";
	public static final String DocStatus_Approved = "AP";
	public static final String DocStatus_Changed = "CH";
	public static final String DocStatus_NotApproved = "NA";
	public static final String DocStatus_TransferError = "TE";
	public static final String DocStatus_Printed = "PR";
	public static final String DocStatus_Transferred = "TR";
	public static final String DocStatus_Voided = "VO";
	public static final String DocStatus_Inactive = "IN";
	public static final String DocStatus_PostingError = "PE";
	public static final String DocStatus_Posted = "PO";
	public static final String DocStatus_Reversed = "RE";
	public static final String DocStatus_Closed = "CL";
	public static final String DocStatus_Unknown = "??";
	public static final String DocStatus_BeingProcessed = "XX";
	public static final String DocStatus_InProgress = "IP";
	public static final String DocStatus_WaitingPayment = "WP";

	void setDocStatus (String DocStatus)
	{
		if (DocStatus.equals ("??") || DocStatus.equals ("AP")
		  || DocStatus.equals ("CH") || DocStatus.equals ("CL")
		  || DocStatus.equals ("CO") || DocStatus.equals ("DR")
		  || DocStatus.equals ("IN") || DocStatus.equals ("IP")
		  || DocStatus.equals ("NA") || DocStatus.equals ("PE")
		  || DocStatus.equals ("PO") || DocStatus.equals ("PR")
		  || DocStatus.equals ("RE") || DocStatus.equals ("TE")
		  || DocStatus.equals ("TR") || DocStatus.equals ("VO")
		  || DocStatus.equals ("WP") || DocStatus.equals ("XX"))
			;
		else
			throw new IllegalArgumentException ("DocStatus Invalid value - Reference_ID=131 - ?? - AP - CH - CL - CO - DR - IN - IP - NA - PE - PO - PR - RE - TE - TR - VO - WP - XX");
		if (DocStatus == null)
			throw new IllegalArgumentException ("DocStatus is mandatory");
		setValueNoCheck ("DocStatus", DocStatus);
	}

	public String getDocStatus ()
	{
		return (String)getValue ("DocStatus");
	}


	public static final String		DocAction_Nothing = "--";
	public static final String		DocAction_Close = "CL";
	public static final String		DocAction_Complete = "CO";
	public static final String		DocAction_Process = "PR";
	public static final String		DocAction_Void = "VO";

	public void setDocAction (String DocAction)
	{
		if (DocAction.equals ("--") || DocAction.equals ("AP")
		  || DocAction.equals ("CL") || DocAction.equals ("CO")
		  || DocAction.equals ("PO") || DocAction.equals ("PR")
		  || DocAction.equals ("RA") || DocAction.equals ("RC")
		  || DocAction.equals ("RE") || DocAction.equals ("RJ")
		  || DocAction.equals ("TR") || DocAction.equals ("VO")
		  || DocAction.equals ("XL"))
			;
		else
			throw new IllegalArgumentException ("DocAction Invalid value - Reference_ID=135 - __ - AP - CL - CO - PO - PR - RA - RC - TE - RJ - VO - XL");
		if (DocAction == null)
			throw new IllegalArgumentException ("DocAction is mandatory");
		setValueNoCheck ("DocAction", DocAction);
	}

	public String getDocAction ()
	{
		return (String)getValue ("DocAction");
	}

	public void setM_Warehouse_ID (int M_Warehouse_ID)
	{
		setValue ("M_Warehouse_ID", new Integer (M_Warehouse_ID));
	}

	public int getM_Warehouse_ID ()
	{
		Integer ii = (Integer)getValue ("M_Warehouse_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setC_Campaign_ID (int C_Campaign_ID)
	{
		setValue ("C_Campaign_ID", new Integer (C_Campaign_ID));
	}

	public int getC_Campaign_ID ()
	{
		Integer ii = (Integer)getValue ("C_Campaign_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	void setTotalLines (BigDecimal TotalLines)
	{
		if (TotalLines == null)
			throw new IllegalArgumentException ("TotalLines is mandatory");
		setValueNoCheck ("TotalLines", TotalLines);
	}

	public BigDecimal getTotalLines ()
	{
		BigDecimal bd = (BigDecimal)getValue ("TotalLines");
		if (bd == null)
			return Env.ZERO;
		return bd;
	}

	void setGrandTotal (BigDecimal GrandTotal)
	{
		if (GrandTotal == null)
			throw new IllegalArgumentException ("GrandTotal is mandatory");
		setValueNoCheck ("GrandTotal", GrandTotal);
	}

	public BigDecimal getGrandTotal ()
	{
		BigDecimal bd = (BigDecimal)getValue ("GrandTotal");
		if (bd == null)
			return Env.ZERO;
		return bd;
	}

	public void setPOReference (String POReference)
	{
		setValue ("POReference", POReference);
	}

	public String getPOReference ()
	{
		return (String)getValue ("POReference");
	}

	public void setC_Charge_ID (int C_Charge_ID)
	{
		setValue ("C_Charge_ID", new Integer (C_Charge_ID));
	}

	public int getC_Charge_ID ()
	{
		Integer ii = (Integer)getValue ("C_Charge_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setPriorityRule (String PriorityRule)
	{
		if (PriorityRule.equals ("3") || PriorityRule.equals ("5")
		  || PriorityRule.equals ("7"))
			;
		else
			throw new IllegalArgumentException (
			  "PriorityRule Invalid value - Reference_ID=154 - 3 - 5 - 7");
		if (PriorityRule == null)
			throw new IllegalArgumentException ("PriorityRule is mandatory");
		setValue ("PriorityRule", PriorityRule);
	}

	public String getPriorityRule ()
	{
		return (String)getValue ("PriorityRule");
	}

	public static final String DeliveryViaRule_Pickup = "P";
	public static final String DeliveryViaRule_Delivery = "D";
	public static final String DeliveryViaRule_Shipper = "S";

	public void setDeliveryViaRule (String DeliveryViaRule)
	{
		if (DeliveryViaRule.equals ("D") || DeliveryViaRule.equals ("P")
		  || DeliveryViaRule.equals ("S"))
			;
		else
			throw new IllegalArgumentException (
			  "DeliveryViaRule Invalid value - Reference_ID=152 - D - P - S");
		if (DeliveryViaRule == null)
			throw new IllegalArgumentException ("DeliveryViaRule is mandatory");
		setValue ("DeliveryViaRule", DeliveryViaRule);
	}

	public String getDeliveryViaRule ()
	{
		return (String)getValue ("DeliveryViaRule");
	}

	public void setM_Shipper_ID (int M_Shipper_ID)
	{
		setValue ("M_Shipper_ID", new Integer (M_Shipper_ID));
	}

	public int getM_Shipper_ID ()
	{
		Integer ii = (Integer)getValue ("M_Shipper_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setBillTo_ID (int BillTo_ID)
	{
		setValue ("BillTo_ID", new Integer (BillTo_ID));
	}

	public int getBillTo_ID ()
	{
		Integer ii = (Integer)getValue ("BillTo_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public static final String		PaymentRule_Cash = "B";
	public static final String		PaymentRule_Check = "S";
	public static final String		PaymentRule_CreditCard = "K";
	public static final String		PaymentRule_PaymentTerm = "P";
	public static final String		PaymentRule_Transfer = "T";

	public void setPaymentRule (String PaymentRule)
	{
		if (PaymentRule.equals ("B") || PaymentRule.equals ("K")
		  || PaymentRule.equals ("P") || PaymentRule.equals ("S")
		  || PaymentRule.equals ("T"))
			;
		else
			throw new IllegalArgumentException (
			  "PaymentRule Invalid value - Reference_ID=195 - B - K - P - S - T");
		setValue ("PaymentRule", PaymentRule);
	}

	public String getPaymentRule ()
	{
		return (String)getValue ("PaymentRule");
	}

	/*************************************************************************/

	/**
	 * 	Get Invoices of Order
	 * 	@return invoices
	 */
	public MOrderLine[] getLines()
	{
		ArrayList list = new ArrayList();
		String sql = "SELECT * FROM C_OrderLine WHERE C_Order_ID=? ORDER BY Line DESC";
		PreparedStatement pstmt = null;
		try
		{
			pstmt = DB.prepareStatement(sql);
			pstmt.setInt(1, getC_Order_ID());
			ResultSet rs = pstmt.executeQuery();
			while (rs.next())
			{
				list.add(new MOrderLine(getCtx(), rs));
			}
			rs.close();
			pstmt.close();
			pstmt = null;
		}
		catch (Exception e)
		{
			log.error("getLines", e);
		}
		finally
		{
			try
			{
				if (pstmt != null)
					pstmt.close ();
			}
			catch (Exception e)
			{}
			pstmt = null;
		}
		//
		MOrderLine[] retValue = new MOrderLine[list.size()];
		list.toArray(retValue);
		return retValue;
	}	//	getLines


	/**
	 * 	Get Invoices of Order
	 * 	@return invoices
	 */
	public MInvoice[] getInvoices()
	{
		ArrayList list = new ArrayList();
		String sql = "SELECT * FROM C_Invoice WHERE C_Order_ID=? ORDER BY Created DESC";
		PreparedStatement pstmt = null;
		try
		{
			pstmt = DB.prepareStatement(sql);
			pstmt.setInt(1, getC_Order_ID());
			ResultSet rs = pstmt.executeQuery();
			while (rs.next())
			{
				list.add(new MInvoice(getCtx(), rs));
			}
			rs.close();
			pstmt.close();
			pstmt = null;
		}
		catch (Exception e)
		{
			log.error("getInvoices", e);
		}
		finally
		{
			try
			{
				if (pstmt != null)
					pstmt.close ();
			}
			catch (Exception e)
			{}
			pstmt = null;
		}
		//
		MInvoice[] retValue = new MInvoice[list.size()];
		list.toArray(retValue);
		return retValue;
	}	//	getInvoices

	/**
	 * 	Get Shipments of Order
	 * 	@return shipments
	 */
	public MInOut[] getShipments()
	{
		ArrayList list = new ArrayList();
		String sql = "SELECT * FROM M_InOut WHERE C_Order_ID=? ORDER BY Created DESC";
		PreparedStatement pstmt = null;
		try
		{
			pstmt = DB.prepareStatement(sql);
			pstmt.setInt(1, getC_Order_ID());
			ResultSet rs = pstmt.executeQuery();
			while (rs.next())
			{
				list.add(new MInOut(getCtx(), rs));
			}
			rs.close();
			pstmt.close();
			pstmt = null;
		}
		catch (Exception e)
		{
			log.error("getShipments", e);
		}
		finally
		{
			try
			{
				if (pstmt != null)
					pstmt.close ();
			}
			catch (Exception e)
			{}
			pstmt = null;
		}
		//
		MInOut[] retValue = new MInOut[list.size()];
		list.toArray(retValue);
		return retValue;
	}	//	getShipments


}	//	MOrder

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -