fixes #37 Make iDempiere safer using saveEx instead of save

https://bitbucket.org/idempiere/idempiere/issue/37
This commit is contained in:
Carlos Ruiz 2011-06-14 15:39:10 -05:00
parent 21d5cc1e40
commit 26337eddb8
212 changed files with 590 additions and 566 deletions

View File

@ -105,7 +105,7 @@ public class LanguageMaintenance extends SvrProcess
if (m_language.isSystemLanguage())
{
m_language.setIsSystemLanguage(false);
m_language.save();
m_language.saveEx();
}
}

View File

@ -280,7 +280,7 @@ public class AllocationAuto extends SvrProcess
if (allocated != null && allocated.compareTo(payment.getPayAmt()) == 0)
{
payment.setIsAllocated(true);
payment.save();
payment.saveEx();
}
else
list.add (payment);
@ -328,7 +328,7 @@ public class AllocationAuto extends SvrProcess
if (invoice.getOpenAmt(false, null).signum() == 0)
{
invoice.setIsPaid(true);
invoice.save();
invoice.saveEx();
}
else
list.add (invoice);
@ -831,7 +831,7 @@ public class AllocationAuto extends SvrProcess
if (success)
success = m_allocation.save();
else
m_allocation.save();
m_allocation.saveEx();
addLog(0, m_allocation.getDateAcct(), null, m_allocation.getDescription());
m_allocation = null;
return success;

View File

@ -217,7 +217,7 @@ public class AssetDelivery extends SvrProcess
email.setMessageText (message);
}
String msg = email.send();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).save();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).saveEx();
if (!EMail.SENT_OK.equals(msg))
return "** Not delivered: " + user.getEMail() + " - " + msg;
//
@ -284,13 +284,13 @@ public class AssetDelivery extends SvrProcess
log.warning("No DowloadURL for A_Asset_ID=" + A_Asset_ID);
}
String msg = email.send();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).save();
new MUserMail(m_MailText, asset.getAD_User_ID(), email).saveEx();
if (!EMail.SENT_OK.equals(msg))
return "** Not delivered: " + user.getEMail() + " - " + msg;
MAssetDelivery ad = asset.confirmDelivery(email, user.getAD_User_ID());
ad.save();
asset.save();
ad.saveEx();
asset.saveEx();
//
log.fine((System.currentTimeMillis()-start) + " ms");
// success

View File

@ -143,7 +143,7 @@ public class BOMValidate extends SvrProcess
if (!validateOldProduct (m_product))
{
m_product.setIsVerified(false);
m_product.save();
m_product.saveEx();
return m_product.getName() + " @NotValid@";
}
@ -155,14 +155,14 @@ public class BOMValidate extends SvrProcess
if (!validateBOM(boms[i]))
{
m_product.setIsVerified(false);
m_product.save();
m_product.saveEx();
return m_product.getName() + " " + boms[i].getName() + " @NotValid@";
}
}
// OK
m_product.setIsVerified(true);
m_product.save();
m_product.saveEx();
return m_product.getName() + " @IsValid@";
} // validateProduct

View File

@ -138,7 +138,7 @@ public class BPartnerValidate extends SvrProcess
MPayment payment = payments[i];
if (payment.testAllocation())
{
payment.save();
payment.saveEx();
changed++;
}
}
@ -161,7 +161,7 @@ public class BPartnerValidate extends SvrProcess
MInvoice invoice = invoices[i];
if (invoice.testAllocation())
{
invoice.save();
invoice.saveEx();
changed++;
}
}

View File

@ -103,7 +103,7 @@ public class BankStatementMatcher extends SvrProcess
ibs.setC_Invoice_ID(info.getC_Invoice_ID());
if (info.getC_BPartner_ID() > 0)
ibs.setC_BPartner_ID(info.getC_BPartner_ID());
ibs.save();
ibs.saveEx();
return "OK";
}
}
@ -137,7 +137,7 @@ public class BankStatementMatcher extends SvrProcess
bsl.setC_Invoice_ID(info.getC_Invoice_ID());
if (info.getC_BPartner_ID() > 0)
bsl.setC_BPartner_ID(info.getC_BPartner_ID());
bsl.save();
bsl.saveEx();
return "OK";
}
}

View File

@ -99,7 +99,7 @@ public class BankStatementPayment extends SvrProcess
ibs.setC_Payment_ID(payment.getC_Payment_ID());
ibs.setC_Currency_ID (payment.getC_Currency_ID());
ibs.setTrxAmt(payment.getPayAmt(true));
ibs.save();
ibs.saveEx();
//
String retString = "@C_Payment_ID@ = " + payment.getDocumentNo();
if (payment.getOverUnderAmt().signum() != 0)
@ -131,7 +131,7 @@ public class BankStatementPayment extends SvrProcess
throw new AdempiereSystemError("Could not create Payment");
// update statement
bsl.setPayment(payment);
bsl.save();
bsl.saveEx();
//
String retString = "@C_Payment_ID@ = " + payment.getDocumentNo();
if (payment.getOverUnderAmt().signum() != 0)
@ -221,10 +221,10 @@ public class BankStatementPayment extends SvrProcess
}
else
return null;
payment.save();
payment.saveEx();
//
payment.processIt(MPayment.DOCACTION_Complete);
payment.save();
payment.saveEx();
return payment;
} // createPayment

View File

@ -123,7 +123,7 @@ public class ColumnEncryption extends SvrProcess {
|| "Name".equalsIgnoreCase(column.getColumnName())) {
if (column.isEncrypted()) {
column.setIsEncrypted(false);
column.save();
column.saveEx();
}
return columnName + ": cannot be encrypted";
}

View File

@ -245,15 +245,15 @@ public class CommissionCalc extends SvrProcess
//
createDetail(sql.toString(), comAmt);
comAmt.calculateCommission();
comAmt.save();
comAmt.saveEx();
} // for all commission lines
// comRun.updateFromAmt();
// comRun.save();
// comRun.saveEx();
// Save Last Run
m_com.setDateLastRun (p_StartDate);
m_com.save();
m_com.saveEx();
return "@C_CommissionRun_ID@ = " + comRun.getDocumentNo()
+ " - " + comRun.getDescription();

View File

@ -95,10 +95,10 @@ public class CopyOrder extends SvrProcess
MOrder original = new MOrder (getCtx(), p_C_Order_ID, get_TrxName());
original.setDocAction(MOrder.DOCACTION_Complete);
original.processIt(MOrder.DOCACTION_Complete);
original.save();
original.saveEx();
original.setDocAction(MOrder.DOCACTION_Close);
original.processIt(MOrder.DOCACTION_Close);
original.save();
original.saveEx();
}
//
// Env.setSOTrx(getCtx(), newOrder.isSOTrx());

View File

@ -152,7 +152,7 @@ public class DistributionCreate extends SvrProcess
if (m_singleOrder != null)
{
m_singleOrder.setDescription("# " + counter + " - " + m_totalQty);
m_singleOrder.save();
m_singleOrder.saveEx();
}
return "@Created@ #" + counter + " - @Qty@=" + m_totalQty;

View File

@ -373,7 +373,7 @@ public class DistributionRun extends SvrProcess
&& detail.isCanAdjust())
{
detail.adjustQty(difference);
detail.save();
detail.saveEx();
return;
}
}
@ -411,7 +411,7 @@ public class DistributionRun extends SvrProcess
+ ", Allocation=" + detail.getActualAllocation()
+ ", DiffRatio=" + diffRatio);
detail.adjustQty(diffRatio);
detail.save();
detail.saveEx();
}
}
}
@ -639,7 +639,7 @@ public class DistributionRun extends SvrProcess
log.info("Qty Total Demand:" + totalration);
BigDecimal factor = ration.divide(totalration, 12 , BigDecimal.ROUND_HALF_UP);
record.setQty(drl.getTotalQty().multiply(factor));
record.save();
record.saveEx();
}
log.fine("inserted #" + no);
return no;
@ -739,7 +739,7 @@ public class DistributionRun extends SvrProcess
BigDecimal ration = record.getRatio();
BigDecimal factor = ration.divide(total_ration,BigDecimal.ROUND_HALF_UP);
record.setQty(factor.multiply(drl.getTotalQty()));
record.save();
record.saveEx();
}
log.fine("inserted #" + no);
return no;
@ -798,7 +798,7 @@ public class DistributionRun extends SvrProcess
line.setDescription(Msg.translate(getCtx(), "PlannedQty"));
else
line.setDescription(m_run.getName());
line.save();
line.saveEx();
break;
//addLog(0,null, detail.getActualAllocation(), order.getDocumentNo()
// + ": " + bp.getName() + " - " + product.getName());

View File

@ -51,7 +51,7 @@ public class DocTypeCounterValidate extends SvrProcess
throw new IllegalArgumentException("Not found C_DocTypeCounter_ID=" + p_C_DocTypeCounter_ID);
//
String error = m_counter.validate();
m_counter.save();
m_counter.saveEx();
if (error != null)
throw new Exception(error);

View File

@ -199,7 +199,7 @@ public class DunningPrint extends SvrProcess
//
String msg = email.send();
MUserMail um = new MUserMail(mText, entry.getAD_User_ID(), email);
um.save();
um.saveEx();
if (msg.equals(EMail.SENT_OK))
{
addLog (entry.get_ID(), null, null,
@ -231,7 +231,7 @@ public class DunningPrint extends SvrProcess
} // for all dunning letters
if (errors==0) {
run.setProcessed(true);
run.save();
run.saveEx();
}
if (p_EMailPDF)
return "@Sent@=" + count + " - @Errors@=" + errors;

View File

@ -186,7 +186,7 @@ public class ExpenseAPInvoice extends SvrProcess
new IllegalStateException("Cannot save Invoice Line");
// Update TEL
line.setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
line.save();
line.saveEx();
} // for all expense lines
} // ********* Expense Line Loop
}

View File

@ -282,7 +282,7 @@ public class ImportAccount extends SvrProcess
noInsert++;
impEV.setC_ElementValue_ID(ev.getC_ElementValue_ID());
impEV.setI_IsImported(true);
impEV.save();
impEV.saveEx();
}
else
{
@ -304,7 +304,7 @@ public class ImportAccount extends SvrProcess
{
noUpdate++;
impEV.setI_IsImported(true);
impEV.save();
impEV.saveEx();
}
else
{

View File

@ -411,7 +411,7 @@ implements ImportProcess
if (impBP.getFax() != null)
bpl.setFax(impBP.getFax());
ModelValidationEngine.get().fireImportValidate(this, impBP, bpl, ImportValidator.TIMING_AFTER_IMPORT);
bpl.save();
bpl.saveEx();
}
else // New Location
if (impBP.getC_Country_ID() != 0
@ -569,7 +569,7 @@ implements ImportProcess
MContactInterest ci = MContactInterest.get(getCtx(),
impBP.getR_InterestArea_ID(), user.getAD_User_ID(),
true, get_TrxName());
ci.save(); // don't subscribe or re-activate
ci.saveEx(); // don't subscribe or re-activate
}
//
impBP.setI_IsImported(true);

View File

@ -492,7 +492,7 @@ public class ImportBankStatement extends SvrProcess
imp.setC_BankStatementLine_ID(line.getC_BankStatementLine_ID());
imp.setI_IsImported(true);
imp.setProcessed(true);
imp.save();
imp.saveEx();
noInsertLine++;
lineNo += 10;
}

View File

@ -253,7 +253,7 @@ public class ImportConversionRate extends SvrProcess
imp.setC_Conversion_Rate_ID(rate.getC_Conversion_Rate_ID());
imp.setI_IsImported(true);
imp.setProcessed(true);
imp.save();
imp.saveEx();
noInsert++;
//
if (imp.isCreateReciprocalRate())

View File

@ -726,12 +726,12 @@ public class ImportGLJournal extends SvrProcess
imp.getC_Project_ID(), imp.getC_Campaign_ID(), imp.getC_Activity_ID(),
imp.getUser1_ID(), imp.getUser2_ID(), 0, 0);
if (acct != null && acct.get_ID() == 0)
acct.save();
acct.saveEx();
if (acct == null || acct.get_ID() == 0)
{
imp.setI_ErrorMsg("ERROR creating Account");
imp.setI_IsImported(false);
imp.save();
imp.saveEx();
continue;
}
else

View File

@ -156,7 +156,7 @@ public class ImportInOutConfirm extends SvrProcess
{
importLine.setI_IsImported(false);
importLine.setI_ErrorMsg("ID Not Found");
importLine.save();
importLine.saveEx();
}
else
{

View File

@ -310,7 +310,7 @@ public class ImportInventory extends SvrProcess
if (mas.isSerNo() && imp.getSerNo() != null)
masi.setSerNo(imp.getSerNo());
masi.setDescription();
masi.save();
masi.saveEx();
M_AttributeSetInstance_ID = masi.getM_AttributeSetInstance_ID();
}
}

View File

@ -645,7 +645,7 @@ public class ImportInvoice extends SvrProcess
if (invoice != null)
{
invoice.processIt(m_docAction);
invoice.save();
invoice.saveEx();
}
// Group Change
oldC_BPartner_ID = imp.getC_BPartner_ID();
@ -690,7 +690,7 @@ public class ImportInvoice extends SvrProcess
if (imp.getDateAcct() != null)
invoice.setDateAcct(imp.getDateAcct());
//
invoice.save();
invoice.saveEx();
noInsert++;
lineNo = 10;
}
@ -729,7 +729,7 @@ public class ImportInvoice extends SvrProcess
BigDecimal taxAmt = imp.getTaxAmt();
if (taxAmt != null && Env.ZERO.compareTo(taxAmt) != 0)
line.setTaxAmt(taxAmt);
line.save();
line.saveEx();
//
imp.setC_InvoiceLine_ID(line.getC_InvoiceLine_ID());
imp.setI_IsImported(true);
@ -741,7 +741,7 @@ public class ImportInvoice extends SvrProcess
if (invoice != null)
{
invoice.processIt (m_docAction);
invoice.save();
invoice.saveEx();
}
rs.close();
pstmt.close();

View File

@ -668,7 +668,7 @@ public class ImportOrder extends SvrProcess
order.setDocAction(m_docAction);
order.processIt (m_docAction);
}
order.save();
order.saveEx();
}
oldC_BPartner_ID = imp.getC_BPartner_ID();
oldC_BPartner_Location_ID = imp.getC_BPartner_Location_ID();
@ -726,7 +726,7 @@ public class ImportOrder extends SvrProcess
if (imp.getC_OrderSource() != null)
order.setC_OrderSource_ID(imp.getC_OrderSource_ID());
//
order.save();
order.saveEx();
noInsert++;
lineNo = 10;
}
@ -754,7 +754,7 @@ public class ImportOrder extends SvrProcess
line.setFreightAmt(imp.getFreightAmt());
if (imp.getLineDescription() != null)
line.setDescription(imp.getLineDescription());
line.save();
line.saveEx();
imp.setC_OrderLine_ID(line.getC_OrderLine_ID());
imp.setI_IsImported(true);
imp.setProcessed(true);
@ -769,7 +769,7 @@ public class ImportOrder extends SvrProcess
order.setDocAction(m_docAction);
order.processIt (m_docAction);
}
order.save();
order.saveEx();
}
rs.close();
pstmt.close();

View File

@ -496,14 +496,14 @@ public class ImportPayment extends SvrProcess
imp.setC_Payment_ID(payment.getC_Payment_ID());
imp.setI_IsImported(true);
imp.setProcessed(true);
imp.save();
imp.saveEx();
noInsert++;
if (payment != null && m_docAction != null && m_docAction.length() > 0)
{
payment.setDocAction(m_docAction);
payment.processIt (m_docAction);
payment.save();
payment.saveEx();
}
}

View File

@ -632,7 +632,7 @@ public class ImportProduct extends SvrProcess implements ImportProcess
p_M_PriceList_Version_ID, M_Product_ID, get_TrxName());
pp.setPrices(PriceList, PriceStd, PriceLimit);
ModelValidationEngine.get().fireImportValidate(this, imp, pp, ImportValidator.TIMING_AFTER_IMPORT);
pp.save();
pp.saveEx();
}
}

View File

@ -577,7 +577,7 @@ public class InOutGenerate extends SvrProcess
// Fails if there is a confirmation
if (!m_shipment.processIt(p_docAction))
log.warning("Failed: " + m_shipment);
m_shipment.save();
m_shipment.saveEx();
//
addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, m_shipment.getDocumentNo());
m_created++;

View File

@ -307,7 +307,7 @@ public class InventoryCountCreate extends SvrProcess
{
m_line.setQtyBook(m_line.getQtyBook().add(QtyOnHand));
m_line.setQtyCount(m_line.getQtyCount().add(QtyOnHand));
m_line.save();
m_line.saveEx();
return 0;
}
// Save Old Line info
@ -321,7 +321,7 @@ public class InventoryCountCreate extends SvrProcess
m_line.setM_AttributeSetInstance_ID(0);
m_line.setQtyBook(m_line.getQtyBook().add(QtyOnHand));
m_line.setQtyCount(m_line.getQtyCount().add(QtyOnHand));
m_line.save();
m_line.saveEx();
//
MInventoryLineMA ma = new MInventoryLineMA (m_line,
M_AttributeSetInstance_ID, QtyOnHand);

View File

@ -134,13 +134,13 @@ public class InvoiceBatchProcess extends SvrProcess
// Update Batch Line
line.setC_Invoice_ID(m_invoice.getC_Invoice_ID());
line.setC_InvoiceLine_ID(invoiceLine.getC_InvoiceLine_ID());
line.save();
line.saveEx();
} // for all lines
completeInvoice();
//
batch.setProcessed(true);
batch.save();
batch.saveEx();
return "#" + m_count;
} // doIt
@ -156,7 +156,7 @@ public class InvoiceBatchProcess extends SvrProcess
m_invoice.setDocAction(p_DocAction);
m_invoice.processIt(p_DocAction);
m_invoice.save();
m_invoice.saveEx();
addLog(0, m_invoice.getDateInvoiced(), m_invoice.getGrandTotal(), m_invoice.getDocumentNo());
m_count++;

View File

@ -286,7 +286,7 @@ public class InvoiceNGL extends SvrProcess
line.setAmtAcctDr (dr);
line.setAmtSourceCr (cr);
line.setAmtAcctCr (cr);
line.save();
line.saveEx();
//
if (AD_Org_ID == 0) // invoice org id
AD_Org_ID = gl.getAD_Org_ID();
@ -336,7 +336,7 @@ public class InvoiceNGL extends SvrProcess
line.setC_ValidCombination_ID(acct.getC_ValidCombination_ID());
line.setAmtSourceCr (drTotal);
line.setAmtAcctCr (drTotal);
line.save();
line.saveEx();
}
// DR Entry = Loss
if (crTotal.signum() != 0)
@ -354,7 +354,7 @@ public class InvoiceNGL extends SvrProcess
line.setC_ValidCombination_ID(acct.getC_ValidCombination_ID());
line.setAmtSourceDr (crTotal);
line.setAmtAcctDr (crTotal);
line.save();
line.saveEx();
}
} // createBalancing

View File

@ -74,14 +74,14 @@ public class InvoicePayScheduleValidate extends SvrProcess
}
boolean valid = invoice.getGrandTotal().compareTo(total) == 0;
invoice.setIsPayScheduleValid(valid);
invoice.save();
invoice.saveEx();
// Schedule
for (int i = 0; i < schedule.length; i++)
{
if (schedule[i].isValid() != valid)
{
schedule[i].setIsValid(valid);
schedule[i].save();
schedule[i].saveEx();
}
}
String msg = "@OK@";

View File

@ -319,7 +319,7 @@ public class InvoicePrint extends SvrProcess
//
String msg = email.send();
MUserMail um = new MUserMail(mText, getAD_User_ID(), email);
um.save();
um.saveEx();
if (msg.equals(EMail.SENT_OK))
{
addLog (C_Invoice_ID, null, null,

View File

@ -52,7 +52,7 @@ public class MatchInvDelete extends SvrProcess
throw new AdempiereUserError("@NotFound@ @M_MatchInv_ID@ " + p_M_MatchInv_ID);
if (inv.delete(true))
return "@OK@";
inv.save();
inv.saveEx();
return "@Error@";
} // doIt

View File

@ -72,7 +72,7 @@ public class MatchPODelete extends SvrProcess
}
return "@OK@";
}
po.save();
po.saveEx();
return "@Error@";
} // doIt

View File

@ -174,7 +174,7 @@ public class OrderBatchProcess extends SvrProcess
order.setDocAction(p_DocAction);
if (order.processIt(p_DocAction))
{
order.save();
order.saveEx();
addLog(0, null, null, order.getDocumentNo() + ": OK");
return true;
}

View File

@ -73,14 +73,14 @@ public class OrderPayScheduleValidate extends SvrProcess
}
boolean valid = order.getGrandTotal().compareTo(total) == 0;
order.setIsPayScheduleValid(valid);
order.save();
order.saveEx();
// Schedule
for (int i = 0; i < schedule.length; i++)
{
if (schedule[i].isValid() != valid)
{
schedule[i].setIsValid(valid);
schedule[i].save();
schedule[i].saveEx();
}
}
String msg = "@OK@";

View File

@ -78,7 +78,7 @@ public class OrderRePrice extends SvrProcess
for (int i = 0; i < lines.length; i++)
{
lines[i].setPrice(order.getM_PriceList_ID());
lines[i].save();
lines[i].saveEx();
}
order = new MOrder (getCtx(), p_C_Order_ID, get_TrxName());
BigDecimal newPrice = order.getGrandTotal();
@ -92,7 +92,7 @@ public class OrderRePrice extends SvrProcess
for (int i = 0; i < lines.length; i++)
{
lines[i].setPrice(invoice.getM_PriceList_ID(), invoice.getC_BPartner_ID());
lines[i].save();
lines[i].saveEx();
}
invoice = new MInvoice (getCtx(), p_C_Invoice_ID, null);
BigDecimal newPrice = invoice.getGrandTotal();

View File

@ -89,7 +89,7 @@ public class PaySelectionCreateCheck extends SvrProcess
}
//
psel.setProcessed(true);
psel.save();
psel.saveEx();
return "@C_PaySelectionCheck_ID@ - #" + m_list.size();
} // doIt

View File

@ -59,7 +59,7 @@ public class PaymentOnline extends SvrProcess
// Process it
boolean ok = pp.processOnline();
pp.save();
pp.saveEx();
if (!ok)
throw new Exception(pp.getErrorMessage());
return "OK";

