IDEMPIERE-4723 - Clean up iDempiere's code - processes (#1071)

* IDEMPIERE-4723 - Clean up iDempiere's code - processes

* IDEMPIERE-4723 - Clean up iDempiere's code - processes
This commit is contained in:
Diego Ruiz 2021-12-21 12:01:03 +01:00 committed by GitHub
parent 774ba1d427
commit 11f08b539c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 10 additions and 618 deletions

View File

@ -206,40 +206,6 @@ public class AcctSchemaDefaultCopy extends SvrProcess
addLog(0, null, new BigDecimal(created), "@Created@ @C_BP_Group_ID@");
createdTotal += created;
//IDEMPIERE-362 Hide things that don't work on iDempiere
// Update Business Partner - Employee
/*
if (p_CopyOverwriteAcct)
{
sql = new StringBuilder("UPDATE C_BP_Employee_Acct a ")
.append("SET E_Expense_Acct=").append(acct.getE_Expense_Acct())
.append(", E_Prepayment_Acct=").append(acct.getE_Prepayment_Acct())
.append(", Updated=getDate(), UpdatedBy=0 ")
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
.append(" AND EXISTS (SELECT * FROM C_BP_Employee_Acct x ")
.append("WHERE x.C_BPartner_ID=a.C_BPartner_ID)");
updated = DB.executeUpdate(sql.toString(), get_TrxName());
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_BPartner_ID@ @IsEmployee@");
updatedTotal += updated;
}
// Insert new Business Partner - Employee
sql = new StringBuilder("INSERT INTO C_BP_Employee_Acct ")
.append("(C_BPartner_ID, C_AcctSchema_ID,")
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
.append(" E_Expense_Acct, E_Prepayment_Acct) ")
.append("SELECT x.C_BPartner_ID, acct.C_AcctSchema_ID,")
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', getDate(), 0, getDate(), 0,")
.append(" acct.E_Expense_Acct, acct.E_Prepayment_Acct ")
.append("FROM C_BPartner x")
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
.append(" AND NOT EXISTS (SELECT * FROM C_BP_Employee_Acct a ")
.append("WHERE a.C_BPartner_ID=x.C_BPartner_ID")
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
created = DB.executeUpdate(sql.toString(), get_TrxName());
addLog(0, null, new BigDecimal(created), "@Created@ @C_BPartner_ID@ @IsEmployee@");
createdTotal += created;
*/
//
if (!p_CopyOverwriteAcct)
{
@ -415,40 +381,6 @@ public class AcctSchemaDefaultCopy extends SvrProcess
created = DB.executeUpdate(sql.toString(), get_TrxName());
addLog(0, null, new BigDecimal(created), "@Created@ @C_BankAccount_ID@");
createdTotal += created;
//IDEMPIERE-362 Hide things that don't work on iDempiere
// Update Withholding
/*
if (p_CopyOverwriteAcct)
{
sql = new StringBuilder("UPDATE C_Withholding_Acct a ")
.append("SET Withholding_Acct=").append(acct.getWithholding_Acct())
.append(", Updated=getDate(), UpdatedBy=0 ")
.append("WHERE a.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
.append(" AND EXISTS (SELECT * FROM C_Withholding_Acct x ")
.append("WHERE x.C_Withholding_ID=a.C_Withholding_ID)");
updated = DB.executeUpdate(sql.toString(), get_TrxName());
addLog(0, null, new BigDecimal(updated), "@Updated@ @C_Withholding_ID@");
updatedTotal += updated;
}
// Insert new Withholding
sql = new StringBuilder("INSERT INTO C_Withholding_Acct ")
.append("(C_Withholding_ID, C_AcctSchema_ID,")
.append(" AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy,")
.append(" Withholding_Acct) ")
.append("SELECT x.C_Withholding_ID, acct.C_AcctSchema_ID,")
.append(" x.AD_Client_ID, x.AD_Org_ID, 'Y', getDate(), 0, getDate(), 0,")
.append(" acct.Withholding_Acct ")
.append("FROM C_Withholding x")
.append(" INNER JOIN C_AcctSchema_Default acct ON (x.AD_Client_ID=acct.AD_Client_ID) ")
.append("WHERE acct.C_AcctSchema_ID=").append(p_C_AcctSchema_ID)
.append(" AND NOT EXISTS (SELECT * FROM C_Withholding_Acct a ")
.append("WHERE a.C_Withholding_ID=x.C_Withholding_ID")
.append(" AND a.C_AcctSchema_ID=acct.C_AcctSchema_ID)");
created = DB.executeUpdate(sql.toString(), get_TrxName());
addLog(0, null, new BigDecimal(created), "@Created@ @C_Withholding_ID@");
createdTotal += created;
*/
// Update Charge
if (p_CopyOverwriteAcct)

View File

@ -198,15 +198,12 @@ public class Aging extends SvrProcess
int C_Currency_ID = rs.getInt(5);
boolean IsSOTrx = "Y".equals(rs.getString(6));
//
//Timestamp DateInvoiced = rs.getTimestamp(7);
//int NetDays = rs.getInt(8);
Timestamp DueDate = rs.getTimestamp(9);
// Days Due
int DaysDue = rs.getInt(10) // based on today
+ m_statementOffset;
//
BigDecimal GrandTotal = rs.getBigDecimal(11);
//BigDecimal PaidAmt = rs.getBigDecimal(12);
BigDecimal OpenAmt = rs.getBigDecimal(13);
//
int C_Activity_ID = p_IsListInvoices ? rs.getInt(14) : 0;

View File

@ -318,7 +318,7 @@ public class AllocationAuto extends SvrProcess
MInvoice invoice = m_invoices[i];
if (invoice.isPaid())
continue;
// log.fine("allocateIndividualPayments - " + invoice);
if (payment.getC_Invoice_ID() == invoice.getC_Invoice_ID())
{
if (payment.getC_Currency_ID() == invoice.getC_Currency_ID())
@ -470,7 +470,7 @@ public class AllocationAuto extends SvrProcess
if (payment.isAllocated())
continue;
BigDecimal allocatedAmt = payment.getAllocatedAmt();
// log.info("allocateBPartnerAll - " + payment + ", Allocated=" + allocatedAmt);
if (allocatedAmt != null && allocatedAmt.signum() != 0)
continue;
BigDecimal availableAmt = payment.getPayAmt()
@ -482,7 +482,6 @@ public class AllocationAuto extends SvrProcess
// Foreign currency
if (payment.getC_Currency_ID() != C_Currency_ID)
continue;
// log.fine("allocateBPartnerAll - Available=" + availableAmt);
if (dateAcct == null || payment.getDateAcct().after(dateAcct))
dateAcct = payment.getDateAcct();
totalPayments = totalPayments.add(availableAmt);
@ -494,14 +493,12 @@ public class AllocationAuto extends SvrProcess
MInvoice invoice = m_invoices[i];
if (invoice.isPaid())
continue;
// log.info("allocateBPartnerAll - " + invoice);
BigDecimal openAmt = invoice.getOpenAmt(true, null);
if (!invoice.isSOTrx())
openAmt = openAmt.negate();
// Foreign currency
if (invoice.getC_Currency_ID() != C_Currency_ID)
continue;
// log.fine("allocateBPartnerAll - Open=" + openAmt);
if (dateAcct == null || invoice.getDateAcct().after(dateAcct))
dateAcct = invoice.getDateAcct();
totalInvoices = totalInvoices.add(openAmt);
@ -647,9 +644,6 @@ public class AllocationAuto extends SvrProcess
BigDecimal allocatedAmt = payment.getAllocatedAmt();
if (allocatedAmt == null)
allocatedAmt = Env.ZERO;
// comment following lines to allow partial allocation
// if (allocatedAmt != null && allocatedAmt.signum() != 0)
// continue;
BigDecimal availableAmt = payment.getPayAmt()
.add(payment.getDiscountAmt())
.add(payment.getWriteOffAmt())

View File

@ -197,24 +197,5 @@ public class AllocationReset extends SvrProcess
m_trx.rollback();
return success;
} // delete
/**
* Set BPartner (may not be required
*/
/*private void setBPartner()
{
UPDATE C_AllocationLine al
SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_Payment p WHERE al.C_Payment_ID=p.C_Payment_ID)
WHERE C_BPartner_ID IS NULL AND C_Payment_ID IS NOT NULL;
UPDATE C_AllocationLine al
SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_Invoice i WHERE al.C_Invoice_ID=i.C_Invoice_ID)
WHERE C_BPartner_ID IS NULL AND C_Invoice_ID IS NOT NULL;
UPDATE C_AllocationLine al
SET C_BPartner_ID=(SELECT C_BPartner_ID FROM C_Order o WHERE al.C_Order_ID=o.C_Order_ID)
WHERE C_BPartner_ID IS NULL AND C_Order_ID IS NOT NULL;
COMMIT
} // setBPartner*/
} // AllocationReset

View File

@ -116,7 +116,6 @@ public class BPartnerValidate extends SvrProcess
bp.setActualLifeTimeValue();
bp.saveEx();
//
// if (bp.getSO_CreditUsed().signum() != 0)
addLog(0, null, bp.getSO_CreditUsed(), Msg.getElement(getCtx(), "SO_CreditUsed"));
addLog(0, null, bp.getTotalOpenBalance(), Msg.getElement(getCtx(), "TotalOpenBalance"));
addLog(0, null, bp.getActualLifeTimeValue(), Msg.getElement(getCtx(), "ActualLifeTimeValue"));

View File

@ -199,7 +199,6 @@ public class ChangeLogProcess extends SvrProcess
m_oldRecord_ID = cLog.getRecord_ID();
// Insert - new value is null and UnDo only
// m_isInsert = cLog.isNewNull() && p_CheckNewValue != null;
m_isInsert = MChangeLog.EVENTCHANGELOG_Insert.equals(cLog.getEventChangeLog());
if (m_isInsert)
{
@ -312,7 +311,6 @@ public class ChangeLogProcess extends SvrProcess
no = DB.executeUpdate(m_sqlInsert.toString(), get_TrxName());
if (no == -1)
{
// log.warning("Insert failed - " + m_sqlInsert);
m_errors++;
}
else if (no == 0)
@ -331,7 +329,6 @@ public class ChangeLogProcess extends SvrProcess
no = DB.executeUpdate(m_sqlUpdate.toString(), get_TrxName());
if (no == -1)
{
// log.warning("Failed - " + m_sqlUpdate);
m_errors++;
}
else if (no == 0)

View File

@ -81,7 +81,6 @@ public class CommissionAPInvoice extends SvrProcess
invoice.setClientOrg(com.getAD_Client_ID(), com.getAD_Org_ID());
invoice.setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_APInvoice); // API
invoice.setBPartner(bp);
// invoice.setDocumentNo (comRun.getDocumentNo()); // may cause unique constraint
invoice.setSalesRep_ID(getAD_User_ID()); // caller
//
if (com.getC_Currency_ID() != invoice.getC_Currency_ID())

View File

@ -256,9 +256,6 @@ public class CommissionCalc extends SvrProcess
comAmt.saveEx();
} // for all commission lines
// comRun.updateFromAmt();
// comRun.saveEx();
// Save Last Run
m_com.setDateLastRun (p_StartDate);
m_com.saveEx();
@ -329,17 +326,6 @@ public class CommissionCalc extends SvrProcess
}
if (log.isLoggable(Level.FINE)) log.fine("setStartEndDate = " + p_StartDate + " - " + m_EndDate);
/**
String sd = DB.TO_DATE(p_StartDate, true);
StringBuilder sql = new StringBuilder ("SELECT ");
if (MCommission.FREQUENCYTYPE_Quarterly.equals(m_com.getFrequencyType()))
sql.append("TRUNC(").append(sd).append(", 'Q'), TRUNC(").append(sd).append("+92, 'Q')-1");
else if (MCommission.FREQUENCYTYPE_Weekly.equals(m_com.getFrequencyType()))
sql.append("TRUNC(").append(sd).append(", 'DAY'), TRUNC(").append(sd).append("+7, 'DAY')-1");
else // Month
sql.append("TRUNC(").append(sd).append(", 'MM'), TRUNC(").append(sd).append("+31, 'MM')-1");
sql.append(" FROM DUAL");
**/
} // setStartEndDate
/**

View File

@ -112,8 +112,6 @@ public class CopyOrder extends SvrProcess
original.saveEx();
}
//
// Env.setSOTrx(getCtx(), newOrder.isSOTrx());
// return "@C_Order_ID@ " + newOrder.getDocumentNo();
StringBuilder msgreturn = new StringBuilder().append(dt.getName()).append(": ").append(newOrder.getDocumentNo());
addLog(0, null, null, msgreturn.toString(), newOrder.get_Table_ID(), newOrder.getC_Order_ID());
return "@C_Order_ID@ @Created@";

View File

@ -137,45 +137,7 @@ public class CopyProduct extends SvrProcess {
}
count += replenish.size();
// Don't copy purchasing since it demands a unique vendor product no
/*
List<MProductPO> poList = new Query(getCtx(), MProductPO.Table_Name, "M_Product_ID=? AND Discontinued='N'", get_TrxName())
.setParameters(new Object[]{m_copyFromId})
.setOnlyActiveRecords(true)
.list();
MProductPO poSrc;
MProductPO poDst;
for (Iterator<MProductPO> it = poList.iterator(); it.hasNext();) {
poSrc = it.next();
poDst = new MProductPO(getCtx(), 0, get_TrxName());
poDst.setM_Product_ID(toMProductID);
poDst.setC_BPartner_ID(poSrc.getC_BPartner_ID());
poDst.setC_Currency_ID(poSrc.getC_Currency_ID());
poDst.setC_UOM_ID(poSrc.getC_UOM_ID());
poDst.setCostPerOrder(poSrc.getCostPerOrder());
poDst.setDeliveryTime_Actual(poSrc.getDeliveryTime_Actual());
poDst.setDeliveryTime_Promised(poSrc.getDeliveryTime_Promised());
poDst.setIsCurrentVendor(poSrc.isCurrentVendor());
poDst.setManufacturer(poSrc.getManufacturer());
poDst.setOrder_Min(poSrc.getOrder_Min());
poDst.setOrder_Pack(poSrc.getOrder_Pack());
poDst.setPriceEffective(poSrc.getPriceEffective());
poDst.setPriceLastInv(poSrc.getPriceLastInv());
poDst.setPriceLastPO(poSrc.getPriceLastPO());
poDst.setPriceList(poSrc.getPriceList());
poDst.setPricePO(poSrc.getPricePO());
poDst.setQualityRating(poSrc.getQualityRating());
poDst.setRoyaltyAmt(poSrc.getRoyaltyAmt());
// Don't set vendor product no or UPC since that's likely to be different
poDst.setVendorCategory(poSrc.getVendorCategory());
poDst.saveEx(get_TrxName());
}
count += poList.size();
*/
// Copy business partner
List<MBPartnerProduct> bpList = new Query(getCtx(), MBPartnerProduct.Table_Name, "M_Product_ID=?", get_TrxName())
.setParameters(new Object[]{m_copyFromId})
@ -218,52 +180,6 @@ public class CopyProduct extends SvrProcess {
dlDst.saveEx(get_TrxName());
}
count += dlList.size();
// Don't copy accounting because of constraints.
/*
// Delete any current accounting records
DB.executeUpdate("delete from " + X_M_Product_Acct.Table_Name + " where M_Product_ID=" + toMProductID, get_TrxName());
// Copy accounting
List<X_M_Product_Acct> acctList = new Query(getCtx(), X_M_Product_Acct.Table_Name, "M_Product_ID=?", get_TrxName())
.setParameters(new Object[]{m_copyFromId})
.setOnlyActiveRecords(true)
.list();
X_M_Product_Acct acctSrc;
X_M_Product_Acct acctDst;
for (Iterator<X_M_Product_Acct> it = acctList.iterator(); it.hasNext();) {
acctSrc = it.next();
acctDst = new X_M_Product_Acct(getCtx(), 0, get_TrxName());
acctDst.setC_AcctSchema_ID(acctSrc.getC_AcctSchema_ID());
acctDst.setM_Product_ID(toMProductID);
acctDst.setP_Asset_Acct(acctSrc.getP_Asset_Acct());
acctDst.setP_AverageCostVariance_Acct(acctSrc.getP_AverageCostVariance_Acct());
acctDst.setP_Burden_Acct(acctSrc.getP_Burden_Acct());
acctDst.setP_COGS_Acct(acctSrc.getP_COGS_Acct());
acctDst.setP_CostAdjustment_Acct(acctSrc.getP_CostAdjustment_Acct());
acctDst.setP_CostOfProduction_Acct(acctSrc.getP_CostOfProduction_Acct());
acctDst.setP_Expense_Acct(acctSrc.getP_Expense_Acct());
acctDst.setP_FloorStock_Acct(acctSrc.getP_FloorStock_Acct());
acctDst.setP_InventoryClearing_Acct(acctSrc.getP_InventoryClearing_Acct());
acctDst.setP_InvoicePriceVariance_Acct(acctSrc.getP_InvoicePriceVariance_Acct());
acctDst.setP_Labor_Acct(acctSrc.getP_Labor_Acct());
acctDst.setP_MethodChangeVariance_Acct(acctSrc.getP_MethodChangeVariance_Acct());
acctDst.setP_MixVariance_Acct(acctSrc.getP_MixVariance_Acct());
acctDst.setP_OutsideProcessing_Acct(acctSrc.getP_OutsideProcessing_Acct());
acctDst.setP_Overhead_Acct(acctSrc.getP_Overhead_Acct());
acctDst.setP_PurchasePriceVariance_Acct(acctSrc.getP_PurchasePriceVariance_Acct());
acctDst.setP_RateVariance_Acct(acctSrc.getP_RateVariance_Acct());
acctDst.setP_Revenue_Acct(acctSrc.getP_Revenue_Acct());
acctDst.setP_Scrap_Acct(acctSrc.getP_Scrap_Acct());
acctDst.setP_TradeDiscountGrant_Acct(acctSrc.getP_TradeDiscountGrant_Acct());
acctDst.setP_TradeDiscountRec_Acct(acctSrc.getP_TradeDiscountRec_Acct());
acctDst.setP_UsageVariance_Acct(acctSrc.getP_UsageVariance_Acct());
acctDst.setP_WIP_Acct(acctSrc.getP_WIP_Acct());
acctDst.saveEx(get_TrxName());
}
count += acctList.size();
*/
// TODO Auto-generated method stub
return "@Copied@=" + count;

View File

@ -92,7 +92,6 @@ public class CostUpdate extends SvrProcess
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
// log.fine("prepare - " + para[i]);
if (para[i].getParameter() == null)
;
else if (name.equals("M_Product_Category_ID"))

View File

@ -52,9 +52,6 @@ public class DistributionCreate extends SvrProcess
/** Distribution List */
private int p_M_DistributionList_ID;
// DatePromised
// C_DocType_ID
/** Distribution List */
private MDistributionList m_dl;
/** Single Order */

View File

@ -62,8 +62,6 @@ public class DistributionRun extends SvrProcess
private int p_M_DistributionRun_ID = 0;
/** Date Promised */
private Timestamp p_DatePromised = null;
/** Date Promised To */
//private Timestamp p_DatePromised_To = null;
/** Document Type */
private int p_C_DocType_ID = 0;
/** Test Mode */
@ -101,7 +99,7 @@ public class DistributionRun extends SvrProcess
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
// log.fine("prepare - " + para[i]);
if (para[i].getParameter() == null)
;
else if (name.equals("C_DocType_ID"))
@ -112,7 +110,6 @@ public class DistributionRun extends SvrProcess
else if (name.equals("DatePromised"))
{
p_DatePromised = (Timestamp)para[i].getParameter();
//p_DatePromised_To = (Timestamp)para[i].getParameter_To();
}
else if (name.equals("IsTest"))
p_IsTest = "Y".equals(para[i].getParameter());
@ -673,7 +670,6 @@ public class DistributionRun extends SvrProcess
{
pstmt = DB.prepareStatement (sql, get_TrxName());
pstmt.setTimestamp(1, p_DatePromised);
//pstmt.setTimestamp(2, p_DatePromised_To);
pstmt.setInt(2, p_M_Warehouse_ID);
pstmt.setInt(3, M_Product_ID);
@ -733,7 +729,6 @@ public class DistributionRun extends SvrProcess
.append("INNER JOIN M_DistributionListLine ll ON (rl.M_DistributionList_ID=ll.M_DistributionList_ID) ")
.append("INNER JOIN DD_Order o ON (o.C_BPartner_ID=ll.C_BPartner_ID) ")
.append("INNER JOIN DD_OrderLine ol ON (ol.DD_Order_ID=o.DD_Order_ID AND ol.M_Product_ID=rl.M_Product_ID) AND ol.DatePromised")
//+ " BETWEEN " + DB.TO_DATE(p_DatePromised) +" AND "+ DB.TO_DATE(p_DatePromised_To)
.append( "<=").append(DB.TO_DATE(p_DatePromised))
.append(" INNER JOIN M_Locator loc ON (loc.M_Locator_ID=ol.M_Locator_ID AND loc.M_Warehouse_ID=").append(p_M_Warehouse_ID).append(") ")
.append(" WHERE rl.M_DistributionRun_ID=").append(p_M_DistributionRun_ID).append(" AND l.RatioTotal<>0 AND rl.IsActive='Y' AND ll.IsActive='Y'");
@ -815,8 +810,6 @@ public class DistributionRun extends SvrProcess
line.setDescription(m_run.getName());
line.saveEx();
break;
//addLog(0,null, detail.getActualAllocation(), order.getDocumentNo()
// + ": " + bp.getName() + " - " + product.getName());
}
}
@ -1027,7 +1020,6 @@ public class DistributionRun extends SvrProcess
line.setQty(QtyAllocation);
line.setQtyEntered(QtyAllocation);
//line.setTargetQty(detail.getActualAllocation());
line.setTargetQty(Env.ZERO);
String Description ="";
if (m_run.getName() != null)
@ -1035,7 +1027,6 @@ public class DistributionRun extends SvrProcess
StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty"))
.append(" = ").append(QtyAllocation).append(" ");
line.setDescription(msgline.toString());
//line.setConfirmedQty(QtyAllocation);
line.saveEx();
}
else
@ -1052,7 +1043,6 @@ public class DistributionRun extends SvrProcess
StringBuilder msgline = new StringBuilder(Description).append(" ").append(Msg.translate(getCtx(), "Qty")).append(" = ").append(QtyAllocation).append(" ");
line.setDescription(msgline.toString());
line.setQty(line.getQtyEntered().add(QtyAllocation));
//line.setConfirmedQty(line.getConfirmedQty().add( QtyAllocation));
line.saveEx();
}
}
@ -1062,12 +1052,6 @@ public class DistributionRun extends SvrProcess
MDDOrderLine line = new MDDOrderLine(order);
if (counter && bp.getAD_OrgBP_ID() > 0)
; // don't overwrite counter doc
/*else // normal - optionally overwrite
{
line.setC_BPartner_ID(detail.getC_BPartner_ID());
if (detail.getC_BPartner_Location_ID() != 0)
line.setC_BPartner_Location_ID(detail.getC_BPartner_Location_ID());
}*/
//
line.setAD_Org_ID(bp.getAD_OrgBP_ID());
line.setM_Locator_ID(m_locator.getM_Locator_ID());
@ -1076,9 +1060,7 @@ public class DistributionRun extends SvrProcess
line.setProduct(product);
line.setQty(detail.getActualAllocation());
line.setQtyEntered(detail.getActualAllocation());
//line.setTargetQty(detail.getActualAllocation());
line.setTargetQty(Env.ZERO);
//line.setConfirmedQty(detail.getActualAllocation());
String Description ="";
if (m_run.getName() != null)
Description =Description.concat(m_run.getName());

