IDEMPIERE-994 Model afterSave and afterDelete must check success flag when doing DB work / based on patch from Carlos Sanchez
This commit is contained in:
parent
ce111cb754
commit
3c9696db4b
|
@ -470,6 +470,8 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element
|
||||||
@Override
|
@Override
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Default Value
|
// Default Value
|
||||||
if (isMandatory() && is_ValueChanged(COLUMNNAME_IsMandatory))
|
if (isMandatory() && is_ValueChanged(COLUMNNAME_IsMandatory))
|
||||||
{
|
{
|
||||||
|
@ -535,6 +537,8 @@ public final class MAcctSchemaElement extends X_C_AcctSchema_Element
|
||||||
@Override
|
@Override
|
||||||
protected boolean afterDelete (boolean success)
|
protected boolean afterDelete (boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Update Account Info
|
// Update Account Info
|
||||||
StringBuilder msguvd = new StringBuilder("AD_Client_ID=").append(getAD_Client_ID());
|
StringBuilder msguvd = new StringBuilder("AD_Client_ID=").append(getAD_Client_ID());
|
||||||
MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName());
|
MAccount.updateValueDescription(getCtx(),msguvd.toString(), get_TrxName());
|
||||||
|
|
|
@ -41,7 +41,8 @@ public class MAssetUse extends X_A_Asset_Use
|
||||||
protected boolean afterSave (boolean newRecord,boolean success)
|
protected boolean afterSave (boolean newRecord,boolean success)
|
||||||
{
|
{
|
||||||
log.info ("afterSave");
|
log.info ("afterSave");
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
int p_A_Asset_ID = 0;
|
int p_A_Asset_ID = 0;
|
||||||
int total_unitsused = 0;
|
int total_unitsused = 0;
|
||||||
p_A_Asset_ID = getA_Asset_ID();
|
p_A_Asset_ID = getA_Asset_ID();
|
||||||
|
@ -64,7 +65,7 @@ protected boolean afterSave (boolean newRecord,boolean success)
|
||||||
change.setUseUnits(getUseUnits());
|
change.setUseUnits(getUseUnits());
|
||||||
change.saveEx();
|
change.saveEx();
|
||||||
|
|
||||||
return true;
|
return success;
|
||||||
|
|
||||||
|
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
|
|
@ -241,6 +241,8 @@ public class MAttribute extends X_M_Attribute
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Changed to Instance Attribute
|
// Changed to Instance Attribute
|
||||||
if (!newRecord && is_ValueChanged("IsInstanceAttribute") && isInstanceAttribute())
|
if (!newRecord && is_ValueChanged("IsInstanceAttribute") && isInstanceAttribute())
|
||||||
{
|
{
|
||||||
|
|
|
@ -397,6 +397,8 @@ public class MAttributeSet extends X_M_AttributeSet
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
// Set Instance Attribute
|
// Set Instance Attribute
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (!isInstanceAttribute())
|
if (!isInstanceAttribute())
|
||||||
{
|
{
|
||||||
StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas")
|
StringBuilder sql = new StringBuilder("UPDATE M_AttributeSet mas")
|
||||||
|
|
|
@ -191,12 +191,14 @@ public class MClientShare extends X_AD_ClientShare
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (isActive())
|
if (isActive())
|
||||||
{
|
{
|
||||||
setDataToLevel();
|
setDataToLevel();
|
||||||
listChildRecords();
|
listChildRecords();
|
||||||
}
|
}
|
||||||
return true;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -345,6 +345,8 @@ public class MColumn extends X_AD_Column
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Update Fields
|
// Update Fields
|
||||||
if (!newRecord)
|
if (!newRecord)
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,6 +139,8 @@ public class MCommissionAmt extends X_C_CommissionAmt
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (!newRecord)
|
if (!newRecord)
|
||||||
updateRunHeader();
|
updateRunHeader();
|
||||||
return success;
|
return success;
|
||||||
|
|
|
@ -115,6 +115,8 @@ public class MCommissionDetail extends X_C_CommissionDetail
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (!newRecord)
|
if (!newRecord)
|
||||||
updateAmtHeader();
|
updateAmtHeader();
|
||||||
return success;
|
return success;
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class MCostDetail extends X_M_CostDetail
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -7882724307127281675L;
|
private static final long serialVersionUID = -448632684360931078L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create New Order Cost Detail for Purchase Orders.
|
* Create New Order Cost Detail for Purchase Orders.
|
||||||
|
@ -686,19 +686,7 @@ public class MCostDetail extends X_M_CostDetail
|
||||||
return !(getDeltaAmt().signum() == 0
|
return !(getDeltaAmt().signum() == 0
|
||||||
&& getDeltaQty().signum() == 0);
|
&& getDeltaQty().signum() == 0);
|
||||||
} // isDelta
|
} // isDelta
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* After Save
|
|
||||||
* @param newRecord new
|
|
||||||
* @param success success
|
|
||||||
* @return true
|
|
||||||
*/
|
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
} // afterSave
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Before Delete
|
* Before Delete
|
||||||
* @return false if processed
|
* @return false if processed
|
||||||
|
|
|
@ -152,6 +152,8 @@ import org.compiere.util.Env;
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateHeader();
|
updateHeader();
|
||||||
return success;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
@ -163,6 +165,8 @@ import org.compiere.util.Env;
|
||||||
*/
|
*/
|
||||||
protected boolean afterDelete (boolean success)
|
protected boolean afterDelete (boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateHeader();
|
updateHeader();
|
||||||
if (getC_Payment_ID() != 0 )
|
if (getC_Payment_ID() != 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -270,6 +270,8 @@ public class MDistributionLine extends X_GL_DistributionLine
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
getParent();
|
getParent();
|
||||||
m_parent.validate();
|
m_parent.validate();
|
||||||
m_parent.saveEx();
|
m_parent.saveEx();
|
||||||
|
|
|
@ -317,7 +317,9 @@ public class MDunningRunLine extends X_C_DunningRunLine
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateEntry();
|
updateEntry();
|
||||||
return success;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
@ -328,7 +330,9 @@ public class MDunningRunLine extends X_C_DunningRunLine
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterDelete (boolean success)
|
protected boolean afterDelete (boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateEntry();
|
updateEntry();
|
||||||
return success;
|
return success;
|
||||||
} // afterDelete
|
} // afterDelete
|
||||||
|
|
|
@ -244,6 +244,8 @@ public class MElementValue extends X_C_ElementValue
|
||||||
@Override
|
@Override
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord)
|
if (newRecord)
|
||||||
{
|
{
|
||||||
// afalcone [Bugs #1837219]
|
// afalcone [Bugs #1837219]
|
||||||
|
|
|
@ -66,6 +66,8 @@ public class MForm extends X_AD_Form
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord)
|
if (newRecord)
|
||||||
{
|
{
|
||||||
int AD_Role_ID = Env.getAD_Role_ID(getCtx());
|
int AD_Role_ID = Env.getAD_Role_ID(getCtx());
|
||||||
|
|
|
@ -130,6 +130,8 @@ public class MInfoWindow extends X_AD_InfoWindow
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean afterSave(boolean newRecord, boolean success) {
|
protected boolean afterSave(boolean newRecord, boolean success) {
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord) // Add to all automatic roles
|
if (newRecord) // Add to all automatic roles
|
||||||
{
|
{
|
||||||
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class MInventoryLine extends X_M_InventoryLine
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -3513145563716006099L;
|
private static final long serialVersionUID = -3864175464877913555L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Inventory Line with parameters
|
* Get Inventory Line with parameters
|
||||||
|
@ -365,17 +365,17 @@ public class MInventoryLine extends X_M_InventoryLine
|
||||||
* @param success success
|
* @param success success
|
||||||
* @return true
|
* @return true
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
//protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
//{
|
||||||
if (!success)
|
// if (!success)
|
||||||
return false;
|
// return false;
|
||||||
|
//
|
||||||
// Create MA
|
// // Create MA
|
||||||
//if (newRecord && success
|
// //if (newRecord && success
|
||||||
// && m_isManualEntry && getM_AttributeSetInstance_ID() == 0)
|
// // && m_isManualEntry && getM_AttributeSetInstance_ID() == 0)
|
||||||
// createMA();
|
// // createMA();
|
||||||
return true;
|
// return true;
|
||||||
} // afterSave
|
//} // afterSave
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Material Allocations for new Instances
|
* Create Material Allocations for new Instances
|
||||||
|
|
|
@ -227,6 +227,8 @@ public class MInvoicePaySchedule extends X_C_InvoicePaySchedule
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (is_ValueChanged("DueAmt"))
|
if (is_ValueChanged("DueAmt"))
|
||||||
{
|
{
|
||||||
log.fine("afterSave");
|
log.fine("afterSave");
|
||||||
|
|
|
@ -318,6 +318,8 @@ public class MLanguage extends X_AD_Language
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
int no = TranslationTable.getActiveLanguages(true);
|
int no = TranslationTable.getActiveLanguages(true);
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Active Languages=" + no);
|
if (log.isLoggable(Level.FINE)) log.fine("Active Languages=" + no);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -675,6 +675,8 @@ public class MLocation extends X_C_Location implements Comparator<Object>
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Value/Name change in Account
|
// Value/Name change in Account
|
||||||
if (!newRecord
|
if (!newRecord
|
||||||
&& ("Y".equals(Env.getContext(getCtx(), "$Element_LF"))
|
&& ("Y".equals(Env.getContext(getCtx(), "$Element_LF"))
|
||||||
|
|
|
@ -143,6 +143,8 @@ public class MMenu extends X_AD_Menu
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord)
|
if (newRecord)
|
||||||
insert_Tree(MTree_Base.TREETYPE_Menu);
|
insert_Tree(MTree_Base.TREETYPE_Menu);
|
||||||
return success;
|
return success;
|
||||||
|
|
|
@ -227,6 +227,8 @@ public class MOrderPaySchedule extends X_C_OrderPaySchedule
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (is_ValueChanged("DueAmt"))
|
if (is_ValueChanged("DueAmt"))
|
||||||
{
|
{
|
||||||
log.fine("afterSave");
|
log.fine("afterSave");
|
||||||
|
|
|
@ -289,6 +289,8 @@ public class MPInstance extends X_AD_PInstance
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Update Statistics
|
// Update Statistics
|
||||||
if (!newRecord
|
if (!newRecord
|
||||||
&& !isProcessing()
|
&& !isProcessing()
|
||||||
|
|
|
@ -110,6 +110,8 @@ public class MPaySchedule extends X_C_PaySchedule
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord || is_ValueChanged("Percentage") || is_ValueChanged("IsActive"))
|
if (newRecord || is_ValueChanged("Percentage") || is_ValueChanged("IsActive"))
|
||||||
{
|
{
|
||||||
log.fine("afterSave");
|
log.fine("afterSave");
|
||||||
|
|
|
@ -137,7 +137,9 @@ public class MPaySelectionLine extends X_C_PaySelectionLine
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
setHeader();
|
setHeader();
|
||||||
return success;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
@ -148,7 +150,9 @@ public class MPaySelectionLine extends X_C_PaySelectionLine
|
||||||
* @return sucess
|
* @return sucess
|
||||||
*/
|
*/
|
||||||
protected boolean afterDelete (boolean success)
|
protected boolean afterDelete (boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
setHeader();
|
setHeader();
|
||||||
return success;
|
return success;
|
||||||
} // afterDelete
|
} // afterDelete
|
||||||
|
|
|
@ -613,6 +613,8 @@ public class MPeriod extends X_C_Period
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord)
|
if (newRecord)
|
||||||
{
|
{
|
||||||
// SELECT Value FROM AD_Ref_List WHERE AD_Reference_ID=183
|
// SELECT Value FROM AD_Ref_List WHERE AD_Reference_ID=183
|
||||||
|
|
|
@ -358,6 +358,8 @@ public class MProcess extends X_AD_Process
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord) // Add to all automatic roles
|
if (newRecord) // Add to all automatic roles
|
||||||
{
|
{
|
||||||
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
||||||
|
|
|
@ -157,6 +157,8 @@ public class MProductBOM extends X_M_Product_BOM
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Product Line was changed
|
// Product Line was changed
|
||||||
if (newRecord || is_ValueChanged("M_ProductBOM_ID"))
|
if (newRecord || is_ValueChanged("M_ProductBOM_ID"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -105,6 +105,8 @@ public class MProductCategoryAcct extends X_M_Product_Category_Acct
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
checkCosting();
|
checkCosting();
|
||||||
return success;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
|
|
@ -240,6 +240,8 @@ public class MProjectLine extends X_C_ProjectLine
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateHeader();
|
updateHeader();
|
||||||
return success;
|
return success;
|
||||||
} // afterSave
|
} // afterSave
|
||||||
|
@ -252,6 +254,8 @@ public class MProjectLine extends X_C_ProjectLine
|
||||||
*/
|
*/
|
||||||
protected boolean afterDelete (boolean success)
|
protected boolean afterDelete (boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
updateHeader();
|
updateHeader();
|
||||||
return success;
|
return success;
|
||||||
} // afterDelete
|
} // afterDelete
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class MResourceAssignment extends X_S_ResourceAssignment
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 3024759545660161137L;
|
private static final long serialVersionUID = 4230793339153210998L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stnadard Constructor
|
* Stnadard Constructor
|
||||||
|
@ -72,37 +72,39 @@ public class MResourceAssignment extends X_S_ResourceAssignment
|
||||||
* @param success success
|
* @param success success
|
||||||
* @return true
|
* @return true
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
// protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
// {
|
||||||
/*
|
// /*
|
||||||
v_Description := :new.Name;
|
// if (!success)
|
||||||
IF (:new.Description IS NOT NULL AND LENGTH(:new.Description) > 0) THEN
|
// return success;
|
||||||
v_Description := v_Description || ' (' || :new.Description || ')';
|
// v_Description := :new.Name;
|
||||||
END IF;
|
// IF (:new.Description IS NOT NULL AND LENGTH(:new.Description) > 0) THEN
|
||||||
|
// v_Description := v_Description || ' (' || :new.Description || ')';
|
||||||
-- Update Expense Line
|
// END IF;
|
||||||
UPDATE S_TimeExpenseLine
|
//
|
||||||
SET Description = v_Description,
|
// -- Update Expense Line
|
||||||
Qty = :new.Qty
|
// UPDATE S_TimeExpenseLine
|
||||||
WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
// SET Description = v_Description,
|
||||||
AND (Description <> v_Description OR Qty <> :new.Qty);
|
// Qty = :new.Qty
|
||||||
|
// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
||||||
-- Update Order Line
|
// AND (Description <> v_Description OR Qty <> :new.Qty);
|
||||||
UPDATE C_OrderLine
|
//
|
||||||
SET Description = v_Description,
|
// -- Update Order Line
|
||||||
QtyOrdered = :new.Qty
|
// UPDATE C_OrderLine
|
||||||
WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
// SET Description = v_Description,
|
||||||
AND (Description <> v_Description OR QtyOrdered <> :new.Qty);
|
// QtyOrdered = :new.Qty
|
||||||
|
// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
||||||
-- Update Invoice Line
|
// AND (Description <> v_Description OR QtyOrdered <> :new.Qty);
|
||||||
UPDATE C_InvoiceLine
|
//
|
||||||
SET Description = v_Description,
|
// -- Update Invoice Line
|
||||||
QtyInvoiced = :new.Qty
|
// UPDATE C_InvoiceLine
|
||||||
WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
// SET Description = v_Description,
|
||||||
AND (Description <> v_Description OR QtyInvoiced <> :new.Qty);
|
// QtyInvoiced = :new.Qty
|
||||||
*/
|
// WHERE S_ResourceAssignment_ID = :new.S_ResourceAssignment_ID
|
||||||
return success;
|
// AND (Description <> v_Description OR QtyInvoiced <> :new.Qty);
|
||||||
} // afterSave
|
// */
|
||||||
|
// return success;
|
||||||
|
// } // afterSave
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String Representation
|
* String Representation
|
||||||
|
|
|
@ -32,8 +32,7 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -6748195415080148091L;
|
private static final long serialVersionUID = -8437258098744762898L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard Constructor
|
* Standard Constructor
|
||||||
|
@ -74,33 +73,35 @@ public class MRevenueRecognitionPlan extends X_C_RevenueRecognition_Plan
|
||||||
* @param success success
|
* @param success success
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
// protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
// {
|
||||||
if (newRecord)
|
// if (!success)
|
||||||
{
|
// return success;
|
||||||
MRevenueRecognition rr = new MRevenueRecognition(getCtx(), getC_RevenueRecognition_ID(), get_TrxName());
|
// if (newRecord)
|
||||||
if (rr.isTimeBased())
|
// {
|
||||||
{
|
// MRevenueRecognition rr = new MRevenueRecognition(getCtx(), getC_RevenueRecognition_ID(), get_TrxName());
|
||||||
/** Get InvoiveQty
|
// if (rr.isTimeBased())
|
||||||
SELECT QtyInvoiced, M_Product_ID
|
// {
|
||||||
INTO v_Qty, v_M_Product_ID
|
// /** Get InvoiveQty
|
||||||
FROM C_InvoiceLine
|
// SELECT QtyInvoiced, M_Product_ID
|
||||||
WHERE C_InvoiceLine_ID=:new.C_InvoiceLine_ID;
|
// INTO v_Qty, v_M_Product_ID
|
||||||
-- Insert
|
// FROM C_InvoiceLine
|
||||||
AD_Sequence_Next ('C_ServiceLevel', :new.AD_Client_ID, v_NextNo);
|
// WHERE C_InvoiceLine_ID=:new.C_InvoiceLine_ID;
|
||||||
INSERT INTO C_ServiceLevel
|
// -- Insert
|
||||||
(C_ServiceLevel_ID, C_RevenueRecognition_Plan_ID,
|
// AD_Sequence_Next ('C_ServiceLevel', :new.AD_Client_ID, v_NextNo);
|
||||||
AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,
|
// INSERT INTO C_ServiceLevel
|
||||||
M_Product_ID, Description, ServiceLevelInvoiced, ServiceLevelProvided,
|
// (C_ServiceLevel_ID, C_RevenueRecognition_Plan_ID,
|
||||||
Processing,Processed)
|
// AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,
|
||||||
VALUES
|
// M_Product_ID, Description, ServiceLevelInvoiced, ServiceLevelProvided,
|
||||||
(v_NextNo, :new.C_RevenueRecognition_Plan_ID,
|
// Processing,Processed)
|
||||||
:new.AD_Client_ID,:new.AD_Org_ID,'Y',SysDate,:new.CreatedBy,SysDate,:new.UpdatedBy,
|
// VALUES
|
||||||
v_M_Product_ID, NULL, v_Qty, 0,
|
// (v_NextNo, :new.C_RevenueRecognition_Plan_ID,
|
||||||
'N', 'N');
|
// :new.AD_Client_ID,:new.AD_Org_ID,'Y',SysDate,:new.CreatedBy,SysDate,:new.UpdatedBy,
|
||||||
**/
|
// v_M_Product_ID, NULL, v_Qty, 0,
|
||||||
}
|
// 'N', 'N');
|
||||||
}
|
// **/
|
||||||
return success;
|
// }
|
||||||
} // afterSave
|
// }
|
||||||
|
// return success;
|
||||||
|
// } // afterSave
|
||||||
} // MRevenueRecognitionPlan
|
} // MRevenueRecognitionPlan
|
||||||
|
|
|
@ -204,7 +204,9 @@ public class MRfQResponseLine extends X_C_RfQResponseLine
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (!isActive())
|
if (!isActive())
|
||||||
{
|
{
|
||||||
getQtys (false);
|
getQtys (false);
|
||||||
|
|
|
@ -362,7 +362,9 @@ public final class MRole extends X_AD_Role
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord && success)
|
if (newRecord && success)
|
||||||
{
|
{
|
||||||
// Add Role to SuperUser
|
// Add Role to SuperUser
|
||||||
|
|
|
@ -510,6 +510,8 @@ public class MTable extends X_AD_Table
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Sync Table ID
|
// Sync Table ID
|
||||||
MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName());
|
MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName());
|
||||||
if (seq == null || seq.get_ID() == 0)
|
if (seq == null || seq.get_ID() == 0)
|
||||||
|
|
|
@ -153,6 +153,8 @@ public class MTask extends X_AD_Task
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("Success=" + success);
|
if (log.isLoggable(Level.FINE)) log.fine("Success=" + success);
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (! newRecord)
|
if (! newRecord)
|
||||||
{
|
{
|
||||||
// Menu/Workflow
|
// Menu/Workflow
|
||||||
|
|
|
@ -353,6 +353,8 @@ public class MTree_Base extends X_AD_Tree
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord) // Base Node
|
if (newRecord) // Base Node
|
||||||
{
|
{
|
||||||
if (TREETYPE_BPartner.equals(getTreeType()))
|
if (TREETYPE_BPartner.equals(getTreeType()))
|
||||||
|
|
|
@ -118,6 +118,8 @@ public class MWindow extends X_AD_Window
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
if (newRecord) // Add to all automatic roles
|
if (newRecord) // Add to all automatic roles
|
||||||
{
|
{
|
||||||
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'");
|
||||||
|
|
|
@ -207,7 +207,9 @@ public class M_Element extends X_AD_Element
|
||||||
* @return success
|
* @return success
|
||||||
*/
|
*/
|
||||||
protected boolean afterSave (boolean newRecord, boolean success)
|
protected boolean afterSave (boolean newRecord, boolean success)
|
||||||
{
|
{
|
||||||
|
if (!success)
|
||||||
|
return success;
|
||||||
// Update Columns, Fields, Parameters, Print Info
|
// Update Columns, Fields, Parameters, Print Info
|
||||||
if (!newRecord)
|
if (!newRecord)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue