diff --git a/base/src/org/compiere/acct/Doc.java b/base/src/org/compiere/acct/Doc.java index 936da54dd7..b69747e099 100644 --- a/base/src/org/compiere/acct/Doc.java +++ b/base/src/org/compiere/acct/Doc.java @@ -31,7 +31,6 @@ import java.util.logging.Level; import org.adempiere.exceptions.DBException; import org.compiere.model.MAccount; import org.compiere.model.MAcctSchema; -import org.compiere.model.MClient; import org.compiere.model.MConversionRate; import org.compiere.model.MDocType; import org.compiere.model.MNote; @@ -358,6 +357,9 @@ public abstract class Doc /** Log per Document */ protected CLogger log = CLogger.getCLogger(getClass()); + /* If the transaction must be managed locally (false if it's managed externally by the caller) */ + private boolean m_manageLocalTrx; + /************************************************************************** * Constructor @@ -396,8 +398,11 @@ public abstract class Doc // Document Type setDocumentType (defaultDocumentType); m_trxName = trxName; - if (m_trxName == null) + m_manageLocalTrx = false; + if (m_trxName == null) { m_trxName = "Post" + m_DocumentType + p_po.get_ID(); + m_manageLocalTrx = true; + } p_po.set_TrxName(m_trxName); // Amounts @@ -551,7 +556,7 @@ public abstract class Doc // Lock Record ---- String trxName = null; // outside trx if on server - if (MClient.isClientAccounting()) + if (! m_manageLocalTrx) trxName = getTrxName(); // on trx if it's in client StringBuffer sql = new StringBuffer ("UPDATE "); sql.append(get_TableName()).append( " SET Processing='Y' WHERE ") @@ -830,8 +835,10 @@ public abstract class Doc else { log.log(Level.SEVERE, "(fact not saved) ... rolling back"); - trx.rollback(); - trx.close(); + if (m_manageLocalTrx) { + trx.rollback(); + trx.close(); + } unlock(); return STATUS_Error; } @@ -841,30 +848,36 @@ public abstract class Doc if (!save(getTrxName())) // contains unlock & document status update { log.log(Level.SEVERE, "(doc not saved) ... rolling back"); - trx.rollback(); - trx.close(); + if (m_manageLocalTrx) { + trx.rollback(); + trx.close(); + } unlock(); return STATUS_Error; } // Success - trx.commit(true); - trx.close(); - trx = null; + if (m_manageLocalTrx) { + trx.commit(true); + trx.close(); + trx = null; + } // *** Transaction End *** } catch (Exception e) { log.log(Level.SEVERE, "... rolling back", e); status = STATUS_Error; - try { - if (trx != null) - trx.rollback(); - } catch (Exception e2) {} - try { - if (trx != null) - trx.close(); - trx = null; - } catch (Exception e3) {} + if (m_manageLocalTrx) { + try { + if (trx != null) + trx.rollback(); + } catch (Exception e2) {} + try { + if (trx != null) + trx.close(); + trx = null; + } catch (Exception e3) {} + } unlock(); } p_Status = status; @@ -886,7 +899,7 @@ public abstract class Doc private void unlock() { String trxName = null; // outside trx if on server - if (MClient.isClientAccounting()) + if (! m_manageLocalTrx) trxName = getTrxName(); // on trx if it's in client StringBuffer sql = new StringBuffer ("UPDATE "); sql.append(get_TableName()).append( " SET Processing='N' WHERE ") diff --git a/base/src/org/compiere/model/MFactAcct.java b/base/src/org/compiere/model/MFactAcct.java index d295557550..0dfed656cb 100644 --- a/base/src/org/compiere/model/MFactAcct.java +++ b/base/src/org/compiere/model/MFactAcct.java @@ -39,7 +39,7 @@ public class MFactAcct extends X_Fact_Acct /** * */ - private static final long serialVersionUID = 756203818233903671L; + private static final long serialVersionUID = 5251847162314796574L; /** * Delete Accounting @@ -135,19 +135,4 @@ public class MFactAcct extends X_Fact_Acct return acct; } // getMAccount - /** - * Check if a document is already posted - * @param AD_Table_ID table - * @param Record_ID record - * @param trxName transaction - * @return boolean indicating if the document has already accounting facts - * @throws DBException on database exception - */ - public static boolean alreadyPosted(int AD_Table_ID, int Record_ID, String trxName) throws DBException - { - final String sql = "SELECT 1 FROM Fact_Acct WHERE AD_Table_ID=? AND Record_ID=?"; - int one = DB.getSQLValue(trxName, sql, new Object[]{AD_Table_ID, Record_ID}); - return (one == 1); - } - } // MFactAcct diff --git a/base/src/org/compiere/model/MInOut.java b/base/src/org/compiere/model/MInOut.java index b0c8730d33..14f2f2ed1b 100644 --- a/base/src/org/compiere/model/MInOut.java +++ b/base/src/org/compiere/model/MInOut.java @@ -1486,6 +1486,9 @@ public class MInOut extends X_M_InOut implements DocAction m_processMsg = CLogger.retrieveErrorString("Could not create Inv Matching"); return DocAction.STATUS_Invalid; } + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(inv.getCtx(), inv.getAD_Client_ID(), inv.get_Table_ID(), inv.get_ID(), true, inv.get_TrxName()); + } } } @@ -1500,6 +1503,9 @@ public class MInOut extends X_M_InOut implements DocAction m_processMsg = "Could not create PO Matching"; return DocAction.STATUS_Invalid; } + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(po.getCtx(), po.getAD_Client_ID(), po.get_Table_ID(), po.get_ID(), true, po.get_TrxName()); + } // Update PO with ASI if ( oLine != null && oLine.getM_AttributeSetInstance_ID() == 0 && sLine.getMovementQty().compareTo(oLine.getQtyOrdered()) == 0) // just if full match [ 1876965 ] @@ -1523,6 +1529,9 @@ public class MInOut extends X_M_InOut implements DocAction m_processMsg = "Could not create PO(Inv) Matching"; return DocAction.STATUS_Invalid; } + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(po.getCtx(), po.getAD_Client_ID(), po.get_Table_ID(), po.get_ID(), true, po.get_TrxName()); + } // Update PO with ASI oLine = new MOrderLine (getCtx(), po.getC_OrderLine_ID(), get_TrxName()); if ( oLine != null && oLine.getM_AttributeSetInstance_ID() == 0 diff --git a/base/src/org/compiere/model/MInvoice.java b/base/src/org/compiere/model/MInvoice.java index 2814883cde..ba04c2c418 100644 --- a/base/src/org/compiere/model/MInvoice.java +++ b/base/src/org/compiere/model/MInvoice.java @@ -1681,8 +1681,12 @@ public class MInvoice extends X_C_Invoice implements DocAction m_processMsg = "Could not create PO Matching"; return DocAction.STATUS_Invalid; } - else + else { matchPO++; + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(po.getCtx(), po.getAD_Client_ID(), po.get_Table_ID(), po.get_ID(), true, po.get_TrxName()); + } + } } } @@ -1720,8 +1724,12 @@ public class MInvoice extends X_C_Invoice implements DocAction m_processMsg = CLogger.retrieveErrorString("Could not create Invoice Matching"); return DocAction.STATUS_Invalid; } - else + else { matchInv++; + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(inv.getCtx(), inv.getAD_Client_ID(), inv.get_Table_ID(), inv.get_ID(), true, inv.get_TrxName()); + } + } } } // for all lines if (matchInv > 0) diff --git a/base/src/org/compiere/model/MJournalBatch.java b/base/src/org/compiere/model/MJournalBatch.java index e4cbc56ce3..05b42770a9 100644 --- a/base/src/org/compiere/model/MJournalBatch.java +++ b/base/src/org/compiere/model/MJournalBatch.java @@ -474,16 +474,13 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction ; else { - String status = journal.completeIt(); - if (!DocAction.STATUS_Completed.equals(status)) + journal.processIt(DocAction.ACTION_Complete); + journal.saveEx(); + if (!DocAction.STATUS_Completed.equals(journal.getDocStatus())) { - journal.setDocStatus(status); - journal.save(); m_processMsg = journal.getProcessMsg(); - return status; + return journal.getDocStatus(); } - journal.setDocStatus(DOCSTATUS_Completed); - journal.save(); } // TotalDr = TotalDr.add(journal.getTotalDr()); diff --git a/base/src/org/compiere/model/MMatchInv.java b/base/src/org/compiere/model/MMatchInv.java index ef1867605c..fec69d6f2b 100644 --- a/base/src/org/compiere/model/MMatchInv.java +++ b/base/src/org/compiere/model/MMatchInv.java @@ -429,7 +429,11 @@ public class MMatchInv extends X_M_MatchInv if (receipt.getMovementType().equals(MInOut.MOVEMENTTYPE_VendorReturns)) qty = getQty().negate(); // - BigDecimal price = cd.getAmt().divide(cd.getQty(),12,BigDecimal.ROUND_HALF_UP); + BigDecimal price = null; + if (cd.getQty().compareTo(Env.ZERO) == 0) // avoid division by zero + price = Env.ZERO; + else + price = cd.getAmt().divide(cd.getQty(),12,BigDecimal.ROUND_HALF_UP); cd.setDeltaAmt(price.multiply(qty.negate())); cd.setDeltaQty(qty.negate()); cd.setProcessed(false); diff --git a/base/src/org/compiere/model/MMatchPO.java b/base/src/org/compiere/model/MMatchPO.java index b3ea1c4257..f1deeacda7 100644 --- a/base/src/org/compiere/model/MMatchPO.java +++ b/base/src/org/compiere/model/MMatchPO.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Properties; import java.util.logging.Level; -import org.compiere.report.MReportTree; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; diff --git a/base/src/org/compiere/model/MOrder.java b/base/src/org/compiere/model/MOrder.java index 5656c40121..b383a282c7 100644 --- a/base/src/org/compiere/model/MOrder.java +++ b/base/src/org/compiere/model/MOrder.java @@ -1790,10 +1790,9 @@ public class MOrder extends X_C_Order implements DocAction } } // Manually Process Shipment - String status = shipment.completeIt(); - shipment.setDocStatus(status); - shipment.save(get_TrxName()); - if (!DOCSTATUS_Completed.equals(status)) + shipment.processIt(DocAction.ACTION_Complete); + shipment.saveEx(get_TrxName()); + if (!DOCSTATUS_Completed.equals(shipment.getDocStatus())) { m_processMsg = "@M_InOut_ID@: " + shipment.getProcessMsg(); return null; @@ -1877,11 +1876,10 @@ public class MOrder extends X_C_Order implements DocAction } } // Manually Process Invoice - String status = invoice.completeIt(); - invoice.setDocStatus(status); - invoice.save(get_TrxName()); + invoice.processIt(DocAction.ACTION_Complete); + invoice.saveEx(get_TrxName()); setC_CashLine_ID(invoice.getC_CashLine_ID()); - if (!DOCSTATUS_Completed.equals(status)) + if (!DOCSTATUS_Completed.equals(invoice.getDocStatus())) { m_processMsg = "@C_Invoice_ID@: " + invoice.getProcessMsg(); return null; diff --git a/base/src/org/compiere/process/DocumentEngine.java b/base/src/org/compiere/process/DocumentEngine.java index 174535dc9c..f5bc00e628 100644 --- a/base/src/org/compiere/process/DocumentEngine.java +++ b/base/src/org/compiere/process/DocumentEngine.java @@ -34,6 +34,7 @@ import org.compiere.model.MAllocationHdr; import org.compiere.model.MBankStatement; import org.compiere.model.MCash; import org.compiere.model.MClient; +import org.compiere.model.MColumn; import org.compiere.model.MInOut; import org.compiere.model.MInventory; import org.compiere.model.MInvoice; @@ -42,6 +43,7 @@ import org.compiere.model.MJournalBatch; import org.compiere.model.MMovement; import org.compiere.model.MOrder; import org.compiere.model.MPayment; +import org.compiere.model.MTable; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -287,20 +289,20 @@ public class DocumentEngine implements DocAction return false; } status = completeIt(); - if (m_document != null - && !Ini.isClient()) // Post Immediate if on Server + boolean ok = STATUS_Completed.equals(status) + || STATUS_InProgress.equals(status) + || STATUS_WaitingPayment.equals(status) + || STATUS_WaitingConfirmation.equals(status); + if (m_document != null && ok) { MClient client = MClient.get(m_document.getCtx(), m_document.getAD_Client_ID()); - if (STATUS_Completed.equals(status) && client.isPostImmediate()) + if (STATUS_Completed.equals(status) && MClient.isClientAccountingImmediate()) { m_document.save(); postIt(); } } - return STATUS_Completed.equals(status) - || STATUS_InProgress.equals(status) - || STATUS_WaitingPayment.equals(status) - || STATUS_WaitingConfirmation.equals(status); + return ok; } if (ACTION_ReActivate.equals(m_action)) return reActivateIt(); @@ -1228,6 +1230,10 @@ public class DocumentEngine implements DocAction public static String postImmediate (Properties ctx, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force, String trxName) { + // Ensure the table has Posted column / i.e. GL_JournalBatch can be completed but not posted + if (MColumn.getColumn_ID(MTable.getTableName(ctx, AD_Table_ID), "Posted") <= 0) + return null; + String error = null; if (MClient.isClientAccounting()) { log.info ("Table=" + AD_Table_ID + ", Record=" + Record_ID); diff --git a/base/src/org/compiere/wf/MWFActivity.java b/base/src/org/compiere/wf/MWFActivity.java index 39f4e411ff..54575a1c2d 100644 --- a/base/src/org/compiere/wf/MWFActivity.java +++ b/base/src/org/compiere/wf/MWFActivity.java @@ -36,7 +36,6 @@ import org.compiere.model.MBPartner; import org.compiere.model.MClient; import org.compiere.model.MColumn; import org.compiere.model.MConversionRate; -import org.compiere.model.MFactAcct; import org.compiere.model.MMailText; import org.compiere.model.MNote; import org.compiere.model.MOrg; @@ -54,7 +53,6 @@ import org.compiere.model.Query; import org.compiere.model.X_AD_WF_Activity; import org.compiere.print.ReportEngine; import org.compiere.process.DocAction; -import org.compiere.process.DocumentEngine; import org.compiere.process.ProcessInfo; import org.compiere.process.StateEngine; import org.compiere.util.DisplayType; @@ -77,7 +75,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable /** * */ - private static final long serialVersionUID = 1584816335412184476L; + private static final long serialVersionUID = -3282235931100223816L; /** * Get Activities for table/record @@ -232,8 +230,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable private String m_newValue = null; /** Process */ private MWFProcess m_process = null; - /** Post Immediate Candidate */ - private DocAction m_postImmediate = null; /** List of email recipients */ private ArrayList m_emails = new ArrayList(); @@ -805,13 +801,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable setWFState (done ? StateEngine.STATE_Completed : StateEngine.STATE_Suspended); - //end vpj-cd e-evolution 03/08/2005 PostgreSQL - if (m_postImmediate != null) - try { - postImmediate(); - } catch (Exception e) { - log.warning("Error posting document: " + e.toString()); - } // ignore any error in this posting } catch (Exception e) { @@ -868,7 +857,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable private boolean performWork (Trx trx) throws Exception { log.info (m_node + " [" + trx.getTrxName() + "]"); - m_postImmediate = null; m_docStatus = null; if (m_node.getPriority() != 0) // overwrite priority if defined setPriority(m_node.getPriority()); @@ -918,14 +906,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable m_process.setProcessMsg(e.getLocalizedMessage()); throw e; } - // Post Immediate - if (success && DocAction.STATUS_Completed.equals(doc.getDocStatus()) && DocAction.ACTION_Complete.equals(m_node.getDocAction())) - { - MClient client = MClient.get(doc.getCtx(), doc.getAD_Client_ID()); - if (client.isPostImmediate() || MClient.isClientAccountingImmediate()) - m_postImmediate = doc; - } - // if (m_process != null) m_process.setProcessMsg(processMsg); } @@ -1521,19 +1501,6 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable } // instance parameter loop } // fillParameter - /** - * Post Immediate - */ - private void postImmediate() - { - if (MFactAcct.alreadyPosted(m_postImmediate.get_Table_ID(), m_postImmediate.get_ID(), m_postImmediate.get_TrxName())) - return; - - String error = DocumentEngine.postImmediate(m_postImmediate.getCtx(), - m_postImmediate.getAD_Client_ID(), m_postImmediate.get_Table_ID(), m_postImmediate.get_ID(), true, - m_postImmediate.get_TrxName()); - } // PostImmediate - /********************************* * Send EMail */ diff --git a/client/src/org/compiere/apps/form/Match.java b/client/src/org/compiere/apps/form/Match.java index 533f6c963d..88be94851f 100644 --- a/client/src/org/compiere/apps/form/Match.java +++ b/client/src/org/compiere/apps/form/Match.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import org.compiere.minigrid.IDColumn; import org.compiere.minigrid.IMiniTable; +import org.compiere.model.MClient; import org.compiere.model.MInOutLine; import org.compiere.model.MInvoiceLine; import org.compiere.model.MMatchInv; @@ -30,11 +31,13 @@ import org.compiere.model.MMatchPO; import org.compiere.model.MOrderLine; import org.compiere.model.MRole; import org.compiere.model.MStorage; +import org.compiere.process.DocumentEngine; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; +import org.compiere.util.Trx; public class Match { @@ -199,7 +202,14 @@ public class Match } // Create it - createMatchRecord(invoice, M_InOutLine_ID, Line_ID, new BigDecimal(qty)); + String innerTrxName = Trx.createTrxName("Match"); + Trx innerTrx = Trx.get(innerTrxName, true); + if (createMatchRecord(invoice, M_InOutLine_ID, Line_ID, new BigDecimal(qty), innerTrxName)) + innerTrx.commit(); + else + innerTrx.rollback(); + innerTrx.close(); + innerTrx = null; } } // requery @@ -379,10 +389,11 @@ public class Match * @param M_InOutLine_ID shipment line * @param Line_ID C_InvoiceLine_ID or C_OrderLine_ID * @param qty quantity + * @param trxName * @return true if created */ protected boolean createMatchRecord (boolean invoice, int M_InOutLine_ID, int Line_ID, - BigDecimal qty) + BigDecimal qty, String trxName) { if (qty.compareTo(Env.ZERO) == 0) return true; @@ -391,11 +402,11 @@ public class Match + ", Qty=" + qty); // boolean success = false; - MInOutLine sLine = new MInOutLine (Env.getCtx(), M_InOutLine_ID, null); + MInOutLine sLine = new MInOutLine (Env.getCtx(), M_InOutLine_ID, trxName); if (invoice) // Shipment - Invoice { // Update Invoice Line - MInvoiceLine iLine = new MInvoiceLine (Env.getCtx(), Line_ID, null); + MInvoiceLine iLine = new MInvoiceLine (Env.getCtx(), Line_ID, trxName); iLine.setM_InOutLine_ID(M_InOutLine_ID); if (sLine.getC_OrderLine_ID() != 0) iLine.setC_OrderLine_ID(sLine.getC_OrderLine_ID()); @@ -405,8 +416,12 @@ public class Match { MMatchInv match = new MMatchInv (iLine, null, qty); match.setM_InOutLine_ID(M_InOutLine_ID); - if (match.save()) + if (match.save()) { success = true; + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(match.getCtx(), match.getAD_Client_ID(), match.get_Table_ID(), match.get_ID(), true, match.get_TrxName()); + } + } else log.log(Level.SEVERE, "Inv Match not created: " + match); } @@ -420,6 +435,9 @@ public class Match matchPO.setM_InOutLine_ID(M_InOutLine_ID); if (!matchPO.save()) log.log(Level.SEVERE, "PO(Inv) Match not created: " + matchPO); + if (MClient.isClientAccountingImmediate()) { + String ignoreError = DocumentEngine.postImmediate(matchPO.getCtx(), matchPO.getAD_Client_ID(), matchPO.get_Table_ID(), matchPO.get_ID(), true, matchPO.get_TrxName()); + } } } else // Shipment - Order @@ -428,7 +446,7 @@ public class Match sLine.setC_OrderLine_ID(Line_ID); sLine.save(); // Update Order Line - MOrderLine oLine = new MOrderLine(Env.getCtx(), Line_ID, null); + MOrderLine oLine = new MOrderLine(Env.getCtx(), Line_ID, trxName); if (oLine.get_ID() != 0) // other in MInOut.completeIt { oLine.setQtyReserved(oLine.getQtyReserved().subtract(qty)); @@ -451,7 +469,7 @@ public class Match sLine.getM_Locator_ID(), sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), oLine.getM_AttributeSetInstance_ID(), - null, null, qty.negate(), null); + null, null, qty.negate(), trxName); } } else diff --git a/migration/354a-trunk/oracle/681_BF2968442.sql b/migration/354a-trunk/oracle/681_BF2968442.sql new file mode 100644 index 0000000000..9e9ccf3e22 --- /dev/null +++ b/migration/354a-trunk/oracle/681_BF2968442.sql @@ -0,0 +1,146 @@ +-- Mar 13, 2010 11:54:49 PM COT +-- BF_2968442_Post without Application Server +UPDATE AD_Element SET Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.', Name='Post Immediately (Deprecated)',Updated=TO_DATE('2010-03-13 23:54:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:49 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:49 PM COT +UPDATE AD_Column SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Process_Para SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.', AD_Element_ID=2843 WHERE UPPER(ColumnName)='ISPOSTIMMEDIATE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Process_Para SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Element_ID=2843 AND IsCentrallyMaintained='Y' +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Field SET Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2843) AND IsCentrallyMaintained='Y' +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_PrintFormatItem pi SET PrintName='Post Immediate', Name='Post Immediately (Deprecated)' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=2843) +; + +-- Mar 13, 2010 11:55:40 PM COT +UPDATE AD_Field SET IsSameLine='N',Updated=TO_DATE('2010-03-13 23:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12326 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=12327 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=317 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=318 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=319 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=10318 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=5160 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=5759 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=11025 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=11205 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=3813 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=5887 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=5161 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=5162 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=5163 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=5164 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=12099 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=12098 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11024 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=12326 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=50158 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=50159 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=50160 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=50184 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=50185 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=50186 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=54238 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=54680 +; + diff --git a/migration/354a-trunk/postgresql/681_BF2968442.sql b/migration/354a-trunk/postgresql/681_BF2968442.sql new file mode 100644 index 0000000000..50a5bfb19a --- /dev/null +++ b/migration/354a-trunk/postgresql/681_BF2968442.sql @@ -0,0 +1,146 @@ +-- Mar 13, 2010 11:54:49 PM COT +-- BF_2968442_Post without Application Server +UPDATE AD_Element SET Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.', Name='Post Immediately (Deprecated)',Updated=TO_TIMESTAMP('2010-03-13 23:54:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:49 PM COT +UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:49 PM COT +UPDATE AD_Column SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Element_ID=2843 +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Process_Para SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.', AD_Element_ID=2843 WHERE UPPER(ColumnName)='ISPOSTIMMEDIATE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Process_Para SET ColumnName='IsPostImmediate', Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Element_ID=2843 AND IsCentrallyMaintained='Y' +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_Field SET Name='Post Immediately (Deprecated)', Description='Post the accounting immediately for testing (Deprecated)', Help='If selected, the accounting consequences are immediately generated when completing a document. Otherwise the document is posted by a batch process. You should select this only if you are testing. +Deprecated column - use instead the functionality Client Accounting.' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2843) AND IsCentrallyMaintained='Y' +; + +-- Mar 13, 2010 11:54:50 PM COT +UPDATE AD_PrintFormatItem SET PrintName='Post Immediate', Name='Post Immediately (Deprecated)' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=2843) +; + +-- Mar 13, 2010 11:55:40 PM COT +UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2010-03-13 23:55:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12326 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=12327 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=317 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=318 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=319 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=10318 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=5160 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=5759 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=11025 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=11205 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=3813 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=5887 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=5161 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=5162 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=5163 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=5164 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=12099 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=12098 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=11024 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=12326 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=50158 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=50159 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=50160 +; + +-- Mar 13, 2010 11:55:55 PM COT +UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=50184 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=50185 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=50186 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=54238 +; + +-- Mar 13, 2010 11:55:56 PM COT +UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=54680 +; +