Skip to content

Commit

Permalink
Merge branch 'hotfix/3.8.0#002' of https://github.com/adempiere/ademp…
Browse files Browse the repository at this point in the history
…iere into hotfix/3.8.0#002
  • Loading branch information
yamelsenih committed Nov 19, 2015
2 parents e3e4ead + 403d9c7 commit cf330e4
Show file tree
Hide file tree
Showing 30 changed files with 691 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ public void createCostAdjustment() {
}
}

@Override
/*@Override
public void processCostDetail(MCostDetail costDetail) {
}
}*/

@Override
protected List<CostComponent> getCalculatedCosts() {
Expand Down
4 changes: 2 additions & 2 deletions base/src/org/adempiere/engine/AveragePOCostingMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ public void createCostAdjustment() {
}
}

@Override
/*@Override
public void processCostDetail(MCostDetail costDetail) {
}
}*/

@Override
protected List<CostComponent> getCalculatedCosts() {
Expand Down
2 changes: 1 addition & 1 deletion base/src/org/adempiere/engine/ICostingMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ public interface ICostingMethod
public void setCostingMethod(MAcctSchema accountSchema, MTransaction transaction, IDocumentLine model,
MCost dimension, BigDecimal costThisLevel, BigDecimal costLowLevel, Boolean isSalesTransaction);
public MCostDetail process();
public void processCostDetail(MCostDetail costDetail);
//public void processCostDetail(MCostDetail costDetail);
}
4 changes: 2 additions & 2 deletions base/src/org/adempiere/engine/LastInvoiceCostingMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public MCostDetail process() {
return costDetail;
}

@Override
/*@Override
public void processCostDetail(MCostDetail mCostdetail) {
// TODO Auto-generated method stub
}
}*/

@Override
protected List<CostComponent> getCalculatedCosts() {
Expand Down
4 changes: 2 additions & 2 deletions base/src/org/adempiere/engine/LastPOPriceCostingMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ else if ( costDetail.getM_InOutLine_ID() != 0 // AR Shipment Detail Record
return costDetail;
}

@Override
/*@Override
public void processCostDetail(MCostDetail mCostdetail) {
// TODO Auto-generated method stub
}
}*/

@Override
protected List<CostComponent> getCalculatedCosts() {
Expand Down
8 changes: 4 additions & 4 deletions base/src/org/adempiere/engine/StandardCostingMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ public BigDecimal getNewAccumulatedQuantity(MCostDetail cd) {
return cd.getCumulatedQty().add(cd.getQty());
}

public void processCostDetail(MCostDetail costDetail) {
/*public void processCostDetail(MCostDetail costDetail) {
if (!costDetail.isProcessed()) {
MAcctSchema as = MAcctSchema.get(costDetail.getCtx(),
costDetail.getC_AcctSchema_ID());
MClient client = MClient.get(as.getCtx(), as.getAD_Client_ID());
if (client.isCostImmediate())
costDetail.process();
}
}
}*/

@Override
protected List<CostComponent> getCalculatedCosts() {
Expand Down Expand Up @@ -660,7 +660,7 @@ public MCostDetail createVarianceCostDetail(MPPCostCollector costCollector,
costDetailVariance.setQty(quantity);
costDetailVariance.setDateAcct(costCollector.getDateAcct());
costDetailVariance.saveEx();
processCostDetail(costDetailVariance);
//processCostDetail(costDetailVariance);
return costDetailVariance;
}

Expand Down Expand Up @@ -708,7 +708,7 @@ public void createActivityControl(MPPCostCollector costCollector) {
costDetail.setDateAcct(costCollector.getDateAcct());
costDetail.setCostAmt(costs.negate());
costDetail.saveEx();
processCostDetail(costDetail);
//processCostDetail(costDetail);
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions base/src/org/compiere/acct/Doc_Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,13 @@ else if (getDocumentType().equals(DOCTYPE_APInvoice))
serviceAmt = serviceAmt.add(amt);
}
//
if (line.getM_Product_ID() != 0
/*if (line.getM_Product_ID() != 0
&& line.getProduct().isService()) // otherwise Inv Matching
MCostDetail.createInvoice(as, line.getAD_Org_ID(),
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
line.get_ID(), 0, // No Cost Element
line.getAmtSource(), line.getQty(),
line.getDescription(), getTrxName());
line.getDescription(), getTrxName());*/
}
}
// Set Locations
Expand Down Expand Up @@ -645,13 +645,13 @@ else if (getDocumentType().equals(DOCTYPE_APCredit))
serviceAmt = serviceAmt.add(amt);
}
//
if (line.getM_Product_ID() != 0
/*if (line.getM_Product_ID() != 0
&& line.getProduct().isService()) // otherwise Inv Matching
MCostDetail.createInvoice(as, line.getAD_Org_ID(),
line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(),
line.get_ID(), 0, // No Cost Element
line.getAmtSource().negate(), line.getQty(),
line.getDescription(), getTrxName());
line.getDescription(), getTrxName());*/
}
}
// Set Locations
Expand Down Expand Up @@ -914,11 +914,11 @@ private boolean landedCost (MAcctSchema as, Fact fact, DocLine line, boolean dr)
allocationAmt = allocationAmt.negate();
// AZ Goodwill
// use createInvoice to create/update non Material Cost Detail
MCostDetail.createInvoice(as, lca.getAD_Org_ID(),
/*MCostDetail.createInvoice(as, lca.getAD_Org_ID(),
lca.getM_Product_ID(), lca.getM_AttributeSetInstance_ID(),
C_InvoiceLine_ID, lca.getM_CostElement_ID(),
allocationAmt, lca.getQty(),
desc, getTrxName());
desc, getTrxName());*/
// end AZ
}

Expand Down
8 changes: 5 additions & 3 deletions base/src/org/compiere/model/MCost.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel))
* @return current cost price or null
* @deprecated
*/
public static BigDecimal getCurrentCost (MProduct product,
/*public static BigDecimal getCurrentCost (MProduct product,
int M_AttributeSetInstance_ID,
MAcctSchema as, int AD_Org_ID, int M_Warehouse_ID, String costingMethod,
BigDecimal qty, int C_OrderLine_ID,
Expand Down Expand Up @@ -481,6 +481,7 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel))
as, AD_Org_ID, M_Warehouse_ID, as.getM_CostType_ID(), costingMethod, qty,
C_OrderLine_ID, zeroCostsOK, trxName);
} // getCurrentCost
*/

/**
* Get Current Cost Price for Costing Level
Expand Down Expand Up @@ -1000,7 +1001,7 @@ public static BigDecimal getPOPrice (MProduct product, int C_OrderLine_ID, int C
* @param client client
*/
@Deprecated
public static void create (MClient client)
/*public static void create (MClient client)
{
MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(client.getCtx(), client.getAD_Client_ID());
String trxName = client.get_TrxName();
Expand Down Expand Up @@ -1062,6 +1063,7 @@ public static void create (MClient client)
trx.close();
}
} // create
*/


/**
Expand Down Expand Up @@ -2025,7 +2027,7 @@ WHERE EXISTS (SELECT * FROM M_CostElement ce

Adempiere.startup(true);
MClient client = MClient.get(Env.getCtx(), 11); // GardenWorld
create(client);
//create(client);

} // main

Expand Down
23 changes: 17 additions & 6 deletions base/src/org/compiere/model/MCostDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public static List<MCostDetail> getAfterDate (MCostDetail cd, String costingLeve
* @param trxName transaction
* @return true if created
*/
public static boolean createOrder (MAcctSchema as, int AD_Org_ID,
/*public static boolean createOrder (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int C_OrderLine_ID, int M_CostElement_ID,
BigDecimal Amt, BigDecimal Qty,
Expand Down Expand Up @@ -569,6 +569,7 @@ public static boolean createOrder (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createOrder
*/


/**
Expand All @@ -586,7 +587,7 @@ public static boolean createOrder (MAcctSchema as, int AD_Org_ID,
* @param trxName transaction
* @return true if created
*/
public static boolean createInvoice (MAcctSchema as, int AD_Org_ID,
/*public static boolean createInvoice (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int C_InvoiceLine_ID, int M_CostElement_ID,
BigDecimal Amt, BigDecimal Qty,
Expand Down Expand Up @@ -638,6 +639,7 @@ public static boolean createInvoice (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createInvoice
*/

/**
* Create New Shipment Cost Detail for SO Shipments.
Expand All @@ -655,7 +657,7 @@ public static boolean createInvoice (MAcctSchema as, int AD_Org_ID,
* @param trxName transaction
* @return true if no error
*/
public static boolean createShipment (MAcctSchema as, int AD_Org_ID,
/*public static boolean createShipment (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int M_InOutLine_ID, int M_CostElement_ID,
BigDecimal Amt, BigDecimal Qty,
Expand Down Expand Up @@ -708,6 +710,7 @@ public static boolean createShipment (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createShipment
*/

/**
* Create New Order Cost Detail for Physical Inventory.
Expand All @@ -724,6 +727,7 @@ public static boolean createShipment (MAcctSchema as, int AD_Org_ID,
* @param trxName transaction
* @return true if no error
*/
/*
public static boolean createInventory (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int M_InventoryLine_ID, int M_CostElement_ID,
Expand Down Expand Up @@ -776,6 +780,7 @@ public static boolean createInventory (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createInventory
*/

/**
* Create New Order Cost Detail for Movements.
Expand All @@ -793,7 +798,7 @@ public static boolean createInventory (MAcctSchema as, int AD_Org_ID,
* @param trxName transaction
* @return true if no error
*/
public static boolean createMovement (MAcctSchema as, int AD_Org_ID,
/*public static boolean createMovement (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int M_MovementLine_ID, int M_CostElement_ID,
BigDecimal Amt, BigDecimal Qty, boolean from,
Expand Down Expand Up @@ -848,6 +853,7 @@ public static boolean createMovement (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createMovement
*/

/**
* Create New Order Cost Detail for Production.
Expand All @@ -864,7 +870,7 @@ public static boolean createMovement (MAcctSchema as, int AD_Org_ID,
* @param trxName transaction
* @return true if no error
*/
public static boolean createProduction (MAcctSchema as, int AD_Org_ID,
/*public static boolean createProduction (MAcctSchema as, int AD_Org_ID,
int M_Product_ID, int M_AttributeSetInstance_ID,
int M_ProductionLine_ID, int M_CostElement_ID,
BigDecimal Amt, BigDecimal Qty,
Expand Down Expand Up @@ -916,6 +922,7 @@ public static boolean createProduction (MAcctSchema as, int AD_Org_ID,
s_log.config("(" + ok + ") " + cd);
return ok;
} // createProduction
*/

/**************************************************************************
* Get Cost Detail
Expand Down Expand Up @@ -993,7 +1000,7 @@ public static MCostDetail get (Properties ctx, String whereClause,
* @param trxName transaction
* @return true if no error
*/
public static boolean processProduct (MProduct product, String trxName)
/*public static boolean processProduct (MProduct product, String trxName)
{
final String whereClause = I_M_CostDetail.COLUMNNAME_M_Product_ID+"=?"
+ " AND "+I_M_CostDetail.COLUMNNAME_Processed+"=?";
Expand All @@ -1012,6 +1019,7 @@ public static boolean processProduct (MProduct product, String trxName)
s_log.config("OK=" + counterOK + ", Errors=" + counterError);
return counterError == 0;
} // processProduct
*/

/** Logger */
private static CLogger s_log = CLogger.getCLogger (MCostDetail.class);
Expand Down Expand Up @@ -1296,6 +1304,7 @@ public String toString ()
* The record is saved if processed.
* @return true if processed
*/
/*
public synchronized boolean process()
{
if (isProcessed())
Expand Down Expand Up @@ -1355,6 +1364,7 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel)) {
log.info(ok + " - " + toString());
return ok;
} // process
*/


/**
Expand Down Expand Up @@ -1629,6 +1639,7 @@ public static BigDecimal getByDocLineMatchInv(MInvoiceLine invoiceLine, MInOutLi
invoiceLine.getAD_Client_ID(),
acctSchemaId,
invoiceLine.getM_Product_ID(),
invoiceLine.getM_AttributeSetInstance_ID(),
costTypeId,
invoiceLine.getC_InvoiceLine_ID(),
inOutLine.getM_InOutLine_ID())
Expand Down
4 changes: 2 additions & 2 deletions base/src/org/compiere/model/MInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel) && M_AttributeSe

//if isReversal CostDetail is created from CostDetail of original document
// is made a new CostDetail where Amt and Qty are negate
private void createCostDetail(MTransaction trx, int reversalLine_ID) {
/*private void createCostDetail(MTransaction trx, int reversalLine_ID) {
String whereClause = MCostDetail.COLUMNNAME_M_InventoryLine_ID+"=?"
+" AND "+MCostDetail.COLUMNNAME_M_AttributeSetInstance_ID+"=?";
Expand All @@ -1019,7 +1019,7 @@ private void createCostDetail(MTransaction trx, int reversalLine_ID) {
cdnew.process();
}
}
}*/

/**
* Document Status is Complete or Closed
Expand Down
2 changes: 1 addition & 1 deletion base/src/org/compiere/model/MMatchInv.java
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(CostingLevel))
{
final ICostingMethod method = CostingMethodFactory.get().getCostingMethod(ct.getCostingMethod());
method.setCostingMethod(as, trx, this, dimension, Env.ZERO, Env.ZERO, false);
method.processCostDetail(cd);
//method.processCostDetail(cd);
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions base/src/org/compiere/model/ProductCost.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,15 @@ public MAccount getAccountDefault (int AcctType, MAcctSchema as, int AD_Org_ID)
* @return cost or null, if qty or costs cannot be determined
* @deprecated
*/
public BigDecimal getProductCosts (MAcctSchema as, int AD_Org_ID, int M_Warehouse_ID,
/*public BigDecimal getProductCosts (MAcctSchema as, int AD_Org_ID, int M_Warehouse_ID,
String costingMethod, int C_OrderLine_ID, boolean zeroCostsOK)
{
if (m_qty == null)
{
log.fine("No Qty");
return null;
}
/** Old Costing
*//** Old Costing
MClient client = MClient.get(as.getCtx(), as.getAD_Client_ID());
if (!client.isUseBetaFunctions())
{
Expand All @@ -400,7 +400,7 @@ public BigDecimal getProductCosts (MAcctSchema as, int AD_Org_ID, int M_Warehous
log.fine("Qty(" + m_qty + ") * Cost(" + itemCost + ") = " + cost);
return cost;
}
**/
**//*
// No Product
if (m_product == null)
Expand All @@ -417,7 +417,8 @@ public BigDecimal getProductCosts (MAcctSchema as, int AD_Org_ID, int M_Warehous
return null;
}
return cost;
} // getProductCosts
} // getProductCosts*/



/**
Expand Down

0 comments on commit cf330e4

Please sign in to comment.