View File

@ -55,7 +55,7 @@ public class PaymentTermValidate extends SvrProcess
log.info ("C_PaymentTerm_ID=" + getRecord_ID());
MPaymentTerm pt = new MPaymentTerm (getCtx(), getRecord_ID(), get_TrxName());
String msg = pt.validate();
pt.save();
pt.saveEx();
//
if ("@OK@".equals(msg))
return msg;

View File

@ -182,11 +182,11 @@ public class ProjectGenPO extends SvrProcess
}
orderLine.setTax();
orderLine.save();
orderLine.saveEx();
// update ProjectLine
projectLine.setC_OrderPO_ID(order.getC_Order_ID());
projectLine.save();
projectLine.saveEx();
addLog (projectLine.getLine(), null, projectLine.getPlannedQty(), order.getDocumentNo());
} // createPOfromProjectLine

View File

@ -142,7 +142,7 @@ public class ProjectIssue extends SvrProcess
if (inOut.getC_Project_ID() == 0)
{
inOut.setC_Project_ID(m_project.getC_Project_ID());
inOut.save();
inOut.saveEx();
}
else if (inOut.getC_Project_ID() != m_project.getC_Project_ID())
throw new IllegalArgumentException ("Receipt for other Project ("
@ -192,7 +192,7 @@ public class ProjectIssue extends SvrProcess
if (pl == null)
pl = new MProjectLine(m_project);
pl.setMProjectIssue(pi); // setIssue
pl.save();
pl.saveEx();
addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null);
counter++;
} // all InOutLines
@ -254,7 +254,7 @@ public class ProjectIssue extends SvrProcess
// Find/Create Project Line
MProjectLine pl = new MProjectLine(m_project);
pl.setMProjectIssue(pi); // setIssue
pl.save();
pl.saveEx();
addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null);
counter++;
} // allExpenseLines
@ -292,7 +292,7 @@ public class ProjectIssue extends SvrProcess
// Update Line
pl.setMProjectIssue(pi);
pl.save();
pl.saveEx();
addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null);
return "@Created@ 1";
} // issueProjectLine
@ -323,7 +323,7 @@ public class ProjectIssue extends SvrProcess
// Create Project Line
MProjectLine pl = new MProjectLine(m_project);
pl.setMProjectIssue(pi);
pl.save();
pl.saveEx();
addLog(pi.getLine(), pi.getMovementDate(), pi.getMovementQty(), null);
return "@Created@ 1";
} // issueInventory

View File

@ -78,7 +78,7 @@ public class ProjectLinePricing extends SvrProcess
//
projectLine.setPlannedPrice(pp.getPriceStd());
projectLine.setPlannedMarginAmt(pp.getPriceStd().subtract(pp.getPriceLimit()));
projectLine.save();
projectLine.saveEx();
//
String retValue = Msg.getElement(getCtx(), "PriceList") + pp.getPriceList() + " - "
+ Msg.getElement(getCtx(), "PriceStd") + pp.getPriceStd() + " - "

View File

@ -158,7 +158,7 @@ public class RegisterSystem extends SvrProcess
int Record_ID = Integer.parseInt(sb.substring(index+10));
reg.setRecord_ID(Record_ID);
reg.setIsRegistered(true);
reg.save();
reg.saveEx();
//
info = info.substring(0, index);
}

View File

@ -376,7 +376,7 @@ public class ReplenishReport extends SvrProcess
if (qto == null)
qto = Env.ZERO;
replenish.setQtyToOrder(qto);
replenish.save();
replenish.saveEx();
}
}
}
@ -430,7 +430,7 @@ public class ReplenishReport extends SvrProcess
line.setM_Product_ID(replenish.getM_Product_ID());
line.setQty(replenish.getQtyToOrder());
line.setPrice();
line.save();
line.saveEx();
}
m_info = "#" + noOrders + info;
log.info(m_info);
@ -475,7 +475,7 @@ public class ReplenishReport extends SvrProcess
line.setC_BPartner_ID(replenish.getC_BPartner_ID());
line.setQty(replenish.getQtyToOrder());
line.setPrice();
line.save();
line.saveEx();
}
m_info = "#" + noReqs + info;
log.info(m_info);
@ -554,7 +554,7 @@ public class ReplenishReport extends SvrProcess
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.save();
line.saveEx();
//
target = target.subtract(moveQty);
if (target.signum() == 0)
@ -688,7 +688,7 @@ public class ReplenishReport extends SvrProcess
line.setM_LocatorTo_ID(M_LocatorTo_ID); // to
line.setM_AttributeSetInstanceTo_ID(storage.getM_AttributeSetInstance_ID());
line.setIsInvoiced(false);
line.save();
line.saveEx();
//
target = target.subtract(moveQty);
if (target.signum() == 0)
@ -705,7 +705,7 @@ public class ReplenishReport extends SvrProcess
line.setM_LocatorTo_ID(M_LocatorTo_ID); // to
line.setM_AttributeSetInstanceTo_ID(0);
line.setIsInvoiced(false);
line.save();
line.saveEx();
}
if (replenishs.length == 0)

View File

@ -112,11 +112,11 @@ public class ReplicationLocal extends SvrProcess
double sec = (System.currentTimeMillis() - m_start);
sec /= 1000;
m_replicationRun.setDescription(sec + " s");
m_replicationRun.save();
m_replicationRun.saveEx();
if (m_replicated)
{
m_replication.setDateLastRun (m_replicationStart);
m_replication.save();
m_replication.saveEx();
}
//
exit();
@ -202,7 +202,7 @@ public class ReplicationLocal extends SvrProcess
if (dateRun != null)
m_replicationStart = dateRun;
m_replicationRun = new MReplicationRun (getCtx(), m_replication.getAD_Replication_ID(), m_replicationStart, get_TrxName());
m_replicationRun.save();
m_replicationRun.saveEx();
} // setupRemote
/*************************************************************************/
@ -323,7 +323,7 @@ public class ReplicationLocal extends SvrProcess
targetRS.close();
targetRS = null;
}
rLog.save();
rLog.saveEx();
return !pi.isError();
} // mergeDataTable
@ -496,7 +496,7 @@ public class ReplicationLocal extends SvrProcess
if (pi.isError())
m_replicated = false;
rLog.setIsReplicated(!pi.isError());
rLog.save();
rLog.saveEx();
return !pi.isError();
} // sendUpdatesTable

View File

@ -142,7 +142,7 @@ public class ReplicationRemote extends SvrProcess
m_system.setIDRangeStart(IDRangeStart);
m_system.setIDRangeEnd(IDRangeEnd);
m_system.setReplicationType(MSystem.REPLICATIONTYPE_Merge);
m_system.save();
m_system.saveEx();
} // setupRemoteAD_System
/**

View File

@ -77,7 +77,7 @@ public class ReportColumnSet_Copy extends SvrProcess
for (int i = 0; i < rcs.length; i++)
{
MReportColumn rc = MReportColumn.copy (getCtx(), to.getAD_Client_ID(), to.getAD_Org_ID(), to_ID, rcs[i], get_TrxName());
rc.save();
rc.saveEx();
}
// Oper 1/2 were set to Null !
return "@Copied@=" + rcs.length;

View File

@ -78,14 +78,14 @@ public class ReportLineSet_Copy extends SvrProcess
for (int i = 0; i < rls.length; i++)
{
MReportLine rl = MReportLine.copy (getCtx(), to.getAD_Client_ID(), to.getAD_Org_ID(), to_ID, rls[i], get_TrxName());
rl.save();
rl.saveEx();
MReportSource[] rss = rls[i].getSources();
if (rss != null)
{
for (int ii = 0; ii < rss.length; ii++)
{
MReportSource rs = MReportSource.copy (getCtx(), to.getAD_Client_ID(), to.getAD_Org_ID(), rl.get_ID(), rss[ii], get_TrxName());
rs.save();
rs.saveEx();
}
}
// Oper 1/2 were set to Null !

View File

@ -179,7 +179,7 @@ public class RequestInvoice extends SvrProcess
else
{
m_invoice.processIt(MInvoice.ACTION_Prepare);
m_invoice.save();
m_invoice.saveEx();
addLog(0, null, m_invoice.getGrandTotal(), m_invoice.getDocumentNo());
}
}
@ -198,7 +198,7 @@ public class RequestInvoice extends SvrProcess
MBPartner partner = new MBPartner (getCtx(), request.getC_BPartner_ID(), null);
m_invoice.setBPartner(partner);
m_invoice.save();
m_invoice.saveEx();
m_linecount = 0;
} // invoiceNew
@ -229,9 +229,9 @@ public class RequestInvoice extends SvrProcess
il.setM_Product_ID(M_Product_ID);
//
il.setPrice();
il.save();
il.saveEx();
// updates[i].setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
// updates[i].save();
// updates[i].saveEx();
}
} // invoiceLine

View File

@ -67,14 +67,14 @@ public class RfQClose extends SvrProcess
log.info("doIt - " + rfq);
//
rfq.setProcessed(true);
rfq.save();
rfq.saveEx();
//
int counter = 0;
MRfQResponse[] responses = rfq.getResponses (false, false);
for (int i = 0; i < responses.length; i++)
{
responses[i].setProcessed(true);
responses[i].save();
responses[i].saveEx();
counter++;
}
//

View File

@ -86,7 +86,7 @@ public class RfQCopyLines extends SvrProcess
// newLine.setDateWorkStart();
// newLine.setDateWorkComplete();
newLine.setDeliveryDays(lines[i].getDeliveryDays());
newLine.save();
newLine.saveEx();
// Copy Qtys
MRfQLineQty[] qtys = lines[i].getQtys();
for (int j = 0; j < qtys.length; j++)
@ -97,7 +97,7 @@ public class RfQCopyLines extends SvrProcess
newQty.setIsOfferQty(qtys[j].isOfferQty());
newQty.setIsPurchaseQty(qtys[j].isPurchaseQty());
newQty.setMargin(qtys[j].getMargin());
newQty.save();
newQty.saveEx();
}
counter++;
} // copy all lines

View File

@ -96,7 +96,7 @@ public class RfQCreateSO extends SvrProcess
order.setSalesRep_ID(rfq.getSalesRep_ID());
if (rfq.getDateWorkComplete() != null)
order.setDatePromised(rfq.getDateWorkComplete());
order.save();
order.saveEx();
MRfQLine[] lines = rfq.getLines();
for (int i = 0; i < lines.length; i++)
@ -137,14 +137,14 @@ public class RfQCreateSO extends SvrProcess
}
} // price
ol.setPrice(price);
ol.save();
ol.saveEx();
} // Offer Qty
} // All Qtys
} // All Lines
//
rfq.setC_Order_ID(order.getC_Order_ID());
rfq.save();
rfq.saveEx();
return order.getDocumentNo();
} // doIt
}

View File

@ -62,7 +62,7 @@ public class RfQResponseCComplete extends SvrProcess
if (error != null && error.length() > 0)
throw new Exception (error);
//
response.save();
response.saveEx();
return "OK";
} // doIt

View File

@ -137,7 +137,7 @@ public class RfQResponseRank extends SvrProcess
if (!respQty.isActive() || !respQty.isValidAmt())
{
respQty.setRanking(999);
respQty.save();
respQty.saveEx();
log.fine(" - ignored: " + respQty);
}
} // for all respones line qtys
@ -175,12 +175,12 @@ public class RfQResponseRank extends SvrProcess
}
qty.setRanking(lastRank);
log.fine(" - Rank " + lastRank + ": " + qty);
qty.save();
qty.saveEx();
//
if (rank == 0) // Update RfQ
{
rfqQty.setBestResponseAmt(qty.getNetAmt());
rfqQty.save();
rfqQty.saveEx();
}
rank++;
}
@ -217,13 +217,13 @@ public class RfQResponseRank extends SvrProcess
&& respQty.getRfQLineQty().isPurchaseQty())
{
respLine.setIsSelectedWinner(true);
respLine.save();
respLine.saveEx();
break;
}
}
}
response.setRanking(ranking);
response.save();
response.saveEx();
log.fine("- Response Ranking " + ranking + ": " + response);
if (!rfq.isQuoteSelectedLines()) // no total selected winner if not all lines
{
@ -238,7 +238,7 @@ public class RfQResponseRank extends SvrProcess
if (winner != null)
{
winner.setIsSelectedWinner(true);
winner.save();
winner.saveEx();
log.fine("- Response Winner: " + winner);
}
} // rankLines
@ -271,7 +271,7 @@ public class RfQResponseRank extends SvrProcess
if (response.isSelectedWinner())
response.setIsSelectedWinner(false);
}
response.save();
response.saveEx();
log.fine("rankResponse - " + response);
}
} // rankResponses

View File

@ -286,11 +286,11 @@ public class SendMailText extends SvrProcess
log.warning("NOT VALID - " + email);
to.setIsActive(false);
to.addDescription("Invalid EMail");
to.save();
to.saveEx();
return Boolean.FALSE;
}
boolean OK = EMail.SENT_OK.equals(email.send());
new MUserMail(m_MailText, AD_User_ID, email).save();
new MUserMail(m_MailText, AD_User_ID, email).saveEx();
//
if (OK)
log.fine(to.getEMail());

View File

@ -171,7 +171,7 @@ public class StorageCleanup extends SvrProcess
// Process
mh.processIt(MMovement.ACTION_Complete);
mh.save();
mh.saveEx();
addLog(0, null, new BigDecimal(lines), "@M_Movement_ID@ " + mh.getDocumentNo() + " ("
+ MRefList.get(getCtx(), MMovement.DOCSTATUS_AD_Reference_ID,

View File

@ -72,7 +72,7 @@ public class SynchronizeTerminology extends SvrProcess
elem.setDescription(desc);
elem.setHelp(help);
elem.setPrintName(name);
elem.save();
elem.saveEx();
}
pstmt.close();
rs.close();
@ -98,7 +98,7 @@ public class SynchronizeTerminology extends SvrProcess
elem.setDescription(desc);
elem.setHelp(help);
elem.setPrintName(name);
elem.save();
elem.saveEx();
}
pstmt.close();
rs.close();

View File

@ -41,7 +41,7 @@ public class PromotionValidator implements ModelValidator {
PromotionRule.applyPromotions(order);
order.getLines(true, null);
order.calculateTaxTotal();
order.save();
order.saveEx();
increasePromotionCounter(order);
} catch (Exception e) {
if (e instanceof RuntimeException)

View File

@ -537,7 +537,7 @@ public final class Adempiere
{
SecureEngine.init(className); // test it
system.setEncryptionKey(className);
system.save();
system.saveEx();
}
}
SecureEngine.init(className);

View File

@ -138,7 +138,7 @@ public class AssetDisposed extends SvrProcess
depexp0.setIsDepreciated(true);
depexp0.setA_Period(AssetDisposed.getC_Period_ID());
depexp0.setA_Entry_Type("DIS");
depexp0.save();
depexp0.saveEx();
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp1.setPostingType(rs.getString("PostingType"));
@ -150,7 +150,7 @@ public class AssetDisposed extends SvrProcess
depexp1.setIsDepreciated(false);
depexp1.setA_Period(AssetDisposed.getC_Period_ID());
depexp1.setA_Entry_Type("DIS");
depexp1.save();
depexp1.saveEx();
v_Balance = v_Balance.add(rs.getBigDecimal("A_Asset_Cost").multiply(rs.getBigDecimal("A_Split_Percent")));
@ -165,7 +165,7 @@ public class AssetDisposed extends SvrProcess
depexp2.setIsDepreciated(true);
depexp2.setA_Period(AssetDisposed.getC_Period_ID());
depexp2.setA_Entry_Type("DIS");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setPostingType(rs.getString("PostingType"));
@ -177,7 +177,7 @@ public class AssetDisposed extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(AssetDisposed.getC_Period_ID());
depexp3.setA_Entry_Type("DIS");
depexp3.save();
depexp3.saveEx();
}
sql = "UPDATE A_ASSET "
@ -201,7 +201,7 @@ public class AssetDisposed extends SvrProcess
change.setAssetAccumDepreciationAmt(v_Balance);
change.setIsFullyDepreciated(true);
change.setIsDisposed(true);
change.save();
change.saveEx();
}
catch (Exception e)

View File

@ -195,7 +195,7 @@ public class AssetRevalEntry extends SvrProcess
depexp0.setIsDepreciated(false);
depexp0.setA_Period(AssetReval.getC_Period_ID());
depexp0.setA_Entry_Type("RVL");
depexp0.save();
depexp0.saveEx();
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp1.setPostingType(AssetReval.getPostingType());
@ -207,7 +207,7 @@ public class AssetRevalEntry extends SvrProcess
depexp1.setIsDepreciated(false);
depexp1.setA_Period(AssetReval.getC_Period_ID());
depexp1.setA_Entry_Type("RVL");
depexp1.save();
depexp1.saveEx();
// Create JV for the Reval Accum Depr Amounts
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -220,7 +220,7 @@ public class AssetRevalEntry extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(AssetReval.getC_Period_ID());
depexp2.setA_Entry_Type("RVL");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setPostingType(AssetReval.getPostingType());
@ -232,7 +232,7 @@ public class AssetRevalEntry extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(AssetReval.getC_Period_ID());
depexp3.setA_Entry_Type("RVL");
depexp3.save();
depexp3.saveEx();
// Create JV for the Reval Depreciation Expense Amounts
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -245,7 +245,7 @@ public class AssetRevalEntry extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(AssetReval.getC_Period_ID());
depexp4.setA_Entry_Type("RVL");
depexp4.save();
depexp4.saveEx();
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp5.setPostingType(AssetReval.getPostingType());
@ -257,7 +257,7 @@ public class AssetRevalEntry extends SvrProcess
depexp5.setIsDepreciated(false);
depexp5.setA_Period(AssetReval.getC_Period_ID());
depexp5.setA_Entry_Type("RVL");
depexp5.save();
depexp5.saveEx();
}
catch (Exception e)
@ -330,7 +330,7 @@ public class AssetRevalEntry extends SvrProcess
depexp0.setIsDepreciated(false);
depexp0.setA_Period(AssetReval.getC_Period_ID());
depexp0.setA_Entry_Type("RVL");
depexp0.save();
depexp0.saveEx();
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp1.setPostingType(AssetReval.getPostingType());
@ -342,7 +342,7 @@ public class AssetRevalEntry extends SvrProcess
depexp1.setIsDepreciated(false);
depexp1.setA_Period(AssetReval.getC_Period_ID());
depexp1.setA_Entry_Type("RVL");
depexp1.save();
depexp1.saveEx();
// Create JV for the Reval Accum Depr Amounts
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -355,7 +355,7 @@ public class AssetRevalEntry extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(AssetReval.getC_Period_ID());
depexp2.setA_Entry_Type("RVL");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setPostingType(AssetReval.getPostingType());
@ -367,7 +367,7 @@ public class AssetRevalEntry extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(AssetReval.getC_Period_ID());
depexp3.setA_Entry_Type("RVL");
depexp3.save();
depexp3.saveEx();
// Create JV for the Reval Depreciation Expense Amounts
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -380,7 +380,7 @@ public class AssetRevalEntry extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(AssetReval.getC_Period_ID());
depexp4.setA_Entry_Type("RVL");
depexp4.save();
depexp4.saveEx();
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp5.setPostingType(AssetReval.getPostingType());
@ -392,7 +392,7 @@ public class AssetRevalEntry extends SvrProcess
depexp5.setIsDepreciated(false);
depexp5.setA_Period(AssetReval.getC_Period_ID());
depexp5.setA_Entry_Type("RVL");
depexp5.save();
depexp5.saveEx();
}
}
catch (Exception e)

View File

@ -161,7 +161,7 @@ public class AssetSplit extends SvrProcess
AssetNew.setC_BPartner_Location_ID(Asset.getC_BPartner_Location_ID());
AssetNew.setA_QTY_Current(v_QTY_New);
AssetNew.setA_QTY_Original(v_QTY_New);
AssetNew.save();
AssetNew.saveEx();
v_AssetNumber = AssetNew.getA_Asset_ID();
@ -176,7 +176,7 @@ public class AssetSplit extends SvrProcess
assetadd.setA_QTY_Current(v_QTY_New);
assetadd.setPostingType(AssetSplit.getPostingType());
assetadd.setM_InOutLine_ID(1);
assetadd.save();
assetadd.saveEx();
String sql2 = "SELECT A_Asset_Acct_ID "
@ -212,7 +212,7 @@ public class AssetSplit extends SvrProcess
assetacctnew.setA_Depreciation_Manual_Period(" ");
else
assetacctnew.setA_Depreciation_Manual_Period(assetacct.getA_Depreciation_Manual_Period());
assetacctnew.save();
assetacctnew.saveEx();
sql2 = null;
@ -239,7 +239,7 @@ public class AssetSplit extends SvrProcess
assetwknew.setIsDepreciated(assetwk.isDepreciated());
assetwknew.setA_Asset_Life_Current_Year(assetwk.getA_Asset_Life_Current_Year());
assetwknew.setA_Curr_Dep_Exp(new BigDecimal (0.0));
assetwknew.save();
assetwknew.saveEx();
//Record transaction in Asset History
@ -299,7 +299,7 @@ public class AssetSplit extends SvrProcess
change.setC_BPartner_ID(AssetNew.getC_BPartner_ID());
change.setA_QTY_Current(AssetNew.getA_QTY_Current());
change.setA_QTY_Original(AssetNew.getA_QTY_Original());
change.save();
change.saveEx();
//Record Account Numbers for JE's
@ -315,7 +315,7 @@ public class AssetSplit extends SvrProcess
MAsset AssetNew = new MAsset (getCtx(), v_AssetNumber, null);
AssetNew.setA_QTY_Current(AssetNew.getA_QTY_Current().add(v_QTY_New));
AssetNew.setA_QTY_Original(AssetNew.getA_QTY_Original().add(v_QTY_New));
AssetNew.save();
AssetNew.saveEx();
//Create Asset Addition Record
MAssetAddition assetadd = new MAssetAddition (getCtx(), 0, null);
@ -327,7 +327,7 @@ public class AssetSplit extends SvrProcess
assetadd.setA_QTY_Current(v_QTY_New);
assetadd.setPostingType(AssetSplit.getPostingType());
assetadd.setM_InOutLine_ID(1);
assetadd.save();
assetadd.saveEx();
String sql2 = "SELECT A_Asset_Acct_ID "
@ -342,7 +342,7 @@ public class AssetSplit extends SvrProcess
MAssetAcct assetacctnew = new MAssetAcct (getCtx(), v_NewAssetAcctID, null);
assetacctnew.setA_Salvage_Value(assetacctnew.getA_Salvage_Value().add(v_SalvageValue_New));
assetacctnew.setA_Depreciation_Manual_Amount(assetacctnew.getA_Depreciation_Manual_Amount().add(v_ManDep_New));
assetacctnew.save();
assetacctnew.saveEx();
sql2 = null;
@ -361,7 +361,7 @@ public class AssetSplit extends SvrProcess
assetwknew.setA_Accumulated_Depr(assetwknew.getA_Accumulated_Depr().add(v_AccumBalance_New));
assetwknew.setA_Salvage_Value(assetwknew.getA_Salvage_Value().add(v_SalvageValue_New));
assetwknew.setA_QTY_Current(assetwknew.getA_QTY_Current().add(v_QTY_New));
assetwknew.save();
assetwknew.saveEx();
//Record transaction in Asset History
@ -422,7 +422,7 @@ public class AssetSplit extends SvrProcess
change.setC_BPartner_ID(AssetNew.getC_BPartner_ID());
change.setA_QTY_Current(AssetNew.getA_QTY_Current());
change.setA_QTY_Original(AssetNew.getA_QTY_Original());
change.save();
change.saveEx();
//Record Account Numbers for JE's
@ -434,7 +434,7 @@ public class AssetSplit extends SvrProcess
// Update original Asset
Asset.setA_QTY_Current(v_QTY_Org);
Asset.save();
Asset.saveEx();
// Update original asset for the split
MAssetAddition assetaddold = new MAssetAddition (getCtx(), 0, null);
@ -446,19 +446,19 @@ public class AssetSplit extends SvrProcess
assetaddold.setA_QTY_Current(v_QTY_New.multiply( new BigDecimal(-1)));
assetaddold.setPostingType(AssetSplit.getPostingType());
assetaddold.setM_InOutLine_ID(1);
assetaddold.save();
assetaddold.saveEx();
//Update the Original Asset in the Account File
assetacct.setA_Salvage_Value(v_SalvageValue_Org);
assetacct.setA_Depreciation_Manual_Amount(v_ManDep_Org);
assetacct.save();
assetacct.saveEx();
//Update the Original Asset in the Deprecation Workfile
assetwk.setA_Asset_Cost(v_CostBalance_Org);
assetwk.setA_Accumulated_Depr(v_AccumBalance_Org);
assetwk.setA_Salvage_Value(v_SalvageValue_Org);
assetwk.setA_QTY_Current(v_QTY_Org);
assetwk.save();
assetwk.saveEx();
MAssetChange change1 = new MAssetChange (getCtx(), 0, null);
change1.setChangeType("SPL");
@ -477,7 +477,7 @@ public class AssetSplit extends SvrProcess
change1.setAssetAccumDepreciationAmt(v_AccumBalance_New.multiply(new BigDecimal(-1)));
change1.setA_Salvage_Value(v_SalvageValue_New.multiply(new BigDecimal(-1)));
change1.setA_QTY_Current(v_QTY_New.multiply(new BigDecimal(-1)));
change1.save();
change1.saveEx();
//Create Journal Entries for the split
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -491,7 +491,7 @@ public class AssetSplit extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(AssetSplit.getC_Period_ID());
depexp2.setA_Entry_Type("SPL");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
@ -504,7 +504,7 @@ public class AssetSplit extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(AssetSplit.getC_Period_ID());
depexp3.setA_Entry_Type("SPL");
depexp3.save();
depexp3.saveEx();
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
//Create JV for the Cost of the asset
@ -517,7 +517,7 @@ public class AssetSplit extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(AssetSplit.getC_Period_ID());
depexp4.setA_Entry_Type("SPL");
depexp4.save();
depexp4.saveEx();
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp5.setPostingType(AssetSplit.getPostingType());
@ -529,7 +529,7 @@ public class AssetSplit extends SvrProcess
depexp5.setIsDepreciated(false);
depexp5.setA_Period(AssetSplit.getC_Period_ID());
depexp5.setA_Entry_Type("SPL");
depexp5.save();
depexp5.saveEx();
String sql = null;
@ -567,7 +567,7 @@ public class AssetSplit extends SvrProcess
depexp0.setIsDepreciated(false);
depexp0.setA_Period(AssetSplit.getC_Period_ID());
depexp0.setA_Entry_Type("SPL");
depexp0.save();
depexp0.saveEx();
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp1.setPostingType(AssetSplit.getPostingType());
@ -579,7 +579,7 @@ public class AssetSplit extends SvrProcess
depexp1.setIsDepreciated(false);
depexp1.setA_Period(AssetSplit.getC_Period_ID());
depexp1.setA_Entry_Type("SPL");
depexp1.save();
depexp1.saveEx();
}
rs.close();

View File

@ -123,7 +123,7 @@ public class AssetTransfer extends SvrProcess
depexp0.setIsDepreciated(false);
depexp0.setA_Period(AssetTransfer.getC_Period_ID());
depexp0.setA_Entry_Type("TRN");
depexp0.save();
depexp0.saveEx();
X_A_Depreciation_Exp depexp1 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp1.setPostingType(AssetTransfer.getPostingType());
@ -135,7 +135,7 @@ public class AssetTransfer extends SvrProcess
depexp1.setIsDepreciated(false);
depexp1.setA_Period(AssetTransfer.getC_Period_ID());
depexp1.setA_Entry_Type("TRN");
depexp1.save();
depexp1.saveEx();
}
}
catch (Exception e)
@ -176,7 +176,7 @@ public class AssetTransfer extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(AssetTransfer.getC_Period_ID());
depexp2.setA_Entry_Type("TRN");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setPostingType(AssetTransfer.getPostingType());
@ -188,7 +188,7 @@ public class AssetTransfer extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(AssetTransfer.getC_Period_ID());
depexp3.setA_Entry_Type("TRN");
depexp3.save();
depexp3.saveEx();
X_A_Depreciation_Exp depexp4 = new X_A_Depreciation_Exp (getCtx(), 0, null);
// Create JV for the Cost of the asset
@ -201,7 +201,7 @@ public class AssetTransfer extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(AssetTransfer.getC_Period_ID());
depexp4.setA_Entry_Type("TRN");
depexp4.save();
depexp4.saveEx();
X_A_Depreciation_Exp depexp5 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp5.setPostingType(AssetTransfer.getPostingType());
@ -213,7 +213,7 @@ public class AssetTransfer extends SvrProcess
depexp5.setIsDepreciated(false);
depexp5.setA_Period(AssetTransfer.getC_Period_ID());
depexp5.setA_Entry_Type("TRN");
depexp5.save();
depexp5.saveEx();
// Update Asset Setup for New Accounts
@ -248,12 +248,12 @@ public class AssetTransfer extends SvrProcess
change.setAssetAccumDepreciationAmt(rs.getBigDecimal("A_ACCUMULATED_DEPR"));
change.setAssetBookValueAmt(rs.getBigDecimal("A_Asset_Cost"));
change.setChangeAmt(v_Balance);
change.save();
change.saveEx();
DB.executeUpdate(sql,null);
AssetTransfer.setIsActive(false);
AssetTransfer.save();
AssetTransfer.saveEx();
// Remove Entry from Processing file

View File

@ -184,7 +184,7 @@ public class BuildDepForecastFile extends SvrProcess
depexp.setIsDepreciated(true);
depexp.setDateAcct(assetwk.getAssetDepreciationDate());
depexp.setA_Entry_Type("FOR");
depexp.save();
depexp.saveEx();
}
else
{
@ -200,7 +200,7 @@ public class BuildDepForecastFile extends SvrProcess
cal.setTime(ts);
assetwk.setDateAcct(ts);
assetwk.setA_Period_Forecast(new BigDecimal(assetwk.getA_Period_Posted()));
assetwk.save();
assetwk.saveEx();
//Calculate life to date depreciation
@ -224,7 +224,7 @@ public class BuildDepForecastFile extends SvrProcess
assetwk.setDateAcct(ts);
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj));
assetwk.setA_Period_Forecast(v_current_adj);
assetwk.save();
assetwk.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception .add(v_Dep_Exp_Inception2.multiply(v_HalfYearConv_Adj));
v_current = v_current + 1;
}
@ -288,7 +288,7 @@ public class BuildDepForecastFile extends SvrProcess
depexp1.setA_Period((int)v_current);
depexp1.setIsDepreciated(true);
depexp1.setDateAcct(ts);
depexp1.save();
depexp1.saveEx();
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
//Record adjusted expense
@ -302,7 +302,7 @@ public class BuildDepForecastFile extends SvrProcess
depexp2.setIsDepreciated(true);
depexp2.setDateAcct(ts);
depexp2.setA_Entry_Type("FOR");
depexp2.save();
depexp2.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP))).setScale(2, BigDecimal.ROUND_HALF_UP);
}
else
@ -319,7 +319,7 @@ public class BuildDepForecastFile extends SvrProcess
depexp2.setIsDepreciated(true);
depexp2.setDateAcct(ts);
depexp2.setA_Entry_Type("FOR");
depexp2.save();
depexp2.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add(v_Dep_Exp_Monthly).setScale(2, BigDecimal.ROUND_HALF_UP);
}
lastdepexp2 = depexp2.get_ID();
@ -332,13 +332,13 @@ public class BuildDepForecastFile extends SvrProcess
//record in workfile
assetwk.setA_Period_Forecast(v_current_adj);
assetwk.setDateAcct(ts);
assetwk.save();
assetwk.saveEx();
v_current = v_current + 1;
}
//adjust last entry for rounding errors
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), lastdepexp2, null);
depexp2.setExpense(depexp2.getExpense().add(((rs.getBigDecimal("A_ASSET_COST").subtract(rs.getBigDecimal("A_SALVAGE_VALUE").subtract(v_total_adjustment))).subtract(v_Dep_Exp_Inception)).multiply(new BigDecimal(rs2.getFloat("A_Split_Percent")))));
depexp2.save();
depexp2.saveEx();
asset_id_current = rs2.getInt("A_ASSET_ID");
log.info("Asset #"+asset_id_current);
}

View File

@ -188,7 +188,7 @@ public class BuildDepWorkFile extends SvrProcess
//depexp.setIsDepreciated(true);
//depexp.setDateAcct(assetwk.getAssetDepreciationDate());
//depexp.setA_Entry_Type("DEP");
//depexp.save();
//depexp.saveEx();
}
else
{
@ -205,7 +205,7 @@ public class BuildDepWorkFile extends SvrProcess
cal.setTime(ts);
assetwk.setDateAcct(ts);
assetwk.setA_Period_Forecast(new BigDecimal(assetwk.getA_Period_Posted()));
assetwk.save();
assetwk.saveEx();
//Calculate life to date depreciation
@ -229,7 +229,7 @@ public class BuildDepWorkFile extends SvrProcess
assetwk.setDateAcct(ts);
v_current_adj = v_current_adj.add((v_HalfYearConv_Adj));
assetwk.setA_Period_Forecast(v_current_adj);
assetwk.save();
assetwk.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception .add(v_Dep_Exp_Inception2.multiply(v_HalfYearConv_Adj));
v_current = v_current + 1;
}
@ -266,7 +266,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp1.setA_Period(rs.getInt("C_Period_ID"));
depexp1.setIsDepreciated(true);
depexp1.setDateAcct(rs.getTimestamp("DateAcct"));
depexp1.save();
depexp1.saveEx();
X_A_Depreciation_Exp depexp2 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp2.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
@ -278,7 +278,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
depexp2.setA_Entry_Type("DEP");
depexp2.save();
depexp2.saveEx();
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
}
@ -323,7 +323,7 @@ public class BuildDepWorkFile extends SvrProcess
//depexp1.setA_Period((int)v_current);
//depexp1.setIsDepreciated(true);
//depexp1.setDateAcct(ts);
//depexp1.save();
//depexp1.saveEx();
v_total_adjustment = v_total_adjustment.setScale(5, BigDecimal.ROUND_HALF_UP).subtract(v_Dep_Exp_Adjustment.setScale(5, BigDecimal.ROUND_HALF_UP));
@ -339,7 +339,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp2.setIsDepreciated(true);
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
depexp2.setA_Entry_Type("DEP");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
@ -351,7 +351,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setDateAcct(rs.getTimestamp("DateAcct"));
depexp3.setA_Entry_Type("DEP");
depexp3.save();
depexp3.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add((v_Dep_Exp_Monthly.setScale(2, BigDecimal.ROUND_HALF_UP))).setScale(2, BigDecimal.ROUND_HALF_UP);
}
@ -367,7 +367,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp2.setIsDepreciated(true);
depexp2.setDateAcct(rs.getTimestamp("DateAcct"));
depexp2.setA_Entry_Type("DEP");
depexp2.save();
depexp2.saveEx();
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, null);
depexp3.setA_Asset_ID(rs.getInt("A_ASSET_ID"));
@ -379,7 +379,7 @@ public class BuildDepWorkFile extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setDateAcct(rs.getTimestamp("DateAcct"));
depexp3.setA_Entry_Type("DEP");
depexp3.save();
depexp3.saveEx();
v_Dep_Exp_Inception = v_Dep_Exp_Inception.add(v_Dep_Exp_Monthly).setScale(2, BigDecimal.ROUND_HALF_UP);
@ -397,7 +397,7 @@ public class BuildDepWorkFile extends SvrProcess
assetwk.setA_Period_Forecast(v_current_adj);
assetwk.setDateAcct(ts);
assetwk.setA_Current_Period((int)v_current);
assetwk.save();
assetwk.saveEx();
asset_id_current = rs2.getInt("A_ASSET_ID");
log.info(""+asset_id_current);

View File

@ -124,9 +124,9 @@ public class CreateGLAsset extends SvrProcess
asset.setA_Asset_Group_ID(assetgrpacct.getA_Asset_Group_ID());
asset.setA_QTY_Current(JVLine.getQty());
asset.setA_QTY_Original(JVLine.getQty());
asset.save();
asset.saveEx();
asset.setA_Parent_Asset_ID(asset.getA_Asset_ID());
asset.save();
asset.saveEx();
boolean isdepreciate = assetgrpacct.isProcessing();
@ -146,7 +146,7 @@ public class CreateGLAsset extends SvrProcess
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
// uselifemonths = assetgrpacct.getUseLifeMonths();
// uselifeyears = assetgrpacct.getUseLifeYears();
@ -156,7 +156,7 @@ public class CreateGLAsset extends SvrProcess
asset.setUseLifeMonths(asset.getUseLifeYears()*12);
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
// uselifemonths = asset.getUseLifeYears()*12;
// uselifeyears = asset.getUseLifeYears();
}
@ -185,7 +185,7 @@ public class CreateGLAsset extends SvrProcess
assetacct.setA_Depreciation_Table_Header_ID(assetgrpacct.getA_Depreciation_Table_Header_ID());
assetacct.setA_Depreciation_Variable_Perc(assetgrpacct.getA_Depreciation_Variable_Perc());
assetacct.setProcessing(false);
assetacct.save();
assetacct.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setPostingType(assetacct.getPostingType());
@ -238,7 +238,7 @@ public class CreateGLAsset extends SvrProcess
change.setA_Asset_CreateDate(asset.getA_Asset_CreateDate());
change.setAD_User_ID(asset.getAD_User_ID());
change.setC_Location_ID(asset.getC_Location_ID());
change.save();
change.saveEx();
}
@ -256,7 +256,7 @@ public class CreateGLAsset extends SvrProcess
assetwk.setA_QTY_Current(JVLine.getQty());
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
assetwk.setPostingType(assetgrpacct.getPostingType());
assetwk.save();
assetwk.saveEx();
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
@ -269,7 +269,7 @@ public class CreateGLAsset extends SvrProcess
assetadd.setLine(JVLine.getLine());
assetadd.setDescription(JVLine.getDescription());
assetadd.setPostingType(assetwk.getPostingType());
assetadd.save();
assetadd.saveEx();
}
else
@ -291,7 +291,7 @@ public class CreateGLAsset extends SvrProcess
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(JVLine.getAmtAcctDr().subtract(JVLine.getAmtAcctCr())));
assetwk.setA_QTY_Current(assetwk.getA_QTY_Current().add(JVLine.getQty()));
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
assetwk.save();
assetwk.saveEx();
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
@ -304,12 +304,12 @@ public class CreateGLAsset extends SvrProcess
assetadd.setLine(JVLine.getLine());
assetadd.setDescription(JVLine.getDescription());
assetadd.setPostingType(assetwk.getPostingType());
assetadd.save();
assetadd.saveEx();
asset.setA_QTY_Original(assetadd.getA_QTY_Current().add(asset.getA_QTY_Original()));
asset.setA_QTY_Current(assetadd.getA_QTY_Current().add(asset.getA_QTY_Current()));
asset.save();
asset.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setA_Asset_ID(asset.getA_Asset_ID());
@ -318,7 +318,7 @@ public class CreateGLAsset extends SvrProcess
change.setPostingType(assetwk.getPostingType());
change.setAssetValueAmt(assetadd.getAssetValueAmt());
change.setA_QTY_Current(assetadd.getA_QTY_Current());
change.save();
change.saveEx();
}
}
@ -349,7 +349,7 @@ public class CreateGLAsset extends SvrProcess
assetadd.setLine(JVLine.getLine());
assetadd.setDescription(JVLine.getDescription());
assetadd.setPostingType("A");
assetadd.save();
assetadd.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setA_Asset_ID(asset.getA_Asset_ID());
@ -359,10 +359,10 @@ public class CreateGLAsset extends SvrProcess
assetadd.setPostingType("A");
change.setAssetValueAmt(assetadd.getAssetValueAmt());
change.setA_QTY_Current(assetadd.getA_QTY_Current());
change.save();
change.saveEx();
}
JVLine.set_ValueOfColumn(I_CustomColumn.A_Processed, Boolean.TRUE);
JVLine.save();
JVLine.saveEx();
}
rs.close();
pstmt.close();

View File

@ -144,9 +144,9 @@ public class CreateInvoicedAsset extends SvrProcess
asset.setA_Asset_Group_ID(assetgrpacct.getA_Asset_Group_ID());
asset.setA_QTY_Current(InvoiceLine.getQtyEntered());
asset.setA_QTY_Original(InvoiceLine.getQtyEntered());
asset.save();
asset.saveEx();
asset.setA_Parent_Asset_ID(asset.getA_Asset_ID());
asset.save();
asset.saveEx();
boolean isdepreciate = assetgrpacct.isProcessing();
@ -166,7 +166,7 @@ public class CreateInvoicedAsset extends SvrProcess
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
uselifemonths = assetgrpacct.getUseLifeMonths();
uselifeyears = assetgrpacct.getUseLifeYears();
@ -176,7 +176,7 @@ public class CreateInvoicedAsset extends SvrProcess
asset.setUseLifeMonths(asset.getUseLifeYears()*12);
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
uselifemonths = asset.getUseLifeYears()*12;
uselifeyears = asset.getUseLifeYears();
}
@ -205,7 +205,7 @@ public class CreateInvoicedAsset extends SvrProcess
assetacct.setA_Depreciation_Variable_Perc(assetgrpacct.getA_Depreciation_Variable_Perc());
assetacct.setProcessing(false);
assetacct.getAD_Client_ID();
assetacct.save();
assetacct.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setPostingType(assetacct.getPostingType());
@ -260,7 +260,7 @@ public class CreateInvoicedAsset extends SvrProcess
change.setA_Asset_CreateDate(asset.getA_Asset_CreateDate());
change.setAD_User_ID(asset.getAD_User_ID());
change.setC_Location_ID(asset.getC_Location_ID());
change.save();
change.saveEx();
}
@ -277,7 +277,7 @@ public class CreateInvoicedAsset extends SvrProcess
assetwk.setA_Period_Posted(0);
assetwk.setA_Asset_Life_Current_Year(new BigDecimal (0.0));
assetwk.setA_Curr_Dep_Exp(new BigDecimal (0.0));
assetwk.save();
assetwk.saveEx();
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
@ -291,7 +291,7 @@ public class CreateInvoicedAsset extends SvrProcess
assetadd.setDescription(InvoiceLine.getDescription());
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
assetadd.setPostingType(assetwk.getPostingType());
assetadd.save();
assetadd.saveEx();
String sql1 = "SELECT C_Period_ID "
+ "FROM C_Period "
@ -348,7 +348,7 @@ public class CreateInvoicedAsset extends SvrProcess
mInOut.setPosted (false);
mInOut.setProcessed (false);
mInOut.setSendEMail (false);
mInOut.save();
mInOut.saveEx();
X_M_InOutLine mInOutLine = new X_M_InOutLine (getCtx(), 0, get_TrxName());
mInOutLine.setC_UOM_ID (InvoiceLine.getC_UOM_ID()); // @#C_UOM_ID@
@ -378,7 +378,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(C_Period_ID);
depexp2.setA_Entry_Type("NEW");
depexp2.save();
depexp2.saveEx();
recordInsertedCount++;
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
@ -391,7 +391,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(C_Period_ID);
depexp3.setA_Entry_Type("NEW");
depexp3.save();
depexp3.saveEx();
recordInsertedCount++;
//Determine if tax adjustment is necessary
@ -409,7 +409,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(C_Period_ID);
depexp4.setA_Entry_Type("NEW");
depexp4.save();
depexp4.saveEx();
recordInsertedCount++;
}
@ -432,7 +432,7 @@ public class CreateInvoicedAsset extends SvrProcess
assetwk.setA_Asset_Cost(assetwk.getA_Asset_Cost().add(InvoiceLine.getLineTotalAmt()));
assetwk.setIsDepreciated(assetgrpacct.isProcessing());
assetwk.setA_QTY_Current(InvoiceLine.getQtyEntered());
assetwk.save();
assetwk.saveEx();
X_A_Asset_Addition assetadd = new X_A_Asset_Addition (getCtx(), 0, get_TrxName());
assetadd.setA_Asset_ID(asset.getA_Asset_ID());
@ -446,12 +446,12 @@ public class CreateInvoicedAsset extends SvrProcess
assetadd.setDescription(InvoiceLine.getDescription());
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
assetadd.setPostingType(assetwk.getPostingType());
assetadd.save();
assetadd.saveEx();
asset.setA_QTY_Original(assetadd.getA_QTY_Current().add(asset.getA_QTY_Original()));
asset.setA_QTY_Current(assetadd.getA_QTY_Current().add(asset.getA_QTY_Current()));
asset.save();
asset.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setA_Asset_ID(asset.getA_Asset_ID());
@ -461,7 +461,7 @@ public class CreateInvoicedAsset extends SvrProcess
change.setPostingType(assetwk.getPostingType());
change.setAssetValueAmt(assetadd.getAssetValueAmt());
change.setA_QTY_Current(assetadd.getA_QTY_Current());
change.save();
change.saveEx();
@ -480,7 +480,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp2.setIsDepreciated(false);
depexp2.setA_Period(C_Period_ID);
depexp2.setA_Entry_Type("NEW");
depexp2.save();
depexp2.saveEx();
recordInsertedCount++;
X_A_Depreciation_Exp depexp3 = new X_A_Depreciation_Exp (getCtx(), 0, get_TrxName());
@ -493,7 +493,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp3.setIsDepreciated(false);
depexp3.setA_Period(C_Period_ID);
depexp3.setA_Entry_Type("NEW");
depexp3.save();
depexp3.saveEx();
recordInsertedCount++;
//Determine if tax adjustment is necessary
@ -511,7 +511,7 @@ public class CreateInvoicedAsset extends SvrProcess
depexp4.setIsDepreciated(false);
depexp4.setA_Period(C_Period_ID);
depexp4.setA_Entry_Type("NEW");
depexp4.save();
depexp4.saveEx();
recordInsertedCount++;
}
@ -547,7 +547,7 @@ public class CreateInvoicedAsset extends SvrProcess
assetadd.setDescription(InvoiceLine.getDescription());
assetadd.setA_QTY_Current(InvoiceLine.getQtyEntered());
assetadd.setPostingType("A");
assetadd.save();
assetadd.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
change.setA_Asset_ID(asset.getA_Asset_ID());
@ -557,10 +557,10 @@ public class CreateInvoicedAsset extends SvrProcess
assetadd.setPostingType("A");
change.setAssetValueAmt(assetadd.getAssetValueAmt());
change.setA_QTY_Current(assetadd.getA_QTY_Current());
change.save();
change.saveEx();
}
InvoiceLine.set_ValueOfColumn(I_CustomColumn.A_Processed, Boolean.TRUE);
InvoiceLine.save();
InvoiceLine.saveEx();
}
}

View File

@ -219,7 +219,7 @@ public class ImportFAJournal2 extends SvrProcess
FAInsert.setIsDepreciated ( rs.getString("ISDEPRECIATED"));
v_ID_START = v_ID_START+10;
FAInsert.save();
FAInsert.saveEx();
String sql4 = "UPDATE A_DEPRECIATION_EXP SET PROCESSED = 'Y' "
+ " WHERE A_DEPRECIATION_EXP_ID = " + rs.getInt("A_DEPRECIATION_EXP_ID");
@ -818,12 +818,12 @@ public class ImportFAJournal2 extends SvrProcess
imp.getUser1_ID(), imp.getUser2_ID(),imp.getUserElement1_ID(),imp.getUserElement2_ID());
//imp.getUser1_ID(), imp.getUser2_ID());
if (acct != null && acct.get_ID() == 0)
acct.save();
acct.saveEx();
if (acct == null || acct.get_ID() == 0)
{
imp.setI_ErrorMsg("ERROR creating Account");
imp.setI_IsImported(false);
imp.save();
imp.saveEx();
continue;
}
else

View File

@ -570,7 +570,7 @@ public abstract class Doc
.append(", Balanced=").append(isBalanced())
.append(", Schema=").append(m_as.getName());
note.setTextMsg(Text.toString());
note.save();
note.saveEx();
p_Error = Text.toString();
}

View File

@ -968,7 +968,7 @@ public final class FactLine extends X_Fact_Acct
C_Project_ID, C_Campaign_ID, C_Activity_ID,
User1_ID, User2_ID, UserElement1_ID, UserElement2_ID);
if (revenue != null && revenue.get_ID() == 0)
revenue.save();
revenue.saveEx();
if (revenue == null || revenue.get_ID() == 0)
{
log.severe ("Revenue_Acct not found");

View File

@ -136,7 +136,7 @@ public class WebProjectDeploy extends SvrProcess
//if (nodeCMS.getParent_ID()!=0)
nodeCMC.setParent_ID(nodeCMS.getParent_ID());
nodeCMC.setSeqNo(nodeCMS.getSeqNo());
nodeCMC.save();
nodeCMC.saveEx();
break;
}
}

View File

@ -19,6 +19,8 @@ package org.compiere.model;
import java.sql.Timestamp;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
/**
* Processor Interface
*
@ -101,6 +103,12 @@ public interface AdempiereProcessor
*/
public boolean save();
/**
* Save throwing exception
* @throws AdempiereException
* @see #save()
*/
public void saveEx() throws AdempiereException;
/**
* Get Processor Logs

View File

@ -2246,7 +2246,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (access == null)
access = new MPrivateAccess (ctx, AD_User_ID, m_vo.AD_Table_ID, Record_ID);
access.setIsActive(lock);
access.save();
access.saveEx();
//
loadLocks();
} // lock

View File

@ -479,7 +479,7 @@ public class MAcctSchema extends X_C_AcctSchema
MCostType ct = new MCostType (getCtx(), 0, get_TrxName());
ct.setClientOrg(getAD_Client_ID(), 0);
ct.setName(getName());
ct.save();
ct.saveEx();
setM_CostType_ID(ct.getM_CostType_ID());
}

View File

@ -752,7 +752,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
{
MAllocationLine line = m_lines[i];
line.setIsActive(false);
line.save();
line.saveEx();
bps.add(new Integer(line.processIt(true))); // reverse
}
updateBP(bps);

View File

@ -268,13 +268,13 @@ public class MAllocationLine extends X_C_AllocationLine
if (!payment.isCashTrx())
{
payment.setIsAllocated(false);
payment.save();
payment.saveEx();
}
}
else
{
if (payment.testAllocation())
payment.save();
payment.saveEx();
}
}

View File

@ -431,7 +431,7 @@ public class MAsset extends X_A_Asset
if (getA_Parent_Asset_ID() < 1 )
{
asset.setA_Parent_Asset_ID(getA_Asset_ID());
asset.save();
asset.saveEx();
}
@ -457,7 +457,7 @@ public class MAsset extends X_A_Asset
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
uselifemonths = assetgrpacct.getUseLifeMonths();
uselifeyears = assetgrpacct.getUseLifeYears();
@ -467,7 +467,7 @@ public class MAsset extends X_A_Asset
asset.setUseLifeMonths(getUseLifeYears()*12);
asset.setIsDepreciated(true);
asset.setIsOwned(true);
asset.save();
asset.saveEx();
uselifemonths = getUseLifeYears()*12;
uselifeyears = getUseLifeYears();
}
@ -497,7 +497,7 @@ public class MAsset extends X_A_Asset
assetacct.setA_Depreciation_Table_Header_ID(assetgrpacct.getA_Depreciation_Table_Header_ID());
assetacct.setA_Depreciation_Variable_Perc(assetgrpacct.getA_Depreciation_Variable_Perc());
assetacct.setProcessing(false);
assetacct.save();
assetacct.saveEx();
change.setPostingType(assetacct.getPostingType());
change.setA_Split_Percent(assetacct.getA_Split_Percent());
@ -550,7 +550,7 @@ public class MAsset extends X_A_Asset
assetwk.setA_QTY_Current(new BigDecimal(0.0));
assetwk.setA_Asset_Cost(new BigDecimal(0.0));
assetwk.setA_Period_Posted(0);
assetwk.save();
assetwk.saveEx();
}
}
}
@ -578,7 +578,7 @@ public class MAsset extends X_A_Asset
change.setA_Asset_CreateDate(getA_Asset_CreateDate());
change.setAD_User_ID(getAD_User_ID());
change.setC_Location_ID(getC_Location_ID());
change.save();
change.saveEx();
rs.close();
pstmt.close();
@ -631,7 +631,7 @@ public class MAsset extends X_A_Asset
uselifemonths = getUseLifeMonths();
uselifeyears = getUseLifeYears();
}
assetacct.save();
assetacct.saveEx();
}
rs.close();
pstmt.close();
@ -669,7 +669,7 @@ public class MAsset extends X_A_Asset
assetwk.setA_Asset_Life_Years(uselifeyears);
assetwk.setIsDepreciated(isDepreciated());
//assetwk.setA_QTY_Current(getA_QTY_Current());
assetwk.save();
assetwk.saveEx();
if (isProcessing()== true){
MAssetChange change = new MAssetChange (getCtx(), 0, get_TrxName());
@ -698,13 +698,13 @@ public class MAsset extends X_A_Asset
change.setA_Asset_CreateDate(getA_Asset_CreateDate());
change.setAD_User_ID(getAD_User_ID());
change.setC_Location_ID(getC_Location_ID());
change.save();
change.saveEx();
}
else
{
X_A_Asset asset = new X_A_Asset (getCtx(), p_A_Asset_ID, get_TrxName());
asset.setProcessing(true);
asset.save();
asset.saveEx();
}
}
rs.close();

View File

@ -99,7 +99,7 @@ public class MAssetAcct extends X_A_Asset_Acct {
change.setA_Depreciation_Manual_Period(getA_Depreciation_Manual_Period());
change.setA_Depreciation_Table_Header_ID(getA_Depreciation_Table_Header_ID());
change.setA_Depreciation_Variable_Perc(getA_Depreciation_Variable_Perc());
change.save();
change.saveEx();
String sql = "SELECT * FROM A_Depreciation_Workfile WHERE A_Asset_ID=? AND IsActive='Y'";
PreparedStatement pstmt = null;
@ -114,7 +114,7 @@ public class MAssetAcct extends X_A_Asset_Acct {
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile(
getCtx(), rs, null);
assetwk.setA_Salvage_Value(getA_Salvage_Value());
assetwk.save();
assetwk.saveEx();
}
rs.close();
pstmt.close();
@ -159,7 +159,7 @@ public class MAssetAcct extends X_A_Asset_Acct {
assetacct.setA_Depreciation_Table_Header_ID(getA_Depreciation_Table_Header_ID());
assetacct.setA_Depreciation_Variable_Perc(getA_Depreciation_Variable_Perc());
assetacct.setProcessing(true);
assetacct.save();
assetacct.saveEx();
}
return true;

View File

@ -76,12 +76,12 @@ public class MAssetAddition extends X_A_Asset_Addition
assetwk.setPostingType("A");
assetwk.setA_QTY_Current(getA_QTY_Current());
assetwk.setA_Asset_Cost(getAssetValueAmt());
assetwk.save();
assetwk.saveEx();
MAsset asset = new MAsset (getCtx(), p_A_Asset_ID, null);
asset.setA_QTY_Original(getA_QTY_Current().add(asset.getA_QTY_Original()));
asset.setA_QTY_Current(getA_QTY_Current().add(asset.getA_QTY_Current()));
asset.save();
asset.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0,null);
change.setA_Asset_ID(p_A_Asset_ID);
@ -91,7 +91,7 @@ public class MAssetAddition extends X_A_Asset_Addition
change.setPostingType("A");
change.setAssetValueAmt(getAssetValueAmt());
change.setA_QTY_Current(getA_QTY_Current());
change.save();
change.saveEx();
}
@ -110,7 +110,7 @@ public class MAssetAddition extends X_A_Asset_Addition
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), rs, null);
assetwk.setA_Asset_Cost(getAssetValueAmt().add(assetwk.getA_Asset_Cost()));
assetwk.setA_QTY_Current(getA_QTY_Current().add(assetwk.getA_QTY_Current()));
assetwk.save();
assetwk.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0, null);
change.setA_Asset_ID(p_A_Asset_ID);
@ -120,13 +120,13 @@ public class MAssetAddition extends X_A_Asset_Addition
change.setPostingType(rs.getString("PostingType"));
change.setAssetValueAmt(getAssetValueAmt());
change.setA_QTY_Current(getA_QTY_Current());
change.save();
change.saveEx();
MAsset asset = new MAsset (getCtx(), p_A_Asset_ID, null);
asset.setA_QTY_Original(getA_QTY_Current().add(asset.getA_QTY_Original()));
asset.setA_QTY_Current(getA_QTY_Current().add(asset.getA_QTY_Current()));
asset.setProcessing(false);
asset.save();
asset.saveEx();
}
rs.close();
pstmt.close();

View File

@ -70,7 +70,7 @@ protected boolean afterSave (boolean newRecord,boolean success)
MAsset asset = new MAsset (getCtx(), p_A_Asset_ID, null);
asset.setUseUnits(total_unitsused);
asset.setProcessing(false);
asset.save();
asset.saveEx();
MAssetChange change = new MAssetChange (getCtx(), 0,null);
@ -79,7 +79,7 @@ protected boolean afterSave (boolean newRecord,boolean success)
change.setChangeType("USE");
change.setTextDetails(MRefList.getListDescription (getCtx(),"A_Update_Type" , "USE"));
change.setUseUnits(getUseUnits());
change.save();
change.saveEx();
return true;

View File

@ -885,7 +885,7 @@ public class MAttachment extends X_AD_Attachment
MAttachment att = new MAttachment(Env.getCtx(), 100, 0, null);
att.addEntry(new File ("C:\\Adempiere\\Dev.properties"));
att.addEntry(new File ("C:\\Adempiere\\index.html"));
att.save();
att.saveEx();
System.out.println (att);
att.dumpEntryNames();
int AD_Attachment_ID = att.getAD_Attachment_ID();

View File

@ -182,7 +182,7 @@ public class MAttribute extends X_M_Attribute
instance.setValue (null);
}
}
instance.save();
instance.saveEx();
} // setAttributeInstance
/**
@ -198,7 +198,7 @@ public class MAttribute extends X_M_Attribute
M_AttributeSetInstance_ID, value, get_TrxName());
else
instance.setValue(value);
instance.save();
instance.saveEx();
} // setAttributeInstance
/**
@ -214,7 +214,7 @@ public class MAttribute extends X_M_Attribute
M_AttributeSetInstance_ID, value, get_TrxName());
else
instance.setValueNumber(value);
instance.save();
instance.saveEx();
} // setAttributeInstance

View File

@ -311,7 +311,7 @@ public class MCStage extends X_CM_CStage
newCStageTTable.setName(thisTemplateTable.getName());
newCStageTTable.setOtherClause(thisTemplateTable.getOtherClause());
newCStageTTable.setWhereClause(thisTemplateTable.getWhereClause());
newCStageTTable.save();
newCStageTTable.saveEx();
}
}
}

View File

@ -266,7 +266,7 @@ public class MClick extends X_W_Click
click.setW_ClickCount_ID();
if (click.getW_ClickCount_ID() != 0)
{
click.save();
click.saveEx();
counter++;
}
}

View File

@ -713,7 +713,7 @@ public class MClient extends X_AD_Client
um.setMessageID(email.getSentMsg());
um.setIsDelivered(X_AD_UserMail.ISDELIVERED_No);
}
um.save();
um.saveEx();
//
if (email.isSentOK())

View File

@ -163,7 +163,7 @@ public class MCommissionAmt extends X_C_CommissionAmt
{
MCommissionRun run = new MCommissionRun(getCtx(), getC_CommissionRun_ID(),get_TrxName());
run.updateFromAmt();
run.save();
run.saveEx();
} // updateRunHeader
} // MCommissionAmt

View File

@ -139,7 +139,7 @@ public class MCommissionDetail extends X_C_CommissionDetail
{
MCommissionAmt amt = new MCommissionAmt(getCtx(), getC_CommissionAmt_ID(), get_TrxName());
amt.calculateCommission();
amt.save();
amt.saveEx();
} // updateAmtHeader
} // MCommissionDetail

View File

@ -222,7 +222,7 @@ public class MContactInterest extends X_R_ContactInterest
int AD_User_ID = 1000002;
MContactInterest ci = MContactInterest.get(Env.getCtx(), R_InterestArea_ID, AD_User_ID, false, null);
ci.subscribe();
ci.save();
ci.saveEx();
//
ci = MContactInterest.get(Env.getCtx(), R_InterestArea_ID, AD_User_ID, false, null);
} // main

View File

@ -918,7 +918,7 @@ public class MCostDetail extends X_M_CostDetail
MCostQueue cq = MCostQueue.get(product, getM_AttributeSetInstance_ID(),
as, Org_ID, ce.getM_CostElement_ID(), get_TrxName());
cq.setCosts(amt, qty, precision);
cq.save();
cq.saveEx();
// Get Costs - costing level Org/ASI
MCostQueue[] cQueue = MCostQueue.getQueue(product, M_ASI_ID,
as, Org_ID, ce, get_TrxName());
@ -1051,7 +1051,7 @@ public class MCostDetail extends X_M_CostDetail
MCostQueue cq = MCostQueue.get(product, getM_AttributeSetInstance_ID(),
as, Org_ID, ce.getM_CostElement_ID(), get_TrxName());
cq.setCosts(amt, qty, precision);
cq.save();
cq.saveEx();
}
else
{

View File

@ -371,7 +371,7 @@ public final class MCountry extends X_C_Country
mc.setCountryCode(cc);
mc.setName(name);
mc.setDescription(name);
mc.save();
mc.saveEx();
}
**/
} // main

View File

@ -201,7 +201,7 @@ public class MCurrency extends X_C_Currency
int prec = Integer.parseInt(s_table[i][I_Precision]);
MCurrency cur = new MCurrency(Env.getCtx(), s_table[i][I_Currency],
s_table[i][I_Name], s_table[i][I_Symbol], prec, prec+2);
cur.save();
cur.saveEx();
System.out.println(cur);
**
String ISO = s_table[i][I_Currency];

View File

@ -91,7 +91,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
X_A_Asset asset = new X_A_Asset (getCtx(), p_A_Asset_ID, null);
asset.setA_QTY_Current(getA_QTY_Current());
asset.setA_QTY_Original(getA_QTY_Current());
asset.save();
asset.saveEx();
if (getA_Accumulated_Depr().equals(null))
setA_Accumulated_Depr(new BigDecimal(0.0));
@ -113,7 +113,7 @@ public class MDepreciationWorkfile extends X_A_Depreciation_Workfile
change.setA_QTY_Current(getA_QTY_Current());
change.setA_QTY_Original(getA_QTY_Current());
change.setAssetAccumDepreciationAmt(getA_Accumulated_Depr());
change.save();
change.saveEx();
}
return true;
} // beforeSave

View File

@ -272,7 +272,7 @@ public class MDistributionLine extends X_GL_DistributionLine
{
getParent();
m_parent.validate();
m_parent.save();
m_parent.saveEx();
return success;
} // afterSave