View File

@ -97,14 +97,13 @@ public class DunningPrint extends SvrProcess
// Need to have Template
if (p_EMailPDF && p_R_MailText_ID == 0)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@");
// String subject = "";
MMailText mText = null;
if (p_EMailPDF)
{
mText = new MMailText (getCtx(), p_R_MailText_ID, get_TrxName());
if (p_EMailPDF && mText.get_ID() == 0)
throw new AdempiereUserError ("@NotFound@: @R_MailText_ID@ - " + p_R_MailText_ID);
// subject = mText.getMailHeader();
}
//
MDunningRun run = new MDunningRun (getCtx(), p_C_DunningRun_ID, get_TrxName());

View File

@ -169,7 +169,6 @@ public class DunningRunCreate extends SvrProcess
sql.append(" AND i.C_Currency_ID=").append(p_C_Currency_ID);
if ( p_AD_Org_ID != 0 )
sql.append(" AND i.AD_Org_ID=").append(p_AD_Org_ID);
// if (log.isLoggable(Level.INFO)) log.info(sql);
String sql2= "";

View File

@ -57,7 +57,6 @@ public class EntityTypeRegister extends SvrProcess
throw new AdempiereSystemError("To register an Entity Type, contact Adempiere directly");
// return "Not Supported Yet";
} // doIt
} // EntityTypeRegister

View File

@ -183,7 +183,6 @@ public class ExpenseAPInvoice extends SvrProcess
il.setC_Activity_ID(line.getC_Activity_ID());
il.setC_Campaign_ID(line.getC_Campaign_ID());
//
// il.setPrice(); // not really a list/limit price for reimbursements
il.setPrice(line.getPriceReimbursed()); //
il.setTax();

View File

@ -217,8 +217,6 @@ public class FactAcctReset extends SvrProcess
docBaseType = "= '" + MPeriodControl.DOCBASETYPE_PaymentAllocation + "'";
else if (AD_Table_ID == MJournal.Table_ID)
docBaseType = "= '" + MPeriodControl.DOCBASETYPE_GLJournal + "'";
// else if (AD_Table_ID == M.Table_ID)
// docBaseType = "= '" + MPeriodControl.DOCBASETYPE_GLDocument + "'";
else if (AD_Table_ID == MMovement.Table_ID)
docBaseType = "= '" + MPeriodControl.DOCBASETYPE_MaterialMovement + "'";
else if (AD_Table_ID == MRequisition.Table_ID)

View File

@ -376,7 +376,6 @@ public class ImportAccount extends SvrProcess
String updateSQL = "UPDATE AD_TreeNode SET Parent_ID=?, SeqNo=? "
+ "WHERE AD_Tree_ID=? AND Node_ID=?";
//begin e-evolution vpj-cd 15 nov 2005 PostgreSQL
//PreparedStatement updateStmt = DB.prepareStatement(updateSQL, get_TrxName());
PreparedStatement updateStmt = DB.prepareStatement(updateSQL, ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE, get_TrxName());
//end
//

View File

