Skip to content

Commit

Permalink
TrialBalance, HRConcept, SAValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanneCalderon committed Jul 13, 2023
1 parent 106d680 commit 412689e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 13 deletions.
6 changes: 1 addition & 5 deletions base/src/org/shw/model/SAValidatorNEW.java
Original file line number Diff line number Diff line change
Expand Up @@ -1181,10 +1181,6 @@ private String CreateCTAJPayment(MRequest req, MPayment pay) {

private void CreateCTAJPaymentAllocs(MPayment pay) {
String description = "";
int r_status = 0;

if (r_status == 0)
return;
int chargeID;
MPaymentAllocate[] pAllocs = MPaymentAllocate.get(pay);
for (MPaymentAllocate alloc : pAllocs) {
Expand Down Expand Up @@ -1225,8 +1221,8 @@ private void CreateCTAJPaymentAllocs(MPayment pay) {
oLine.set_ValueOfColumn("isSplitInvoice", bpartner.get_ValueAsBoolean("isSplitInvoice"));
oLine.saveEx();
req.setC_Payment_ID(pay.getC_Payment_ID());
req.setR_Status_ID(r_status);
req.setSalesRep_ID(req.getCreatedBy());
req.setC_OrderLine_ID(oLine.getC_OrderLine_ID());
req.saveEx();
description = description + " " + order.getDocumentNo();
alloc.set_ValueOfColumn("ControlAmt", oLine.getLineNetAmt());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ protected void executeTrialBalanceProcess(int column, String selectedIdList)
para.save();
}


if (m_AD_Org_ID>0) {
para = new MPInstancePara(mpInstance, 30);
para.setParameter("AD_Org_ID", m_AD_Org_ID);
para.save();

}
para = new MPInstancePara(mpInstance, 40);
para.setParameter("PostingType", (column == 4 || column == 7) ? "A" : "B");
para.save();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2006-2017 ADempiere Foundation, 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 *
* or (at your option) any later version. *
* 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 *
* or via [email protected] *
* or https://github.com/adempiere/adempiere/blob/develop/license.html *
*****************************************************************************/

package org.spin.hr.engine;


import java.util.Map;

import org.compiere.util.Env;
import org.eevolution.hr.model.MHRProcess;
import org.spin.hr.util.RuleInterface;


/** Generated Process for (groovy:AFP_EP Deducciones AFP Empleado)
* Description: Usado en concepto R_AFP_EP, usado en regla SNET
* Help:
Double salarioRealizado = getHistoryConceptPeriod("R_SBAS_NOMINA");
Double salarioActual = getConcept("R_SBAS_NOMINA");
Double salarioCalculado = (salarioRealizado + salarioActual) * getFactorPeriod();
Double AFPTotal = salarioCalculado * getConcept("P_AFP_EP");
Double AFPRealizado = getHistoryConceptPeriod("R_AFP_EP");
Double AFPPendiente = AFPTotal - AFPRealizado;
Double AFPPagable = AFPPendiente / getCountMissingPeriods();
result = AFPPagable;
* @author ADempiere (generated)
* @version Release 3.9.3
*/
public class groovy_AFP_EP implements RuleInterface {

String description = null;

@Override
public Object run(MHRProcess process, Map<String, Object> engineContext) {

double result = 0;
description = null;
int countryID = Env.getContextAsInt(process.getCtx(), "#C_Country_ID");
Double AFPRate = process.getConcept("P_AFP_EP");
Double salarioCalculado = process.getConceptType("IngresosAFP_ISSS");
Double AFPTotal = salarioCalculado * AFPRate;
result = AFPTotal;
return result;
}

@Override
public String getDescription() {
return description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,21 @@ private void initLayout()
//
Row row = new Row();
rows.appendChild(row);
row.setSpans("1, 1, 1, 1");
//row.setSpans("1, 1, 1, 1");
row.appendChild(labelOrg.rightAlign());
row.appendChild(fieldOrg.getComponent());
row.appendChild(labelAcctSchema.rightAlign());
row.appendChild(fieldAcctSchema.getComponent());
row.appendChild(labelBPartner.rightAlign());
row.appendChild(fieldBPartner.getComponent());
//
//row = new Row();
//rows.appendChild(row);
//row.setSpans("1, 1, 1, 1");
//
row = new Row();
rows.appendChild(row);
row.setSpans("1, 1, 1, 1");
row.appendChild(labelOrg.rightAlign());
row.appendChild(fieldOrg.getComponent());
//row.setSpans("1, 1, 1, 1");
row.appendChild(labelProduct.rightAlign());
row.appendChild(fieldProduct.getComponent());
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ private Box createFavouritesPanel()
AD_Tree_ID = 10; // Menu

m_AD_Tree_ID = AD_Tree_ID;

int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");

MTree vTree = new MTree(Env.getCtx(), AD_Tree_ID, false, true, null);
MTreeNode m_root = vTree.getRoot();
Expand All @@ -113,8 +115,13 @@ private Box createFavouritesPanel()
Enumeration<?> en = ndTop.preorderEnumeration();
while (en.hasMoreElements())
{
MTreeNode nd = (MTreeNode)en.nextElement();
if (nd.isOnBar()) {
MTreeNode nd = (MTreeNode)en.nextElement();
StringBuffer sql = new StringBuffer();
sql.append("SELECT COUNT(*) FROM AD_TreeBar WHERE AD_Tree_ID=?")
.append(" AND AD_User_ID=").append(AD_User_ID)
.append(" AND Node_ID=").append(nd.getNode_ID());
int no = DB.getSQLValueEx(null, sql.toString(), m_AD_Tree_ID);
if (no>0) {
String label = nd.toString().trim();
ToolBarButton btnFavItem = new ToolBarButton(String.valueOf(nd.getNode_ID()));
btnFavItem.setLabel(label);
Expand Down

0 comments on commit 412689e

Please sign in to comment.