View File

@ -131,7 +131,7 @@ public class MFactAcct extends X_Fact_Acct
getC_Project_ID(), getC_Campaign_ID(), getC_Activity_ID(),
getUser1_ID(), getUser2_ID(), getUserElement1_ID(), getUserElement2_ID());
if (acct != null && acct.get_ID() == 0)
acct.save();
acct.saveEx();
return acct;
} // getMAccount

View File

@ -70,7 +70,7 @@ public class MForm extends X_AD_Form
{
int AD_Role_ID = Env.getAD_Role_ID(getCtx());
MFormAccess pa = new MFormAccess(this, AD_Role_ID);
pa.save();
pa.saveEx();
}
return success;
} // afterSave

View File

@ -1507,7 +1507,7 @@ public class MInOut extends X_M_InOut implements DocAction
if (sLine.getM_AttributeSetInstance_ID() != iLine.getM_AttributeSetInstance_ID())
{
iLine.setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID());
iLine.save(); // update matched invoice with ASI
iLine.saveEx(); // update matched invoice with ASI
inv.setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID());
}
boolean isNewMatchInv = false;
@ -1677,7 +1677,7 @@ public class MInOut extends X_M_InOut implements DocAction
MOrderLine ol = new MOrderLine(getCtx(), dropLine.getC_OrderLine_ID(), null);
if ( ol.getC_OrderLine_ID() != 0 ) {
dropLine.setC_OrderLine_ID(ol.getLink_OrderLine_ID());
dropLine.save();
dropLine.saveEx();
}
}
@ -1685,7 +1685,7 @@ public class MInOut extends X_M_InOut implements DocAction
dropShipment.setDocAction(DocAction.ACTION_Complete);
dropShipment.processIt(DocAction.ACTION_Complete);
dropShipment.save();
dropShipment.saveEx();
return dropShipment;
}
@ -2077,7 +2077,7 @@ public class MInOut extends X_M_InOut implements DocAction
{
asset.setIsActive(false);
asset.addDescription("(" + reversal.getDocumentNo() + " #" + rLine.getLine() + "<-)");
asset.save();
asset.saveEx();
}
}
reversal.setC_Order_ID(getC_Order_ID());