@ -149,16 +149,6 @@ implements ImportProcess
if (log.isLoggable(Level.CONFIG)) log.config("Invalid Group=" + no);
// Set Country
/**
sql = new StringBuilder ("UPDATE I_BPartner i "
+ "SET CountryCode=(SELECT CountryCode FROM C_Country c WHERE c.IsDefault='Y'"
+ " AND c.AD_Client_ID IN (0, i.AD_Client_ID) AND ROWNUM=1) "
+ "WHERE CountryCode IS NULL AND C_Country_ID IS NULL"
+ " AND I_IsImported<>'Y'").append(clientCheck);
no = DB.executeUpdateEx(sql.toString(), get_TrxName());
log.fine("Set Country Default=" + no);
**/
//
sql = new StringBuilder ("UPDATE I_BPartner i ")
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
.append(" WHERE i.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, i.AD_Client_ID)) ")
@ -353,8 +343,6 @@ implements ImportProcess
else // Update existing BPartner
{
bp = new MBPartner(getCtx(), impBP.getC_BPartner_ID(), get_TrxName());
// if (impBP.getValue() != null) // not to overwite
// bp.setValue(impBP.getValue());
if (impBP.getName() != null)
{
bp.setName(impBP.getName());

View File

@ -460,12 +460,9 @@ public class ImportBankStatement extends SvrProcess
MBankStatementLine line = new MBankStatementLine(statement, lineNo);
// Copy statement line data
//line.setC_BPartner_ID(imp.getC_BPartner_ID());
//line.setC_Invoice_ID(imp.getC_Invoice_ID());
line.setReferenceNo(imp.getReferenceNo());
line.setDescription(imp.getLineDescription());
line.setStatementLineDate(imp.getStatementLineDate());
// line.setDateAcct(imp.getStatementLineDate()); // set on beforeSave
line.setValutaDate(imp.getValutaDate());
line.setIsReversal(imp.isReversal());
line.setC_Currency_ID(imp.getC_Currency_ID());

View File

@ -221,14 +221,7 @@ public class ImportConversionRate extends SvrProcess
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Invalid Rates =" + no);
// sql = new StringBuilder ("UPDATE I_Conversion_Rate i " // Rate diff > 10%
// + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Inconsistent Rates='||(MultiplyRate - (1/DivideRate)) "
// + "WHERE ((MultiplyRate - (1/DivideRate)) > (MultiplyRate * .1))"
// + " AND I_IsImported<>'Y'").append (clientCheck);
// no = DB.executeUpdate(sql.toString(), get_TrxName());
// if (no != 0)
// log.warn ("Inconsistent Rates =" + no);
commitEx();
/*********************************************************************/

View File

@ -570,17 +570,6 @@ public class ImportGLJournal extends SvrProcess
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Zero Acct Balance=" + no);
//AZ Goodwill
//BF: 2391401 Remove account balance limitation in Import GL Journal
/*
sql = new StringBuilder ("UPDATE I_GLJournal i "
+ "SET I_ErrorMsg=I_ErrorMsg||'WARN=Check Acct Balance, ' "
+ "WHERE ABS(AmtAcctDr-AmtAcctCr)>100000000" // 100 mio
+ " AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
if (no != 0)
log.warning ("Check Acct Balance=" + no);
*/
/*********************************************************************/

View File

@ -368,15 +368,6 @@ public class ImportInvoice extends SvrProcess
log.warning ("No BP Location=" + no);
// Set Country
/**
sql = new StringBuilder ("UPDATE I_Invoice o "
+ "SET CountryCode=(SELECT MAX(CountryCode) FROM C_Country c WHERE c.IsDefault='Y'"
+ " AND c.AD_Client_ID IN (0, o.AD_Client_ID)) "
+ "WHERE C_BPartner_ID IS NULL AND CountryCode IS NULL AND C_Country_ID IS NULL"
+ " AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Country Default=" + no);
**/
sql = new StringBuilder ("UPDATE I_Invoice o ")
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
.append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ")

View File

@ -369,15 +369,6 @@ public class ImportOrder extends SvrProcess
log.warning ("No BP Location=" + no);
// Set Country
/**
sql = new StringBuilder ("UPDATE I_Order o "
+ "SET CountryCode=(SELECT MAX(CountryCode) FROM C_Country c WHERE c.IsDefault='Y'"
+ " AND c.AD_Client_ID IN (0, o.AD_Client_ID)) "
+ "WHERE C_BPartner_ID IS NULL AND CountryCode IS NULL AND C_Country_ID IS NULL"
+ " AND I_IsImported<>'Y'").append (clientCheck);
no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("Set Country Default=" + no);
**/
sql = new StringBuilder ("UPDATE I_Order o ")
.append("SET C_Country_ID=(SELECT C_Country_ID FROM C_Country c")
.append(" WHERE o.CountryCode=c.CountryCode AND c.AD_Client_ID IN (0, o.AD_Client_ID)) ")

View File

@ -458,13 +458,10 @@ public class ImportPayment extends SvrProcess
payment.setDateAcct(imp.getDateTrx());
payment.setDateTrx(imp.getDateTrx());
// payment.setDescription(imp.getDescription());
//
payment.setC_BPartner_ID(imp.getC_BPartner_ID());
payment.setC_Invoice_ID(imp.getC_Invoice_ID());
payment.setC_DocType_ID(imp.getC_DocType_ID());
payment.setC_Currency_ID(imp.getC_Currency_ID());
// payment.setC_ConversionType_ID(imp.getC_ConversionType_ID());
payment.setC_Charge_ID(imp.getC_Charge_ID());
payment.setChargeAmt(imp.getChargeAmt());
payment.setTaxAmt(imp.getTaxAmt());

View File

@ -384,12 +384,6 @@ public class ImportProduct extends SvrProcess implements ImportProcess
log.warning("No Mandatory Value=" + no);
// Vendor Product No
// sql = new StringBuilder ("UPDATE I_Product i "
// + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Mandatory VendorProductNo,' "
// + "WHERE I_IsImported<>'Y'"
// + " AND VendorProductNo IS NULL AND (C_BPartner_ID IS NOT NULL OR BPartner_Value IS NOT NULL)").append(clientCheck);
// no = DB.executeUpdate(sql.toString(), get_TrxName());
// log.info(log.l3_Util, "No Mandatory VendorProductNo=" + no);
sql = new StringBuilder ("UPDATE I_Product ")
.append("SET VendorProductNo=Value ")
.append("WHERE C_BPartner_ID IS NOT NULL AND VendorProductNo IS NULL")
@ -449,56 +443,6 @@ public class ImportProduct extends SvrProcess implements ImportProcess
PreparedStatement pstmt_insertProductPO = null;
try
{
/* Insert Product from Import
PreparedStatement pstmt_insertProduct = conn.prepareStatement
("INSERT INTO M_Product (M_Product_ID,"
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
+ "Value,Name,Description,DocumentNote,Help,"
+ "UPC,SKU,C_UOM_ID,IsSummary,M_Product_Category_ID,C_TaxCategory_ID,"
+ "ProductType,ImageURL,DescriptionURL) "
+ "SELECT ?,"
+ "AD_Client_ID,AD_Org_ID,'Y',getDate(),CreatedBy,getDate(),UpdatedBy,"
+ "Value,Name,Description,DocumentNote,Help,"
+ "UPC,SKU,C_UOM_ID,'N',M_Product_Category_ID," + C_TaxCategory_ID + ","
+ "ProductType,ImageURL,DescriptionURL "
+ "FROM I_Product "
+ "WHERE I_Product_ID=?");
*/
// Update Product from Import
//jz moved
/*
String sqlt = "UPDATE M_PRODUCT "
+ "SET (Value,Name,Description,DocumentNote,Help,"
+ "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,"
+ "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,"
+ "Discontinued,DiscontinuedBy,Updated,UpdatedBy)= "
+ "(SELECT Value,Name,Description,DocumentNote,Help,"
+ "UPC,SKU,C_UOM_ID,M_Product_Category_ID,Classification,ProductType,"
+ "Volume,Weight,ShelfWidth,ShelfHeight,ShelfDepth,UnitsPerPallet,"
+ "Discontinued,DiscontinuedBy,getDate(),UpdatedBy"
+ " FROM I_Product WHERE I_Product_ID=?) "
+ "WHERE M_Product_ID=?";
PreparedStatement pstmt_updateProduct = DB.prepareStatement
(sqlt, get_TrxName());
// Update Product_PO from Import
sqlt = "UPDATE M_Product_PO "
+ "SET (IsCurrentVendor,C_UOM_ID,C_Currency_ID,UPC,"
+ "PriceList,PricePO,RoyaltyAmt,PriceEffective,"
+ "VendorProductNo,VendorCategory,Manufacturer,"
+ "Discontinued,DiscontinuedBy,Order_Min,Order_Pack,"
+ "CostPerOrder,DeliveryTime_Promised,Updated,UpdatedBy)= "
+ "(SELECT 'Y',C_UOM_ID,C_Currency_ID,UPC,"
+ "PriceList,PricePO,RoyaltyAmt,PriceEffective,"
+ "VendorProductNo,VendorCategory,Manufacturer,"
+ "Discontinued,DiscontinuedBy,Order_Min,Order_Pack,"
+ "CostPerOrder,DeliveryTime_Promised,getDate(),UpdatedBy"
+ " FROM I_Product"
+ " WHERE I_Product_ID=?) "
+ "WHERE M_Product_ID=? AND C_BPartner_ID=?";
PreparedStatement pstmt_updateProductPO = DB.prepareStatement
(sqlt, get_TrxName());
*/
// Insert Product from Import
pstmt_insertProductPO = DB.prepareStatement
("INSERT INTO M_Product_PO (M_Product_ID,C_BPartner_ID, "
@ -575,8 +519,6 @@ public class ImportProduct extends SvrProcess implements ImportProcess
PreparedStatement pstmt_updateProduct = DB.prepareStatement
(sqlt.toString(), get_TrxName());
//jz pstmt_updateProduct.setInt(1, I_Product_ID);
// pstmt_updateProduct.setInt(2, M_Product_ID);
try
{
no = pstmt_updateProduct.executeUpdate();
@ -624,9 +566,6 @@ public class ImportProduct extends SvrProcess implements ImportProcess
.append("WHERE M_Product_ID=").append(M_Product_ID).append(" AND C_BPartner_ID=").append(C_BPartner_ID);
PreparedStatement pstmt_updateProductPO = DB.prepareStatement
(sqlt.toString(), get_TrxName());
//jz pstmt_updateProductPO.setInt(1, I_Product_ID);
// pstmt_updateProductPO.setInt(2, M_Product_ID);
// pstmt_updateProductPO.setInt(3, C_BPartner_ID);
try
{
no = pstmt_updateProductPO.executeUpdate();

View File

@ -279,13 +279,10 @@ public class ImportReportLine extends SvrProcess
.append("SELECT ?,PA_ReportLineSet_ID,")
.append("AD_Client_ID,AD_Org_ID,'Y',getDate(),CreatedBy,getDate(),UpdatedBy,")
.append("Name,SeqNo,IsPrinted,IsSummary,LineType ")
//jz + "FROM I_ReportLine "
// + "WHERE PA_ReportLineSet_ID=? AND Name=? AND ROWNUM=1" // #2..3
.append("FROM I_ReportLine ")
.append("WHERE I_ReportLine_ID=(SELECT MAX(I_ReportLine_ID) ")
.append("FROM I_ReportLine ")
.append("WHERE PA_ReportLineSet_ID=? AND Name=? ") // #2..3
//jz + clientCheck, get_TrxName());
.append(clientCheck).append(")");
pstmt_insertLine = DB.prepareStatement(dbpst.toString(), get_TrxName());
@ -382,20 +379,6 @@ public class ImportReportLine extends SvrProcess
.append(clientCheck);
pstmt_insertSource = DB.prepareStatement(dbpst.toString(), get_TrxName());
// Update ReportSource
//jz
/*
String sqlt="UPDATE PA_ReportSource "
+ "SET (ElementType,C_ElementValue_ID,Updated,UpdatedBy)="
+ " (SELECT 'AC',C_ElementValue_ID,getDate(),UpdatedBy"
+ " FROM I_ReportLine"
+ " WHERE I_ReportLine_ID=?) "
+ "WHERE PA_ReportSource_ID=?"
+ clientCheck;
PreparedStatement pstmt_updateSource = DB.prepareStatement
(sqlt, get_TrxName());
*/
// Delete ReportSource - afalcone 22/02/2007 - F.R. [ 1642250 ] Import ReportLine / Very Slow Reports
dbpst = new StringBuilder("DELETE FROM PA_ReportSource ")
.append("WHERE C_ElementValue_ID IS NULL")
@ -453,12 +436,9 @@ public class ImportReportLine extends SvrProcess
.append(clientCheck);
PreparedStatement pstmt_updateSource = DB.prepareStatement
(sqlt.toString(), get_TrxName());
//pstmt_updateSource.setInt(1, I_ReportLine_ID);
//pstmt_updateSource.setInt(2, PA_ReportSource_ID);
try
{
no = pstmt_updateSource.executeUpdate();
//no = DB.executeUpdate(sqlt, get_TrxName());
if (log.isLoggable(Level.FINEST)) log.finest("Update ReportSource = " + no + ", I_ReportLine_ID=" + I_ReportLine_ID + ", PA_ReportSource_ID=" + PA_ReportSource_ID);
noUpdateSource++;
}

View File

@ -174,7 +174,6 @@ public class InOutGenerate extends SvrProcess
m_sql.append(" AND o.C_BPartner_ID=?"); // #3
}
m_sql.append(" ORDER BY M_Warehouse_ID, PriorityRule, M_Shipper_ID, C_BPartner_ID, C_BPartner_Location_ID, C_Order_ID");
// m_sql += " FOR UPDATE";
PreparedStatement pstmt = null;
try

View File

@ -195,7 +195,6 @@ public class InventoryCountCreate extends SvrProcess
.append(" AND il.M_Product_ID=s.M_Product_ID")
.append(" AND il.M_Locator_ID=s.M_Locator_ID")
.append(" AND COALESCE(il.M_AttributeSetInstance_ID,0)=COALESCE(s.M_AttributeSetInstance_ID,0))");
// + " AND il.M_AttributeSetInstance_ID=s.M_AttributeSetInstance_ID)");
//
sql.append(" ORDER BY l.Value, p.Value, s.M_AttributeSetInstance_ID, s.DateMaterialPolicy, s.QtyOnHand DESC"); // Locator/Product
//

View File

@ -115,9 +115,6 @@ public class InventoryValue extends SvrProcess
.append("WHERE w.M_Warehouse_ID=").append(p_M_Warehouse_ID);
int noInsertStd = DB.executeUpdateEx(sql.toString(), get_TrxName());
if (log.isLoggable(Level.FINE)) log.fine("Inserted Std=" + noInsertStd);
//IDEMPIERE-2500 - This may be invalid check. Removing still some one not admit reason
/*if (noInsertStd == 0)
return "No Standard Costs found";*/
// Insert addl Costs
int noInsertCost = 0;

View File

@ -178,10 +178,6 @@ public class OrderBatchProcess extends SvrProcess
throw new IllegalStateException("Order Process Failed: " + order + " - " + order.getProcessMsg());
}
// commented by zuhri - unreachable code
//addLog (0, null, null, order.getDocumentNo() + ": Error " + order.getProcessMsg());
//return false;
// end commented out by zuhri
} // process
} // OrderBatchProcess

View File

@ -99,7 +99,6 @@ public class OrderLineCreateShipment extends SvrProcess
MInOutLine sline = new MInOutLine( shipment );
sline.setOrderLine(line, 0, line.getQtyReserved());
//sline.setDatePromised(line.getDatePromised());
sline.setQtyEntered(line.getQtyReserved());
sline.setC_UOM_ID(line.getC_UOM_ID());
sline.setQty(line.getQtyReserved());

View File

@ -60,11 +60,6 @@ public class PackageCreate extends SvrProcess
log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
}
// Bug [ 1754889 ] Create Package error
// Commenting these lines because this process is called also from window "Ship/Receipt Confirm"
// if (p_M_InOut_ID == 0)
// p_M_InOut_ID = getRecord_ID();
} // prepare
/**

View File

@ -173,7 +173,6 @@ public class PaySelectionCreateFrom extends SvrProcess
sqlWhere.append(" OR ");
else
sqlWhere.append(" AND ");
// sql.append("paymentTermDueDays(C_PaymentTerm_ID, DateInvoiced, ?) >= 0"); // ##
sqlWhere.append("i.DueDate<=?"); // ##
if (p_OnlyDiscount)
sqlWhere.append(")");

View File

@ -35,7 +35,6 @@ public class ProductionProcess extends SvrProcess {
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
// log.fine("prepare - " + para[i]);
if (para[i].getParameter() == null)
;
else if (name.equals("MovementDate"))

View File

@ -238,9 +238,7 @@ public class ProjectIssue extends SvrProcess
// Find Location
int M_Locator_ID = 0;
// MProduct product = new MProduct (getCtx(), expenseLines[i].getM_Product_ID());
// if (product.isStocked())
M_Locator_ID = MStorageOnHand.getM_Locator_ID(expense.getM_Warehouse_ID(),
M_Locator_ID = MStorageOnHand.getM_Locator_ID(expense.getM_Warehouse_ID(),
expenseLines[i].getM_Product_ID(), 0, // no ASI
expenseLines[i].getQty(), null);
if (M_Locator_ID == 0) // Service/Expense - get default (and fallback)

View File

@ -650,7 +650,6 @@ public class ReplenishReport extends SvrProcess
// Set BPartner Link to Org
order.setBPartner(bp);
order.setDateOrdered(new Timestamp(System.currentTimeMillis()));
//order.setDatePromised(DatePromised);
order.setDeliveryRule(MDDOrder.DELIVERYRULE_Availability);
order.setDeliveryViaRule(MDDOrder.DELIVERYVIARULE_Delivery);
order.setPriorityRule(MDDOrder.PRIORITYRULE_Medium);
@ -688,46 +687,6 @@ public class ReplenishReport extends SvrProcess
if(M_LocatorTo_ID == 0 || M_Locator_ID==0)
throw new AdempiereUserError(Msg.translate(getCtx(), "M_Locator_ID")+" @FillMandatory@ ");
// From: Look-up Storage
/*MProduct product = MProduct.get(getCtx(), replenish.getM_Product_ID());
MProductCategory pc = MProductCategory.get(getCtx(), product.getM_Product_Category_ID());
String MMPolicy = pc.getMMPolicy();
if (MMPolicy == null || MMPolicy.length() == 0)
MMPolicy = client.getMMPolicy();
//
MStorage[] storages = MStorage.getWarehouse(getCtx(),
whSource.getM_Warehouse_ID(), replenish.getM_Product_ID(), 0, 0,
true, null,
MClient.MMPOLICY_FiFo.equals(MMPolicy), get_TrxName());
BigDecimal target = replenish.getQtyToOrder();
for (int j = 0; j < storages.length; j++)
{
MStorage storage = storages[j];
if (storage.getQtyOnHand().signum() <= 0)
continue;
BigDecimal moveQty = target;
if (storage.getQtyOnHand().compareTo(moveQty) < 0)
moveQty = storage.getQtyOnHand();
//
MDDOrderLine line = new MDDOrderLine(order);
line.setM_Product_ID(replenish.getM_Product_ID());
line.setQtyEntered(moveQty);
if (replenish.getQtyToOrder().compareTo(moveQty) != 0)
line.setDescription("Total: " + replenish.getQtyToOrder());
line.setM_Locator_ID(storage.getM_Locator_ID()); // from
line.setM_AttributeSetInstance_ID(storage.getM_AttributeSetInstance_ID());
line.setM_LocatorTo_ID(M_LocatorTo_ID); // to
line.setM_AttributeSetInstanceTo_ID(storage.getM_AttributeSetInstance_ID());
line.setIsInvoiced(false);
line.saveEx();
//
target = target.subtract(moveQty);
if (target.signum() == 0)
break;
}*/
MDDOrderLine line = new MDDOrderLine(order);
line.setM_Product_ID(replenish.getM_Product_ID());
line.setQty(replenish.getQtyToOrder());

