IDEMPIERE-4723 - Remove dead code from Callout classes (#1388)
This commit is contained in:
parent
e4f4999220
commit
b2f5a7a0ae
|
@ -88,7 +88,6 @@ public class CalloutBankStatement extends CalloutEngine
|
|||
if (charge == null)
|
||||
charge = Env.ZERO;
|
||||
bd = bd.subtract(charge);
|
||||
// log.trace(log.l5_DData, "Interest (" + bd + ") = Stmt(" + stmt + ") - Trx(" + trx + ") - Charge(" + charge + ")");
|
||||
mTab.setValue("InterestAmt", bd);
|
||||
}
|
||||
// Calculate Charge
|
||||
|
@ -98,7 +97,6 @@ public class CalloutBankStatement extends CalloutEngine
|
|||
if (interest == null)
|
||||
interest = Env.ZERO;
|
||||
bd = bd.subtract(interest);
|
||||
// log.trace(log.l5_DData, "Charge (" + bd + ") = Stmt(" + stmt + ") - Trx(" + trx + ") - Interest(" + interest + ")");
|
||||
mTab.setValue("ChargeAmt", bd);
|
||||
}
|
||||
return "";
|
||||
|
|
|
@ -45,15 +45,6 @@ public class CalloutImportTemplate extends CalloutEngine
|
|||
|
||||
String characterSet = value.toString();
|
||||
if (!Charset.isSupported(characterSet)) {
|
||||
/*
|
||||
StringBuilder valid = new StringBuilder();
|
||||
for (Charset validch : Charset.availableCharsets().values()) {
|
||||
if (valid.length() > 0)
|
||||
valid.append(", ");
|
||||
valid.append(validch.displayName());
|
||||
}
|
||||
return Msg.parseTranslation(ctx, "@Invalid@ @CharacterSet@ -> " + valid);
|
||||
*/
|
||||
return Msg.parseTranslation(ctx, "@Invalid@ @CharacterSet@");
|
||||
}
|
||||
|
||||
|
|
|
@ -569,7 +569,6 @@ public class CalloutInOut extends CalloutEngine
|
|||
return "";
|
||||
|
||||
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
|
||||
// log.log(Level.WARNING,"qty - init - M_Product_ID=" + M_Product_ID);
|
||||
BigDecimal MovementQty, QtyEntered;
|
||||
|
||||
// No Product
|
||||
|
|
|
@ -365,7 +365,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
mTab.setValue("PriceActual", pp.getPriceStd());
|
||||
mTab.setValue("PriceEntered", pp.getPriceStd());
|
||||
mTab.setValue("C_Currency_ID", Integer.valueOf(pp.getC_Currency_ID()));
|
||||
// mTab.setValue("Discount", pp.getDiscount());
|
||||
mTab.setValue("C_UOM_ID", Integer.valueOf(pp.getC_UOM_ID()));
|
||||
Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N");
|
||||
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
|
||||
|
@ -541,7 +540,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
if (isCalloutActive() || value == null)
|
||||
return "";
|
||||
|
||||
// log.log(Level.WARNING,"amt - init");
|
||||
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
|
||||
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
|
||||
int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID");
|
||||
|
@ -556,7 +554,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
//
|
||||
PriceEntered = (BigDecimal)mTab.getValue("PriceEntered");
|
||||
PriceActual = (BigDecimal)mTab.getValue("PriceActual");
|
||||
// Discount = (BigDecimal)mTab.getValue("Discount");
|
||||
PriceLimit = (BigDecimal)mTab.getValue("PriceLimit");
|
||||
PriceList = (BigDecimal)mTab.getValue("PriceList");
|
||||
if (log.isLoggable(Level.FINE)){
|
||||
|
@ -613,7 +610,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
+ ", PriceEntered=" + PriceEntered + ", Discount=" + pp.getDiscount());
|
||||
PriceActual = pp.getPriceStd();
|
||||
mTab.setValue("PriceActual", pp.getPriceStd());
|
||||
// mTab.setValue("Discount", pp.getDiscount());
|
||||
mTab.setValue("PriceEntered", PriceEntered);
|
||||
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
|
||||
}
|
||||
|
@ -642,33 +638,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
mTab.setValue("PriceActual", PriceActual);
|
||||
}
|
||||
|
||||
/** Discount entered - Calculate Actual/Entered
|
||||
if (mField.getColumnName().equals("Discount"))
|
||||
{
|
||||
PriceActual = new BigDecimal ((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue());
|
||||
if (PriceActual.scale() > StdPrecision)
|
||||
PriceActual = PriceActual.setScale(StdPrecision, RoundingMode.HALF_UP);
|
||||
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
|
||||
C_UOM_To_ID, PriceActual);
|
||||
if (PriceEntered == null)
|
||||
PriceEntered = PriceActual;
|
||||
mTab.setValue("PriceActual", PriceActual);
|
||||
mTab.setValue("PriceEntered", PriceEntered);
|
||||
}
|
||||
// calculate Discount
|
||||
else
|
||||
{
|
||||
if (PriceList.compareTo(Env.ZERO) == 0)
|
||||
Discount = Env.ZERO;
|
||||
else
|
||||
Discount = new BigDecimal ((PriceList.doubleValue() - PriceActual.doubleValue()) / PriceList.doubleValue() * 100.0);
|
||||
if (Discount.scale() > 2)
|
||||
Discount = Discount.setScale(2, RoundingMode.HALF_UP);
|
||||
mTab.setValue("Discount", Discount);
|
||||
}
|
||||
log.fine("amt = PriceEntered=" + PriceEntered + ", Actual" + PriceActual + ", Discount=" + Discount);
|
||||
/* */
|
||||
|
||||
// Check PriceLimit
|
||||
String epl = Env.getContext(ctx, WindowNo, "EnforcePriceLimit");
|
||||
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && !epl.equals("") ? epl.equals("Y") : isEnforcePriceLimit;
|
||||
|
@ -693,7 +662,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
Discount = BigDecimal.valueOf((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
|
||||
if (Discount.scale () > 2)
|
||||
Discount = Discount.setScale (2, RoundingMode.HALF_UP);
|
||||
// mTab.setValue ("Discount", Discount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -772,7 +740,6 @@ public class CalloutInvoice extends CalloutEngine
|
|||
return "";
|
||||
|
||||
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
|
||||
// log.log(Level.WARNING,"qty - init - M_Product_ID=" + M_Product_ID);
|
||||
BigDecimal QtyInvoiced, QtyEntered, PriceActual, PriceEntered;
|
||||
|
||||
// No Product
|
||||
|
|
|
@ -802,16 +802,6 @@ public class CalloutOrder extends CalloutEngine
|
|||
Env.setContext(ctx, WindowNo, "EnforcePriceLimit", pp.isEnforcePriceLimit() ? "Y" : "N");
|
||||
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
|
||||
|
||||
// Check/Update Warehouse Setting
|
||||
// int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID");
|
||||
// Integer wh = (Integer)mTab.getValue("M_Warehouse_ID");
|
||||
// if (wh.intValue() != M_Warehouse_ID)
|
||||
// {
|
||||
// mTab.setValue("M_Warehouse_ID", Integer.valueOf(M_Warehouse_ID));
|
||||
// ADialog.warn(,WindowNo, "WarehouseChanged");
|
||||
// }
|
||||
|
||||
|
||||
if (Env.isSOTrx(ctx, WindowNo))
|
||||
{
|
||||
MProduct product = MProduct.get (ctx, M_Product_ID.intValue());
|
||||
|
|
|
@ -66,68 +66,6 @@ public class CalloutPackage extends CalloutEngine
|
|||
{
|
||||
int shipper_id = ((Integer)value).intValue();
|
||||
|
||||
/* if(value != oldValue)
|
||||
{
|
||||
if (Ini.isClient())
|
||||
{
|
||||
try
|
||||
{
|
||||
Class cl = Class.forName("org.compiere.apps.ADialog");
|
||||
Class paramTypes[] = {int.class, Container.class, String.class, String.class};
|
||||
Object params[] = {windowNo, Env.getWindow(windowNo), "Update Shipment Method", "Are you sure you want to apply this Shipment Method to the Shipment?"};
|
||||
Method method = cl.getDeclaredMethod("ask", paramTypes);
|
||||
Boolean ok = (Boolean) method.invoke(null, params);
|
||||
|
||||
if(!ok)
|
||||
{
|
||||
// don't update the shipper of shipment record but continue with default values setting
|
||||
//return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
int inout_id = Env.getContextAsInt(ctx, windowNo, "M_InOut_ID");
|
||||
String sql = "update M_InOut set M_Shipper_ID=? where M_InOut_ID=?";
|
||||
DB.executeUpdate(sql, new Object[] { shipper_id, inout_id }, false, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new AdempiereException(ex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
if (loader == null)
|
||||
loader = this.getClass().getClassLoader();
|
||||
Class<?> clazz = loader.loadClass("org.adempiere.webui.window.FDialog");
|
||||
Class<?> clazz1 = loader.loadClass("org.zkoss.zk.ui.Component");
|
||||
|
||||
Method m = clazz.getMethod("ask", Integer.TYPE, clazz1, String.class, String.class);
|
||||
Boolean returnCode = (Boolean)m.invoke(null, 0, null, "Update Shipment Method",
|
||||
"Are you sure you want to apply this Shipment Method to the Shipment?");
|
||||
|
||||
if(!returnCode)
|
||||
{
|
||||
// don't update the shipper of shipment record but continue with default values setting
|
||||
//return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
int inout_id = Env.getContextAsInt(ctx, windowNo, "M_InOut_ID");
|
||||
String sql = "update M_InOut set M_Shipper_ID=? where M_InOut_ID=?";
|
||||
DB.executeUpdate(sql, new Object[] { shipper_id, inout_id }, false, null);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new AdempiereException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
String whereClause = "M_Shipper_ID = " + shipper_id + " AND IsDefault='Y' AND IsActive='Y'";
|
||||
int[] ids = MShipperLabels.getAllIDs(MShipperLabels.Table_Name, whereClause, null);
|
||||
if (ids.length > 0)
|
||||
|
|
|
@ -67,7 +67,6 @@ public class CalloutPayment extends CalloutEngine
|
|||
//
|
||||
mTab.setValue ("DiscountAmt", Env.ZERO);
|
||||
mTab.setValue ("WriteOffAmt", Env.ZERO);
|
||||
// mTab.setValue ("IsOverUnderPayment", Boolean.FALSE);
|
||||
mTab.setValue ("OverUnderAmt", Env.ZERO);
|
||||
int C_InvoicePaySchedule_ID = 0;
|
||||
if (Env.getContextAsInt (ctx, WindowNo, Env.TAB_INFO, "C_Invoice_ID") == C_Invoice_ID.intValue ()
|
||||
|
@ -218,8 +217,6 @@ public class CalloutPayment extends CalloutEngine
|
|||
return "";
|
||||
mTab.setValue ("C_Invoice_ID", null);
|
||||
mTab.setValue ("C_Order_ID", null);
|
||||
// 2008/07/18 Globalqss [ 2021745 ]
|
||||
// mTab.setValue ("C_Project_ID", null);
|
||||
mTab.setValue ("IsPrepayment", Boolean.FALSE);
|
||||
//
|
||||
mTab.setValue ("DiscountAmt", Env.ZERO);
|
||||
|
@ -267,8 +264,6 @@ public class CalloutPayment extends CalloutEngine
|
|||
}
|
||||
// globalqss - Allow prepayment to Purchase Orders
|
||||
// Order Waiting Payment (can only be SO)
|
||||
// if (C_Order_ID != 0 && dt != null && !dt.isSOTrx())
|
||||
// return "PaymentDocTypeInvoiceInconsistent";
|
||||
// Order
|
||||
if (C_Order_ID != 0)
|
||||
{
|
||||
|
@ -476,8 +471,6 @@ public class CalloutPayment extends CalloutEngine
|
|||
AD_Org_ID);
|
||||
if (CurrencyRate == null || CurrencyRate.compareTo (Env.ZERO) == 0)
|
||||
{
|
||||
// mTab.setValue("C_Currency_ID", new
|
||||
// Integer(C_Currency_Invoice_ID)); // does not work
|
||||
if (C_Currency_Invoice_ID == 0)
|
||||
return ""; // no error message when no invoice is selected
|
||||
return "NoCurrencyConversion";
|
||||
|
|
|
@ -95,9 +95,6 @@ public class CalloutPaymentAllocate extends CalloutEngine
|
|||
rs = pstmt.executeQuery();
|
||||
if (rs.next())
|
||||
{
|
||||
// mTab.setValue("C_BPartner_ID", Integer.valueOf(rs.getInt(1)));
|
||||
// int C_Currency_ID = rs.getInt(2); // Set Invoice Currency
|
||||
// mTab.setValue("C_Currency_ID", Integer.valueOf(C_Currency_ID));
|
||||
//
|
||||
BigDecimal InvoiceOpen = rs.getBigDecimal(3); // Set Invoice OPen Amount
|
||||
if (InvoiceOpen == null)
|
||||
|
|
|
@ -60,10 +60,6 @@ public class CalloutProcessCustomization extends CalloutEngine
|
|||
return "";
|
||||
|
||||
MProcessPara pp = new MProcessPara(ctx, (Integer) value, null);
|
||||
|
||||
// mTab.setValue("Name", pp.get_Translation("Name"));
|
||||
// mTab.setValue("Description", pp.get_Translation("Description"));
|
||||
// mTab.setValue("Help", pp.get_Translation("Help"));
|
||||
mTab.setValue("IsRange", pp.isRange());
|
||||
|
||||
return NO_ERROR;
|
||||
|
|
Loading…
Reference in New Issue