View File

@ -191,7 +191,7 @@ public class MIndex extends X_K_Index
thisIndex.setKeyword(name);
thisIndex.setRecord_ID(recordID);
thisIndex.setSourceUpdated(sourceUpdated);
thisIndex.save();
thisIndex.saveEx();
}
return true;
} else {

View File

@ -2229,15 +2229,15 @@ public class MInvoice extends X_C_Invoice implements DocAction
MAllocationLine aLine = new MAllocationLine (alloc, gt,
Env.ZERO, Env.ZERO, Env.ZERO);
aLine.setC_Invoice_ID(getC_Invoice_ID());
aLine.save();
aLine.saveEx();
// Reversal Line
MAllocationLine rLine = new MAllocationLine (alloc, gt.negate(),
Env.ZERO, Env.ZERO, Env.ZERO);
rLine.setC_Invoice_ID(reversal.getC_Invoice_ID());
rLine.save();
rLine.saveEx();
// Process It
if (alloc.processIt(DocAction.ACTION_Complete))
alloc.save();
alloc.saveEx();
}
// After reverseCorrect

View File

@ -1190,7 +1190,7 @@ public class MInvoiceLine extends X_C_InvoiceLine
if (difference.signum() != 0)
{
largestAmtAllocation.setAmt(largestAmtAllocation.getAmt().add(difference));
largestAmtAllocation.save();
largestAmtAllocation.saveEx();
log.config("Difference=" + difference
+ ", C_LandedCostAllocation_ID=" + largestAmtAllocation.getC_LandedCostAllocation_ID()
+ ", Amt" + largestAmtAllocation.getAmt());

Some files were not shown because too many files have changed in this diff Show More