View File

@ -686,7 +686,6 @@ public class ReplenishReportProduction extends SvrProcess
// Set BPartner Link to Org
order.setBPartner(bp);
order.setDateOrdered(new Timestamp(System.currentTimeMillis()));
//order.setDatePromised(DatePromised);
order.setDeliveryRule(MDDOrder.DELIVERYRULE_Availability);
order.setDeliveryViaRule(MDDOrder.DELIVERYVIARULE_Delivery);
order.setPriorityRule(MDDOrder.PRIORITYRULE_Medium);
@ -724,46 +723,6 @@ public class ReplenishReportProduction extends SvrProcess
if(M_LocatorTo_ID == 0 || M_Locator_ID==0)
throw new AdempiereUserError(Msg.translate(getCtx(), "M_Locator_ID")+" @FillMandatory@ ");
// From: Look-up Storage
/*MProduct product = MProduct.get(getCtx(), replenish.getM_Product_ID());
MProductCategory pc = MProductCategory.get(getCtx(), product.getM_Product_Category_ID());
String MMPolicy = pc.getMMPolicy();
if (MMPolicy == null || MMPolicy.length() == 0)
MMPolicy = client.getMMPolicy();
//
MStorage[] storages = MStorage.getWarehouse(getCtx(),
whSource.getM_Warehouse_ID(), replenish.getM_Product_ID(), 0, 0,
true, null,
MClient.MMPOLICY_FiFo.equals(MMPolicy), get_TrxName());
BigDecimal target = replenish.getQtyToOrder();
for (int j = 0; j < storages.length; j++)
{
MStorage storage = storages[j];
if (storage.getQtyOnHand().signum() <= 0)
continue;
BigDecimal moveQty = target;
if (storage.getQtyOnHand().compareTo(moveQty) < 0)
moveQty = storage.getQtyOnHand();
//
MDDOrderLine line = new MDDOrderLine(order);
line.setM_Product_ID(replenish.getM_Product_ID());
line.setQtyEntered(moveQty);
if (replenish.getQtyToOrder().compareTo(moveQty) != 0)
line.setDescription("Total: " + replenish.getQtyToOrder());
line.setM_Locator_ID(storage.getM_Locator_ID()); // from
line.setM_AttributeSetInstance_ID(storage.getM_AttributeSetInstance_ID());
line.setM_LocatorTo_ID(M_LocatorTo_ID); // to
line.setM_AttributeSetInstanceTo_ID(storage.getM_AttributeSetInstance_ID());
line.setIsInvoiced(false);
line.saveEx();
//
target = target.subtract(moveQty);
if (target.signum() == 0)
break;
}*/
MDDOrderLine line = new MDDOrderLine(order);
line.setM_Product_ID(replenish.getM_Product_ID());
line.setQty(replenish.getQtyToOrder());

