/****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ package org.compiere.acct; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.ArrayList; import java.util.logging.Level; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; import org.compiere.model.MRequisition; import org.compiere.model.MRequisitionLine; import org.compiere.model.ProductCost; import org.compiere.util.Env; /** * Post {@link MRequisition} Documents. * *
* Table: M_Requisition * Document Types: POR (Requisition) ** * @author Jorg Janke * @version $Id: Doc_Requisition.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $ */ public class Doc_Requisition extends Doc { /** * Constructor * @param as accounting schema * @param rs record * @param trxName trx */ public Doc_Requisition (MAcctSchema as, ResultSet rs, String trxName) { super (as, MRequisition.class, rs, DOCTYPE_PurchaseRequisition, trxName); } // Doc_Requisition /** * Load Specific Document Details * @return error message or null */ @Override protected String loadDocumentDetails () { setC_Currency_ID(NO_CURRENCY); MRequisition req = (MRequisition)getPO(); setDateDoc (req.getDateDoc()); setDateAcct (req.getDateDoc()); // Amounts setAmount(AMTTYPE_Gross, req.getTotalLines()); setAmount(AMTTYPE_Net, req.getTotalLines()); // Contained Objects p_lines = loadLines (req); return null; } // loadDocumentDetails /** * Load Requisition Lines * @param req requisition * @return DocLine Array */ private DocLine[] loadLines (MRequisition req) { ArrayList
* Reservation * Expense CR * Offset DR ** @param as accounting schema * @return Fact */ @Override public ArrayList