diff --git a/base/src/org/compiere/acct/Doc.java b/base/src/org/compiere/acct/Doc.java index 3362510f79..d4c682576c 100644 --- a/base/src/org/compiere/acct/Doc.java +++ b/base/src/org/compiere/acct/Doc.java @@ -60,6 +60,7 @@ import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Trx; +import org.eevolution.model.MHRProcess; /** * Posting Document Root. @@ -132,7 +133,8 @@ public abstract class Doc MMatchInv.Table_ID, // M_MatchInv MMatchPO.Table_ID, // M_MatchPO MProjectIssue.Table_ID, // C_ProjectIssue - MRequisition.Table_ID // M_Requisition + MRequisition.Table_ID, // M_Requisition + MHRProcess.Table_ID // MR_Process }; /** Table Names of documents */ @@ -151,7 +153,8 @@ public abstract class Doc MMatchInv.Table_Name, // M_MatchInv MMatchPO.Table_Name, // M_MatchPO MProjectIssue.Table_Name, // C_ProjectIssue - MRequisition.Table_Name // M_Requisition + MRequisition.Table_Name, // M_Requisition + MHRProcess.Table_Name // HR_Process }; /************************************************************************** @@ -214,6 +217,8 @@ public abstract class Doc public static final String DOCTYPE_ProjectIssue = "PJI"; /** Purchase Requisition */ public static final String DOCTYPE_PurchaseRequisition = "POR"; + /** Process Payroll **/ + public static final String DOCTYPE_Payroll = "HRP"; @@ -333,6 +338,8 @@ public abstract class Doc doc = new Doc_ProjectIssue (ass, rs, trxName); else if (AD_Table_ID == MRequisition.Table_ID) doc = new Doc_Requisition (ass, rs, trxName); + else if (AD_Table_ID == MHRProcess.Table_ID) + doc = new Doc_Payroll (ass, rs, trxName); if (doc == null) s_log.log(Level.SEVERE, "Unknown AD_Table_ID=" + AD_Table_ID); return doc; diff --git a/base/src/org/compiere/acct/DocLine_Payroll.java b/base/src/org/compiere/acct/DocLine_Payroll.java new file mode 100644 index 0000000000..a188b6deb1 --- /dev/null +++ b/base/src/org/compiere/acct/DocLine_Payroll.java @@ -0,0 +1,100 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * 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 * + * Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. * + * Contributor(s): Victor Perez www.e-evolution.com * + *****************************************************************************/ +package org.compiere.acct; + +import java.math.*; + +import org.compiere.model.*; +import org.compiere.util.*; +import org.compiere.acct.*; +import org.eevolution.model.*; + +/** + * Payroll Line + * + * @author Jorg Janke + * @version $Id: DocLine_Payroll.java,v 1.4 2005/10/17 23:43:52 jjanke Exp $ + */ +public class DocLine_Payroll extends DocLine +{ + /** + * Constructor + * @param line Payroll line + * @param doc header + */ + public DocLine_Payroll (MHRMovement line, Doc_Payroll doc) + { + super (line, doc); + int C_BPartner_ID = line.getC_BPartner_ID(); + MBPartner bpartner = new MBPartner(Env.getCtx(),C_BPartner_ID,null); + //MHREmployee employee = new MHREmployee(Env.getCtx(),C_BPartner_ID,null); + MHRConcept concept = new MHRConcept(Env.getCtx(),line.getHR_Concept_ID(),null); + // + m_HR_Concept_ID = concept.getHR_Concept_ID(); + m_HR_Process_ID = line.getHR_Process_ID(); + m_C_BPartner_ID = C_BPartner_ID; + m_HR_Department_ID = line.getHR_Department_ID(); + m_C_BP_Group_ID = bpartner.getC_BP_Group_ID(); + //m_C_Activity_ID = employee.getC_Activity_ID(); + m_AccountSign = concept.getAccountSign(); + m_Amount = line.getAmount(); + setAmount(line.getAmount()); + } // DocLine_Payroll + + // References + private int m_HR_Process_ID = 0; + private int m_HR_Concept_ID = 0; + private int m_C_BPartner_ID = 0; + private int m_C_Activity_ID = 0; + private String m_AccountSign = ""; + private BigDecimal m_Amount = Env.ZERO; + private int m_HR_Department_ID = 0; + private int m_C_BP_Group_ID = 0; + + public int getHR_Process_ID(){ + return m_HR_Process_ID; + } + + public int getHR_Concept_ID(){ + return m_HR_Concept_ID; + } + + public String getAccountSign(){ + return m_AccountSign; + } + + public int getC_BPartner_ID(){ + return m_C_BPartner_ID; + } + + public int getC_Activity_ID(){ + return m_C_Activity_ID; + } + + + public BigDecimal getAmount() { + return m_Amount; + } + + public int getHR_Department_ID() { + return m_HR_Department_ID; + } + + public int getC_BP_Group_ID() { + return m_C_BP_Group_ID; + } + +} // DocLine_Payroll diff --git a/base/src/org/compiere/acct/Doc_Payroll.java b/base/src/org/compiere/acct/Doc_Payroll.java new file mode 100644 index 0000000000..fb4b53f1b0 --- /dev/null +++ b/base/src/org/compiere/acct/Doc_Payroll.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * 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 * + * Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. * + * Contributor(s): Victor Perez www.e-evolution.com * + *****************************************************************************/ +package org.compiere.acct; + +import org.eevolution.model.*; + +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.Level; + +import org.compiere.model.*; +import org.compiere.util.*; + + +/** + * Post Invoice Documents. + *
+ * Table: HR_Process (??) + * Document Types: HR_Process + *+ * @author Oscar Gomez Islas + * @version $Id: Doc_Payroll.java,v 1.1 2007/01/20 00:40:02 ogomezi Exp $ + */ +public class Doc_Payroll extends Doc +{ + public MHRProcess process = null; + /** + * Constructor + * @param ass accounting schemata + * @param rs record + * @parem trxName trx + */ + protected Doc_Payroll (MAcctSchema[] ass, ResultSet rs, String trxName) + { + super(ass, MHRProcess.class, rs, DOCTYPE_Payroll, trxName); + } // Doc_Payroll + + /** + * Load Specific Document Details + * @return error message or null + */ + protected String loadDocumentDetails () + { + process = (MHRProcess)getPO(); + setDateDoc(getDateAcct()); + // Contained Objects + p_lines = loadLines(process); + log.fine("Lines=" + p_lines.length); + return null; + } // loadDocumentDetails + + + /** + * Load Payroll Line + * @param Payroll Process + * @return DocLine Array + */ + private DocLine[] loadLines(MHRProcess process) + { + ArrayList