View File

@ -88,10 +88,6 @@ public class RequestEMailProcessor extends SvrProcess implements ProcessEmailHan
protected static final int ERROR = 0;
/** Process Request */
protected static final int REQUEST = 1;
/** Process Workflow */
// private static final int WORKFLOW = 2;
/** Process Delivery Confirm */
// private static final int DELIVERY = 9;
protected Folder errorFolder;
protected Folder requestFolder;
@ -205,7 +201,6 @@ public class RequestEMailProcessor extends SvrProcess implements ProcessEmailHan
if (log.isLoggable(Level.INFO)) log.info("doIt - IMAPHost=" + p_IMAPHost +
" IMAPPort=" + p_IMAPPort +
" IMAPUser=" + p_IMAPUser +
// " IMAPPwd=" + p_IMAPPwd +
" RequestFolder=" + p_RequestFolder +
" InboxFolder=" + p_InboxFolder +
" ErrorFolder=" + p_ErrorFolder);

View File

@ -104,9 +104,7 @@ public class RequestInvoice extends SvrProcess
.append(" INNER JOIN R_Status s ON (r.R_Status_ID=s.R_Status_ID) ")
.append("WHERE s.IsClosed='Y'")
.append(" AND r.R_RequestType_ID=?");
// globalqss -- avoid double invoicing
// + " AND EXISTS (SELECT 1 FROM R_RequestUpdate ru " +
// "WHERE ru.R_Request_ID=r.R_Request_ID AND NVL(C_InvoiceLine_ID,0)=0";
if (p_R_Group_ID != 0)
sql.append(" AND r.R_Group_ID=?");
if (p_R_Category_ID != 0)
@ -216,8 +214,6 @@ public class RequestInvoice extends SvrProcess
BigDecimal qty = updates[i].getQtyInvoiced();
if (qty == null || qty.signum() == 0)
continue;
// if (updates[i].getC_InvoiceLine_ID() > 0)
// continue;
MInvoiceLine il = new MInvoiceLine(m_invoice);
m_linecount++;
@ -232,8 +228,6 @@ public class RequestInvoice extends SvrProcess
//
il.setPrice();
il.saveEx();
// updates[i].setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
// updates[i].saveEx();
}
} // invoiceLine

View File

@ -84,8 +84,6 @@ public class RfQCopyLines extends SvrProcess
newLine.setHelp(lines[i].getHelp());
newLine.setM_Product_ID(lines[i].getM_Product_ID());
newLine.setM_AttributeSetInstance_ID(lines[i].getM_AttributeSetInstance_ID());
// newLine.setDateWorkStart();
// newLine.setDateWorkComplete();
newLine.setDeliveryDays(lines[i].getDeliveryDays());
newLine.saveEx();
// Copy Qtys

View File

@ -22,10 +22,8 @@ import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.Adempiere;
import org.compiere.model.MClient;
import org.compiere.model.MSequence;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
@ -265,21 +263,4 @@ public class SequenceCheck extends SvrProcess
} // checkClientSequences
//add main method, preparing for nightly build
public static void main(String[] args)
{
Adempiere.startupEnvironment(false);
CLogMgt.setLevel(Level.FINE);
s_log.info("Sequence Check");
s_log.info("--------------");
ProcessInfo pi = new ProcessInfo("Sequence Check", 258);
pi.setAD_Client_ID(0);
pi.setAD_User_ID(100);
SequenceCheck sc = new SequenceCheck();
sc.startProcess(Env.getCtx(), pi, null);
StringBuilder msgout = new StringBuilder("Process=").append(pi.getTitle()).append(" Error=").append(pi.isError()).append(" Summary=").append(pi.getSummary());
System.out.println(msgout.toString());
}
} // SequenceCheck

View File

@ -90,11 +90,6 @@ public class StorageCleanup extends SvrProcess
+ " AND EXISTS (SELECT * FROM M_Product p"
+ " INNER JOIN M_AttributeSet mas ON (p.M_AttributeSet_ID=mas.M_AttributeSet_ID) "
+ "WHERE s.M_Product_ID=p.M_Product_ID AND mas.IsInstanceAttribute='Y')"
// Stock in same location
// + " AND EXISTS (SELECT * FROM M_Storage sl "
// + "WHERE sl.QtyOnHand > 0"
// + " AND s.M_Product_ID=sl.M_Product_ID"
// + " AND s.M_Locator_ID=sl.M_Locator_ID)"
// Stock in same Warehouse
+ " AND EXISTS (SELECT * FROM M_StorageOnHand sw"
+ " INNER JOIN M_Locator swl ON (sw.M_Locator_ID=swl.M_Locator_ID), M_Locator sl "
@ -198,53 +193,6 @@ public class StorageCleanup extends SvrProcess
*/
private void eliminateReservation(MStorageOnHand target)
{
/*
// Negative Ordered / Reserved Qty
if (target.getQtyReserved().signum() != 0 || target.getQtyOrdered().signum() != 0)
{
int M_Locator_ID = target.getM_Locator_ID();
MStorageOnHand storage0 = MStorageOnHand.get(getCtx(), M_Locator_ID,
target.getM_Product_ID(), 0, get_TrxName());
if (storage0 == null)
{
MLocator defaultLoc = MLocator.getDefault(getCtx(), M_Locator_ID);
if (M_Locator_ID != defaultLoc.getM_Locator_ID())
{
M_Locator_ID = defaultLoc.getM_Locator_ID();
storage0 = MStorageOnHand.get(getCtx(), M_Locator_ID,
target.getM_Product_ID(), 0, get_TrxName());
}
}
if (storage0 != null)
{
BigDecimal reserved = Env.ZERO;
BigDecimal ordered = Env.ZERO;
if (target.getQtyReserved().add(storage0.getQtyReserved()).signum() >= 0)
reserved = target.getQtyReserved(); // negative
if (target.getQtyOrdered().add(storage0.getQtyOrdered()).signum() >= 0)
ordered = target.getQtyOrdered(); // negative
// Eliminate Reservation
if (reserved.signum() != 0 || ordered.signum() != 0)
{
if (MStorageOnHand.add(getCtx(), target.getM_Warehouse_ID(), target.getM_Locator_ID(),
target.getM_Product_ID(),
target.getM_AttributeSetInstance_ID(), target.getM_AttributeSetInstance_ID(),
Env.ZERO, get_TrxName()))
{
if (MStorageOnHand.add(getCtx(), storage0.getM_Warehouse_ID(), storage0.getM_Locator_ID(),
storage0.getM_Product_ID(),
storage0.getM_AttributeSetInstance_ID(), storage0.getM_AttributeSetInstance_ID(),
Env.ZERO, get_TrxName()))
log.info("Reserved=" + reserved + ",Ordered=" + ordered);
else
log.warning("Failed Storage0 Update");
}
else
log.warning("Failed Target Update");
}
}
}
*/
} // eliminateReservation
/**

View File

@ -17,12 +17,8 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Level;
import org.compiere.Adempiere;
import org.compiere.model.M_Element;
import org.compiere.util.CLogMgt;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Trx;
/**
@ -33,9 +29,7 @@ import org.compiere.util.Trx;
@org.adempiere.base.annotation.Process
public class SynchronizeTerminology extends SvrProcess
{
/** Static Logger */
private static final CLogger s_log = CLogger.getCLogger (SynchronizeTerminology.class);
/**
* Prepare - e.g., get Parameters.
*/
@ -80,33 +74,7 @@ public class SynchronizeTerminology extends SvrProcess
DB.close(rs, pstmt);
rs = null; pstmt = null;
trx.commit(true);
// Create Elements for Process Parameters which are centrally maintained
/* IDEMPIERE 109 - this create unwanted Element
sql="SELECT DISTINCT ColumnName, Name, Description, Help, EntityType "
+" FROM AD_PROCESS_PARA p "
+" WHERE NOT EXISTS "
+" (SELECT 1 FROM AD_ELEMENT e "
+" WHERE UPPER(p.ColumnName)=UPPER(e.ColumnName))"
+" AND p.isCentrallyMaintained = 'Y'"
+" AND p.isActive = 'Y'";
pstmt = DB.prepareStatement(sql, get_TrxName());
rs = pstmt.executeQuery ();
while (rs.next()){
String columnName = rs.getString(1);
String name = rs.getString(2);
String desc = rs.getString(3);
String help =rs.getString(4);
String entityType=rs.getString(5);
//TODO AD_SEQ system !!!
M_Element elem = new M_Element(getCtx(),columnName,entityType,get_TrxName());
elem.setDescription(desc);
elem.setHelp(help);
elem.setPrintName(name);
elem.saveEx();
}
pstmt.close();
rs.close();
trx.commit(true);*/
log.info("Adding missing Element Translations");
sql="INSERT INTO AD_ELEMENT_TRL (AD_Element_ID, AD_LANGUAGE, AD_Client_ID, AD_Org_ID,"
+" IsActive, Created, CreatedBy, Updated, UpdatedBy,"
@ -632,15 +600,6 @@ public class SynchronizeTerminology extends SvrProcess
if (log.isLoggable(Level.INFO)) log.info(" rows updated: "+no);
trx.commit(true);
/**
SELECT e.PrintName "Element", pfi.PrintName "FormatItem", trl.AD_Language, trl.PrintName "Trl"
FROM AD_Element e
INNER JOIN AD_Column c ON (e.AD_Element_ID=c.AD_Element_ID)
INNER JOIN AD_PrintFormatItem pfi ON (c.AD_Column_ID=pfi.AD_Column_ID)
INNER JOIN AD_PrintFormatItem_Trl trl ON (pfi.AD_PrintFormatItem_ID=trl.AD_PrintFormatItem_ID)
WHERE pfi.AD_PrintFormatItem_ID=?
**/
// Sync Names - Window
log.info("Synchronizing Menu with Window");
sql="UPDATE AD_MENU m"
@ -924,21 +883,4 @@ public class SynchronizeTerminology extends SvrProcess
return "@OK@";
}
//add main method, preparing for nightly build
public static void main(String[] args)
{
Adempiere.startupEnvironment(false);
CLogMgt.setLevel(Level.FINE);
s_log.info("Synchronize Terminology");
s_log.info("-----------------------");
ProcessInfo pi = new ProcessInfo("Synchronize Terminology", 172);
pi.setAD_Client_ID(0);
pi.setAD_User_ID(100);
SynchronizeTerminology sc = new SynchronizeTerminology();
sc.startProcess(Env.getCtx(), pi, null);
StringBuilder msgout = new StringBuilder("Process=").append(pi.getTitle()).append(" Error=").append(pi.isError()).append(" Summary=").append(pi.getSummary());
System.out.println(msgout.toString());
}
}