diff --git a/db/ddlutils/oracle/procedures/C_Order_DrillDown.sql b/db/ddlutils/oracle/procedures/C_Order_DrillDown.sql index 3e55c3e299..4cc3b8169f 100644 --- a/db/ddlutils/oracle/procedures/C_Order_DrillDown.sql +++ b/db/ddlutils/oracle/procedures/C_Order_DrillDown.sql @@ -1,12 +1,12 @@ -CREATE OR REPLACE PROCEDURE C_Order_DrillDown +CREATE OR REPLACE PROCEDURE C_ORDER_DRILLDOWN ( PInstance_ID IN NUMBER ) /****************************************************************************** - * ** Adempiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA + * ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA * Open Source Software Provided "AS IS" without warranty or liability - * When you use any parts (changed or unchanged), add "Powered by Adempiere" to - * your product name; See license details http://www.adempiere.org/license.html + * When you use any parts (changed or unchanged), add "Powered by Compiere" to + * your product name; See license details http://www.compiere.org/license.html ****************************************************************************** * List Orders with their Shipments and Invoices * Spool to T_Spool @@ -58,7 +58,7 @@ BEGIN -- Order Info FOR o IN Cur_Order LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), o.Name || ' ' || o.DocumentNo || ': @DocStatus@=' || o.DocStatus || ', @DocAction@=' || o.DocAction || ', @Processed@=' || o.Processed); @@ -71,7 +71,7 @@ BEGIN ORDER BY Line; BEGIN FOR ol IN Cur_OrderLine LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), ' @QtyOrdered@=' || ol.QtyOrdered || ', @QtyReserved@=' || ol.QtyReserved || ', @QtyDelivered@=' || ol.QtyDelivered || ', @QtyInvoiced@=' || ol.QtyInvoiced || ' - Wh=' || ol.M_Warehouse_ID @@ -88,7 +88,7 @@ BEGIN AND s.C_DocType_ID=d.C_DocType_ID; BEGIN FOR s IN Cur_InOut LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), '> ' || s.Name || ' ' || s.DocumentNo || ': @DocStatus@=' || s.DocStatus || ', @Processed@=' || s.Processed || ', Wh=' || s.M_Warehouse_ID); @@ -101,7 +101,7 @@ BEGIN ORDER BY Line; BEGIN FOR sl IN Cur_InOutLine LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), ' @QtyDelivered@=' || sl.MovementQty || ', Prd=' || sl.M_Product_ID); END LOOP; END; -- Shipment Lines @@ -121,7 +121,7 @@ BEGIN BEGIN FOR i IN Cur_Invoice LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), '> ' || i.Name || ' ' || i.DocumentNo || ': @DocStatus@=' || i.DocStatus || ', @Processed@=' || i.Processed); @@ -134,7 +134,7 @@ BEGIN ORDER BY Line; BEGIN FOR il IN Cur_InvoiceLine LOOP - INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, T_Spool_Seq.NextVal, + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), ' @QtyInvoiced@=' || il.QtyInvoiced || ', Prd=' || il.M_Product_ID); END LOOP; END; -- Invoice Lines diff --git a/migration/i1.0a-release/oracle/201211012011_IDEMPIERE-462.sql b/migration/i1.0a-release/oracle/201211012011_IDEMPIERE-462.sql index faebc89dec..b82905aa6d 100644 --- a/migration/i1.0a-release/oracle/201211012011_IDEMPIERE-462.sql +++ b/migration/i1.0a-release/oracle/201211012011_IDEMPIERE-462.sql @@ -1,3 +1,6 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + -- Oct 22, 2012 3:47:39 PM SGT -- IDEMPIERE-462 Ticket #1001503: Credit Cards Online INSERT INTO AD_Table (IsSecurityEnabled,AccessLevel,LoadSeq,AD_Table_ID,IsHighVolume,IsView,IsChangeLog,EntityType,ReplicationType,AD_Table_UU,IsCentrallyMaintained,IsDeleteable,TableName,Description,Name,AD_Client_ID,IsActive,AD_Org_ID,Updated,CreatedBy,UpdatedBy,Created) VALUES ('N','1',105,200031,'N','N','N','D','L','32bb4613-d058-44fb-9e5c-01f060281cc9','Y','Y','C_PaymentTransaction','Payment Transaction','Payment Transaction',0,'Y',0,TO_DATE('2012-10-22 15:47:37','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2012-10-22 15:47:37','YYYY-MM-DD HH24:MI:SS')) @@ -1287,7 +1290,86 @@ UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2012-10-22 15:56:20','YYYY- -- Oct 22, 2012 3:56:35 PM SGT -- IDEMPIERE-462 Ticket #1001503: Credit Cards Online -CREATE TABLE C_PaymentTransaction (A_City NVARCHAR2(60) DEFAULT NULL , A_Country NVARCHAR2(40) DEFAULT NULL , A_EMail NVARCHAR2(60) DEFAULT NULL , A_Ident_DL NVARCHAR2(20) DEFAULT NULL , A_Ident_SSN NVARCHAR2(20) DEFAULT NULL , A_Name NVARCHAR2(60) DEFAULT NULL , A_State NVARCHAR2(40) DEFAULT NULL , A_Street NVARCHAR2(60) DEFAULT NULL , A_Zip NVARCHAR2(20) DEFAULT NULL , AccountNo NVARCHAR2(20) DEFAULT NULL , AD_Client_ID NUMBER(10) NOT NULL, AD_Org_ID NUMBER(10) NOT NULL, AD_OrgTrx_ID NUMBER(10) DEFAULT NULL , C_Activity_ID NUMBER(10) DEFAULT NULL , C_BankAccount_ID NUMBER(10) DEFAULT NULL , C_BP_BankAccount_ID NUMBER(10) DEFAULT NULL , C_BPartner_ID NUMBER(10) NOT NULL, C_Campaign_ID NUMBER(10) DEFAULT NULL , C_CashBook_ID NUMBER(10) DEFAULT NULL , C_Charge_ID NUMBER(10) DEFAULT NULL , C_ConversionType_ID NUMBER(10) DEFAULT NULL , C_Currency_ID NUMBER(10) NOT NULL, C_DocType_ID NUMBER(10) NOT NULL, C_Invoice_ID NUMBER(10) DEFAULT NULL , C_Order_ID NUMBER(10) DEFAULT NULL , C_Payment_ID NUMBER(10) DEFAULT NULL , C_PaymentBatch_ID NUMBER(10) DEFAULT NULL , C_PaymentProcessor_ID NUMBER(10) DEFAULT NULL , C_PaymentTransaction_ID NUMBER(10) NOT NULL, C_PaymentTransaction_UU NVARCHAR2(36) DEFAULT NULL , C_POSTenderType_ID NUMBER(10) DEFAULT NULL , C_Project_ID NUMBER(10) DEFAULT NULL , CheckNo NVARCHAR2(20) DEFAULT NULL , Created DATE NOT NULL, CreatedBy NUMBER(10) NOT NULL, CreditCardExpMM NUMBER(10) DEFAULT 1, CreditCardExpYY NUMBER(10) DEFAULT 03, CreditCardNumber NVARCHAR2(20) DEFAULT NULL , CreditCardType CHAR(1) DEFAULT 'M', CreditCardVV NVARCHAR2(4) DEFAULT NULL , CustomerAddressID NVARCHAR2(60) DEFAULT NULL , CustomerPaymentProfileID NVARCHAR2(60) DEFAULT NULL , CustomerProfileID NVARCHAR2(60) DEFAULT NULL , DateTrx DATE NOT NULL, Description NVARCHAR2(255) DEFAULT NULL , IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL, IsApproved CHAR(1) DEFAULT 'N' CHECK (IsApproved IN ('Y','N')) NOT NULL, IsDelayedCapture CHAR(1) CHECK (IsDelayedCapture IN ('Y','N')) NOT NULL, IsOnline CHAR(1) CHECK (IsOnline IN ('Y','N')) NOT NULL, IsReceipt CHAR(1) CHECK (IsReceipt IN ('Y','N')) NOT NULL, IsSelfService CHAR(1) CHECK (IsSelfService IN ('Y','N')) NOT NULL, IsVoided CHAR(1) DEFAULT 'N' CHECK (IsVoided IN ('Y','N')) NOT NULL, Micr NVARCHAR2(20) DEFAULT NULL , Orig_TrxID NVARCHAR2(20) DEFAULT NULL , PayAmt NUMBER DEFAULT 0 NOT NULL, PONum NVARCHAR2(60) DEFAULT NULL , R_AuthCode NVARCHAR2(20) DEFAULT NULL , R_AvsAddr CHAR(1) DEFAULT NULL , R_AvsZip CHAR(1) DEFAULT NULL , R_CVV2Match CHAR(1) DEFAULT NULL CHECK (R_CVV2Match IN ('Y','N')), R_Info NVARCHAR2(2000) DEFAULT NULL , R_PnRef NVARCHAR2(20) DEFAULT NULL , R_RespMsg NVARCHAR2(60) DEFAULT NULL , R_Result NVARCHAR2(20) DEFAULT NULL , R_VoidMsg NVARCHAR2(255) DEFAULT NULL , Ref_PaymentTransaction_ID NUMBER(10) DEFAULT NULL , RoutingNo NVARCHAR2(20) DEFAULT NULL , TaxAmt NUMBER DEFAULT NULL , TenderType CHAR(1) DEFAULT 'K' NOT NULL, TrxType CHAR(1) DEFAULT 'S' NOT NULL, Updated DATE NOT NULL, UpdatedBy NUMBER(10) NOT NULL, User1_ID NUMBER(10) DEFAULT NULL , User2_ID NUMBER(10) DEFAULT NULL , VoiceAuthCode NVARCHAR2(20) DEFAULT NULL , VoidIt CHAR(1) DEFAULT NULL , CONSTRAINT C_PaymentTransaction_Key PRIMARY KEY (C_PaymentTransaction_ID)) +CREATE TABLE c_paymenttransaction + ( + a_city NVARCHAR2(60) DEFAULT NULL, + a_country NVARCHAR2(40) DEFAULT NULL, + a_email NVARCHAR2(60) DEFAULT NULL, + a_ident_dl NVARCHAR2(20) DEFAULT NULL, + a_ident_ssn NVARCHAR2(20) DEFAULT NULL, + a_name NVARCHAR2(60) DEFAULT NULL, + a_state NVARCHAR2(40) DEFAULT NULL, + a_street NVARCHAR2(60) DEFAULT NULL, + a_zip NVARCHAR2(20) DEFAULT NULL, + accountno NVARCHAR2(20) DEFAULT NULL, + ad_client_id NUMBER(10) NOT NULL, + ad_org_id NUMBER(10) NOT NULL, + ad_orgtrx_id NUMBER(10) DEFAULT NULL, + c_activity_id NUMBER(10) DEFAULT NULL, + c_bankaccount_id NUMBER(10) DEFAULT NULL, + c_bp_bankaccount_id NUMBER(10) DEFAULT NULL, + c_bpartner_id NUMBER(10) NOT NULL, + c_campaign_id NUMBER(10) DEFAULT NULL, + c_cashbook_id NUMBER(10) DEFAULT NULL, + c_charge_id NUMBER(10) DEFAULT NULL, + c_conversiontype_id NUMBER(10) DEFAULT NULL, + c_currency_id NUMBER(10) NOT NULL, + c_doctype_id NUMBER(10) NOT NULL, + c_invoice_id NUMBER(10) DEFAULT NULL, + c_order_id NUMBER(10) DEFAULT NULL, + c_payment_id NUMBER(10) DEFAULT NULL, + c_paymentbatch_id NUMBER(10) DEFAULT NULL, + c_paymentprocessor_id NUMBER(10) DEFAULT NULL, + c_paymenttransaction_id NUMBER(10) NOT NULL, + c_paymenttransaction_uu NVARCHAR2(36) DEFAULT NULL, + c_postendertype_id NUMBER(10) DEFAULT NULL, + c_project_id NUMBER(10) DEFAULT NULL, + checkno NVARCHAR2(20) DEFAULT NULL, + created DATE NOT NULL, + createdby NUMBER(10) NOT NULL, + creditcardexpmm NUMBER(10) DEFAULT 1, + creditcardexpyy NUMBER(10) DEFAULT 03, + creditcardnumber NVARCHAR2(20) DEFAULT NULL, + creditcardtype CHAR(1) DEFAULT 'M', + creditcardvv NVARCHAR2(4) DEFAULT NULL, + customeraddressid NVARCHAR2(60) DEFAULT NULL, + customerpaymentprofileid NVARCHAR2(60) DEFAULT NULL, + customerprofileid NVARCHAR2(60) DEFAULT NULL, + datetrx DATE NOT NULL, + description NVARCHAR2(255) DEFAULT NULL, + isactive CHAR(1) DEFAULT 'Y' CHECK (isactive IN ('Y', 'N')) NOT NULL, + isapproved CHAR(1) DEFAULT 'N' CHECK (isapproved IN ('Y', 'N')) NOT NULL, + isdelayedcapture CHAR(1) CHECK (isdelayedcapture IN ('Y', 'N')) NOT NULL, + isonline CHAR(1) CHECK (isonline IN ('Y', 'N')) NOT NULL, + isreceipt CHAR(1) CHECK (isreceipt IN ('Y', 'N')) NOT NULL, + isselfservice CHAR(1) CHECK (isselfservice IN ('Y', 'N')) NOT NULL, + isvoided CHAR(1) DEFAULT 'N' CHECK (isvoided IN ('Y', 'N')) NOT NULL, + micr NVARCHAR2(20) DEFAULT NULL, + orig_trxid NVARCHAR2(20) DEFAULT NULL, + payamt NUMBER DEFAULT 0 NOT NULL, + ponum NVARCHAR2(60) DEFAULT NULL, + r_authcode NVARCHAR2(20) DEFAULT NULL, + r_avsaddr CHAR(1) DEFAULT NULL, + r_avszip CHAR(1) DEFAULT NULL, + r_cvv2match CHAR(1) DEFAULT NULL CHECK (r_cvv2match IN ('Y', 'N')), + r_info NVARCHAR2(2000) DEFAULT NULL, + r_pnref NVARCHAR2(20) DEFAULT NULL, + r_respmsg NVARCHAR2(60) DEFAULT NULL, + r_result NVARCHAR2(20) DEFAULT NULL, + r_voidmsg NVARCHAR2(255) DEFAULT NULL, + ref_paymenttransaction_id NUMBER(10) DEFAULT NULL, + routingno NVARCHAR2(20) DEFAULT NULL, + taxamt NUMBER DEFAULT NULL, + tendertype CHAR(1) DEFAULT 'K' NOT NULL, + trxtype CHAR(1) DEFAULT 'S' NOT NULL, + updated DATE NOT NULL, + updatedby NUMBER(10) NOT NULL, + user1_id NUMBER(10) DEFAULT NULL, + user2_id NUMBER(10) DEFAULT NULL, + voiceauthcode NVARCHAR2(20) DEFAULT NULL, + voidit CHAR(1) DEFAULT NULL, + CONSTRAINT c_paymenttransaction_key PRIMARY KEY (c_paymenttransaction_id) + ) ; -- Oct 22, 2012 3:57:37 PM SGT diff --git a/migration/i1.0a-release/oracle/201211070846_IDEMPIERE-422.sql b/migration/i1.0a-release/oracle/201211070846_IDEMPIERE-422.sql new file mode 100644 index 0000000000..4e9e3e6232 --- /dev/null +++ b/migration/i1.0a-release/oracle/201211070846_IDEMPIERE-422.sql @@ -0,0 +1,177 @@ +CREATE OR REPLACE PROCEDURE C_ORDER_DRILLDOWN +( + PInstance_ID IN NUMBER +) +/****************************************************************************** + * ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA + * Open Source Software Provided "AS IS" without warranty or liability + * When you use any parts (changed or unchanged), add "Powered by Compiere" to + * your product name; See license details http://www.compiere.org/license.html + ****************************************************************************** + * List Orders with their Shipments and Invoices + * Spool to T_Spool + */ +AS + ResultStr VARCHAR2(2000); + Message VARCHAR2(2000); + Record_ID NUMBER; + CURSOR Cur_Parameter (PInstance NUMBER) IS + SELECT i.Record_ID, p.ParameterName, p.P_String, p.P_Number, p.P_Date + FROM AD_PInstance i, AD_PInstance_Para p + WHERE i.AD_PInstance_ID=PInstance + AND i.AD_PInstance_ID=p.AD_PInstance_ID(+) + ORDER BY p.SeqNo; + -- Parameter + C_Order_ID NUMBER; + -- + CURSOR Cur_Order IS + SELECT o.C_Order_ID, d.Name, o.DocumentNo, o.DocStatus, o.DocAction, o.Processed + FROM C_Order o, C_DocType d + WHERE o.C_Order_ID=C_Order_ID + AND o.C_DocType_ID=d.C_DocType_ID + ORDER BY o.DocumentNo DESC; + +BEGIN + -- No locking or Updating + + -- Get Parameters + ResultStr := 'ReadingParameters'; + FOR p IN Cur_Parameter (PInstance_ID) LOOP + Record_ID := p.Record_ID; + IF (p.ParameterName = 'C_Order_ID') THEN + C_Order_ID := p.P_Number; + DBMS_OUTPUT.PUT_LINE(' C_Order_ID=' || C_Order_ID); + ELSE + DBMS_OUTPUT.PUT_LINE('*** Unknown Parameter=' || p.ParameterName); + END IF; + END LOOP; -- Get Parameter + DBMS_OUTPUT.PUT_LINE(' Record_ID=' || Record_ID); + + IF (C_Order_ID IS NULL) THEN + C_Order_ID := Record_ID; + END IF; + + -- Should be nothing there + DELETE T_Spool + WHERE AD_PInstance_ID=PInstance_ID; + + -- Order Info + FOR o IN Cur_Order LOOP + + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + o.Name || ' ' || o.DocumentNo || ': @DocStatus@=' || o.DocStatus + || ', @DocAction@=' || o.DocAction || ', @Processed@=' || o.Processed); + + -- Order Lines + DECLARE + CURSOR Cur_OrderLine IS + SELECT * + FROM C_OrderLine + WHERE C_Order_ID=o.C_Order_ID + ORDER BY Line; + BEGIN + FOR ol IN Cur_OrderLine LOOP + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + ' @QtyOrdered@=' || ol.QtyOrdered || ', @QtyReserved@=' || ol.QtyReserved + || ', @QtyDelivered@=' || ol.QtyDelivered || ', @QtyInvoiced@=' || ol.QtyInvoiced + || ' - Wh=' || ol.M_Warehouse_ID + || ', Prd=' || ol.M_Product_ID); + END LOOP; + END; + + -- Shipment + DECLARE + CURSOR Cur_InOut IS + SELECT s.M_InOut_ID, d.Name, s.DocumentNo, s.DocStatus, s.Processed, s.M_Warehouse_ID + FROM M_InOut s, C_DocType d + WHERE s.C_Order_ID = o.C_Order_ID + AND s.C_DocType_ID=d.C_DocType_ID; + BEGIN + FOR s IN Cur_InOut LOOP + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + '> ' || s.Name || ' ' || s.DocumentNo || ': @DocStatus@=' || s.DocStatus + || ', @Processed@=' || s.Processed || ', Wh=' || s.M_Warehouse_ID); + + -- Shipment Lines + DECLARE + CURSOR Cur_InOutLine IS + SELECT * + FROM M_InOutLine + WHERE M_InOut_ID=s.M_InOut_ID + ORDER BY Line; + BEGIN + FOR sl IN Cur_InOutLine LOOP + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + ' @QtyDelivered@=' || sl.MovementQty || ', Prd=' || sl.M_Product_ID); + END LOOP; + END; -- Shipment Lines + END LOOP; -- Shipments + END; -- Shipment + + -- Invoice + DECLARE + CURSOR Cur_Invoice IS + SELECT i.C_Invoice_ID, d.Name, i.DocumentNo, i.DocStatus, i.Processed + FROM C_Invoice i, C_DocType d + WHERE i.C_DocType_ID=d.C_DocType_ID + AND EXISTS (SELECT * FROM C_InvoiceLine l, C_OrderLine ol + WHERE i.C_Invoice_ID = l.C_Invoice_ID + AND l.C_OrderLine_ID = ol.C_OrderLine_ID + AND ol.C_Order_ID=o.C_Order_ID); + BEGIN + FOR i IN Cur_Invoice LOOP + + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + '> ' || i.Name || ' ' || i.DocumentNo || ': @DocStatus@=' || i.DocStatus + || ', @Processed@=' || i.Processed); + + -- Invoice Lines + DECLARE + CURSOR Cur_InvoiceLine IS + SELECT * + FROM C_InvoiceLine + WHERE C_Invoice_ID=i.C_Invoice_ID + ORDER BY Line; + BEGIN + FOR il IN Cur_InvoiceLine LOOP + INSERT INTO T_Spool (AD_PInstance_ID, SeqNo, MsgText) VALUES (PInstance_ID, nextidfunc(1173, 'N'), + ' @QtyInvoiced@=' || il.QtyInvoiced || ', Prd=' || il.M_Product_ID); + END LOOP; + END; -- Invoice Lines + END LOOP; -- Invoices + END; -- Invoice + + END LOOP; -- Order + + +<> + -- Update AD_PInstance + DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || Message); + UPDATE AD_PInstance + SET Updated = SysDate, + IsProcessing = 'N', + Result = 1, -- success + ErrorMsg = Message + WHERE AD_PInstance_ID=PInstance_ID; + COMMIT; + RETURN; + +EXCEPTION + WHEN OTHERS THEN + ResultStr := ResultStr || ': ' || SQLERRM || ' - ' || Message; + DBMS_OUTPUT.PUT_LINE(ResultStr); + UPDATE AD_PInstance + SET Updated = SysDate, + IsProcessing = 'N', + Result = 0, -- failure + ErrorMsg = ResultStr + WHERE AD_PInstance_ID=PInstance_ID; + COMMIT; + RETURN; + +END C_Order_DrillDown; +/ + +SELECT register_migration_script('201211070846_IDEMPIERE-422.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201211070846_IDEMPIERE-422.sql b/migration/i1.0a-release/postgresql/201211070846_IDEMPIERE-422.sql new file mode 100644 index 0000000000..54bd2ba367 --- /dev/null +++ b/migration/i1.0a-release/postgresql/201211070846_IDEMPIERE-422.sql @@ -0,0 +1,5 @@ +-- just for oracle + +SELECT register_migration_script('201211070846_IDEMPIERE-422.sql') FROM dual +; + diff --git a/org.adempiere.base/META-INF/MANIFEST.MF b/org.adempiere.base/META-INF/MANIFEST.MF index 04737eb512..3a71ae21d1 100644 --- a/org.adempiere.base/META-INF/MANIFEST.MF +++ b/org.adempiere.base/META-INF/MANIFEST.MF @@ -289,6 +289,6 @@ Import-Package: com.sun.mail.auth;version="1.4.5", Eclipse-BuddyPolicy: registered Eclipse-ExtensibleAPI: true Bundle-Activator: org.adempiere.base.BaseActivator -Service-Component: OSGI-INF/eventmanager.xml, OSGI-INF/dslocator.xml, OSGI-INF/extensionlocator.xml, OSGI-INF/serverbean.xml, OSGI-INF/statusbean.xml +Service-Component: OSGI-INF/eventmanager.xml, OSGI-INF/dslocator.xml, OSGI-INF/extensionlocator.xml, OSGI-INF/serverbean.xml, OSGI-INF/statusbean.xml, OSGI-INF/defaultmodelfactory.xml, OSGI-INF/defaultdocfactory.xml Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.equinox.app;bundle-version="1.3.1" diff --git a/org.adempiere.base/OSGI-INF/defaultdocfactory.xml b/org.adempiere.base/OSGI-INF/defaultdocfactory.xml new file mode 100644 index 0000000000..806804c562 --- /dev/null +++ b/org.adempiere.base/OSGI-INF/defaultdocfactory.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.adempiere.base/OSGI-INF/defaultmodelfactory.xml b/org.adempiere.base/OSGI-INF/defaultmodelfactory.xml new file mode 100644 index 0000000000..b9c2d6c074 --- /dev/null +++ b/org.adempiere.base/OSGI-INF/defaultmodelfactory.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.adempiere.base/build.properties b/org.adempiere.base/build.properties index 35345f99c3..c923eec5c3 100644 --- a/org.adempiere.base/build.properties +++ b/org.adempiere.base/build.properties @@ -20,7 +20,9 @@ bin.includes = META-INF/,\ OSGI-INF/dslocator.xml,\ OSGI-INF/extensionlocator.xml,\ OSGI-INF/serverbean.xml,\ - OSGI-INF/statusbean.xml + OSGI-INF/statusbean.xml,\ + OSGI-INF/defaultmodelfactory.xml,\ + OSGI-INF/defaultdocfactory.xml output.base.jar = build/ src.includes = schema/ source.base.jar = src/ diff --git a/org.adempiere.base/plugin.xml b/org.adempiere.base/plugin.xml index a6535ada32..68924a0ff2 100644 --- a/org.adempiere.base/plugin.xml +++ b/org.adempiere.base/plugin.xml @@ -15,25 +15,6 @@ - - - - - - - - names = new ArrayList(); - IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(AdempiereDatabase.class.getName()); - for(IConfigurationElement element : elements) - { - String type = element.getAttribute("id"); - names.add(type); + List services = Service.locator().list(AdempiereDatabase.class).getServices(); + for (AdempiereDatabase db : services) { + names.add(db.getName()); } - String[] nameArray = names.toArray(new String[0]); - return nameArray; + return names.toArray(new String[0]); } /** diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index aa98ddc104..795d1fbb74 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1773,6 +1773,32 @@ public class MInvoice extends X_C_Invoice implements DocAction { MInvoiceLine line = lines[i]; + // Matching - Inv-Shipment + if (!isSOTrx() + && line.getM_InOutLine_ID() != 0 + && line.getM_Product_ID() != 0 + && !isReversal()) + { + MInOutLine receiptLine = new MInOutLine (getCtx(),line.getM_InOutLine_ID(), get_TrxName()); + BigDecimal matchQty = line.getQtyInvoiced(); + + if (receiptLine.getMovementQty().compareTo(matchQty) < 0) + matchQty = receiptLine.getMovementQty(); + + MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty); + boolean isNewMatchInv = false; + if (inv.get_ID() == 0) + isNewMatchInv = true; + if (!inv.save(get_TrxName())) + { + m_processMsg = CLogger.retrieveErrorString("Could not create Invoice Matching"); + return DocAction.STATUS_Invalid; + } + matchInv++; + if (isNewMatchInv) + addDocsPostProcess(inv); + } + // Update Order Line MOrderLine ol = null; if (line.getC_OrderLine_ID() != 0) @@ -1826,33 +1852,7 @@ public class MInvoice extends X_C_Invoice implements DocAction return DocAction.STATUS_Invalid; } } - // - - // Matching - Inv-Shipment - if (!isSOTrx() - && line.getM_InOutLine_ID() != 0 - && line.getM_Product_ID() != 0 - && !isReversal()) - { - MInOutLine receiptLine = new MInOutLine (getCtx(),line.getM_InOutLine_ID(), get_TrxName()); - BigDecimal matchQty = line.getQtyInvoiced(); - - if (receiptLine.getMovementQty().compareTo(matchQty) < 0) - matchQty = receiptLine.getMovementQty(); - - MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty); - boolean isNewMatchInv = false; - if (inv.get_ID() == 0) - isNewMatchInv = true; - if (!inv.save(get_TrxName())) - { - m_processMsg = CLogger.retrieveErrorString("Could not create Invoice Matching"); - return DocAction.STATUS_Invalid; - } - matchInv++; - if (isNewMatchInv) - addDocsPostProcess(inv); - } + // } // for all lines if (matchInv > 0) info.append(" @M_MatchInv_ID@#").append(matchInv).append(" "); diff --git a/org.adempiere.base/src/org/compiere/util/Trx.java b/org.adempiere.base/src/org/compiere/util/Trx.java index 7799346ed9..4c409e9037 100644 --- a/org.adempiere.base/src/org/compiere/util/Trx.java +++ b/org.adempiere.base/src/org/compiere/util/Trx.java @@ -536,6 +536,7 @@ public class Trx implements VetoableChangeListener * * @param trxName transaction name (if null, a new transaction will be created) * @param r runnable object + * @throws RuntimeException or {@link AdempiereException} */ public static void run(String trxName, TrxRunnable r) { diff --git a/org.adempiere.replication.server/.project b/org.adempiere.replication.server/.project index e12c8f29f1..ec884a7a61 100644 --- a/org.adempiere.replication.server/.project +++ b/org.adempiere.replication.server/.project @@ -20,6 +20,11 @@ + + org.eclipse.pde.ds.core.builder + + + org.eclipse.pde.PluginNature diff --git a/org.adempiere.replication.server/META-INF/MANIFEST.MF b/org.adempiere.replication.server/META-INF/MANIFEST.MF index 0516746e69..f5c56cb0d3 100644 --- a/org.adempiere.replication.server/META-INF/MANIFEST.MF +++ b/org.adempiere.replication.server/META-INF/MANIFEST.MF @@ -9,3 +9,4 @@ Require-Bundle: org.adempiere.server;bundle-version="1.0.0", org.adempiere.base;bundle-version="1.0.0" Import-Package: javax.jms;version="1.1.0", org.apache.activemq +Service-Component: OSGI-INF/serverfactory.xml diff --git a/org.adempiere.replication.server/OSGI-INF/serverfactory.xml b/org.adempiere.replication.server/OSGI-INF/serverfactory.xml new file mode 100644 index 0000000000..51272f5252 --- /dev/null +++ b/org.adempiere.replication.server/OSGI-INF/serverfactory.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.adempiere.replication.server/build.properties b/org.adempiere.replication.server/build.properties index e9863e281e..5ce59a31ac 100644 --- a/org.adempiere.replication.server/build.properties +++ b/org.adempiere.replication.server/build.properties @@ -1,5 +1,6 @@ -source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - plugin.xml + plugin.xml,\ + OSGI-INF/serverfactory.xml +source.. = src/ diff --git a/org.adempiere.replication.server/plugin.xml b/org.adempiere.replication.server/plugin.xml index 8164b0a212..5535690d37 100644 --- a/org.adempiere.replication.server/plugin.xml +++ b/org.adempiere.replication.server/plugin.xml @@ -1,11 +1,5 @@ - - - - diff --git a/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportAction.java b/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportAction.java index 910be69dc8..b9c2df7fe2 100644 --- a/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportAction.java +++ b/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportAction.java @@ -13,59 +13,21 @@ *****************************************************************************/ package org.adempiere.ui.zk.example.action; -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.adempiere.base.IGridTabExporter; -import org.adempiere.base.Service; -import org.adempiere.exceptions.AdempiereException; import org.adempiere.webui.action.IAction; import org.adempiere.webui.adwindow.ADWindow; -import org.adempiere.webui.adwindow.AbstractADWindowContent; -import org.adempiere.webui.adwindow.IADTabbox; -import org.adempiere.webui.adwindow.IADTabpanel; +import org.adempiere.webui.adwindow.ADWindowContent; import org.adempiere.webui.apps.AEnv; -import org.adempiere.webui.component.Checkbox; -import org.adempiere.webui.component.ConfirmPanel; -import org.adempiere.webui.component.Label; -import org.adempiere.webui.component.ListItem; -import org.adempiere.webui.component.Listbox; -import org.adempiere.webui.component.Window; import org.adempiere.webui.window.FDialog; -import org.compiere.model.GridTab; import org.compiere.model.MRole; -import org.compiere.util.Env; -import org.compiere.util.Msg; -import org.zkoss.util.media.AMedia; -import org.zkoss.zk.ui.event.Event; -import org.zkoss.zk.ui.event.EventListener; -import org.zkoss.zul.Div; -import org.zkoss.zul.Filedownload; -import org.zkoss.zul.Hbox; -import org.zkoss.zul.Vbox; /** * @author hengsin * */ -public class ExportAction implements IAction, EventListener { +public class ExportAction implements IAction { - private AbstractADWindowContent panel; - - private Map exporterMap = null; - private Map extensionMap = null; - - private Window winExportFile = null; - private ConfirmPanel confirmPanel = new ConfirmPanel(true); - private Listbox cboType = new Listbox(); - private Checkbox chkCurrentRow = new Checkbox(); /** - * + * default constructor */ public ExportAction() { } @@ -76,143 +38,20 @@ public class ExportAction implements IAction, EventListener { @Override public void execute(Object target) { ADWindow adwindow = (ADWindow) target; - panel = adwindow.getADWindowContent(); + ADWindowContent panel = adwindow.getADWindowContent(); if (!MRole.getDefault().isCanExport()) { FDialog.error(panel.getWindowNo(), "AccessTableNoView"); return; } - doExport(); + doExport(panel); } - private void doExport() { - exporterMap = new HashMap(); - extensionMap = new HashMap(); - List exporterList = Service.locator().list(IGridTabExporter.class).getServices(); - for(IGridTabExporter exporter : exporterList) - { - String extension = exporter.getFileExtension(); - if (!extensionMap.containsKey(extension)) - { - extensionMap.put(extension, exporter.getFileExtensionLabel()); - exporterMap.put(extension, exporter); - } - } - - if(winExportFile == null) - { - winExportFile = new Window(); - winExportFile.setTitle(Msg.getMsg(Env.getCtx(), "Export") + ": " + panel.getActiveGridTab().getName()); - winExportFile.setWidth("450px"); - winExportFile.setClosable(true); - winExportFile.setBorder("normal"); - winExportFile.setStyle("position:absolute"); - - cboType.setMold("select"); - - cboType.getItems().clear(); - for(Map.Entry entry : extensionMap.entrySet()) - { - cboType.appendItem(entry.getKey() + " - " + entry.getValue(), entry.getKey()); - } - - cboType.setSelectedIndex(0); - - Vbox vb = new Vbox(); - vb.setWidth("100%"); - winExportFile.appendChild(vb); - - Hbox hb = new Hbox(); - Div div = new Div(); - div.setAlign("right"); - div.appendChild(new Label("Files of Type: ")); - hb.appendChild(div); - hb.appendChild(cboType); - cboType.setWidth("100%"); - vb.appendChild(hb); - - hb = new Hbox(); - chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly")); - chkCurrentRow.setSelected(true); - hb.appendChild(chkCurrentRow); - vb.appendChild(hb); - - vb.appendChild(confirmPanel); - confirmPanel.addActionListener(this); - } - - winExportFile.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); - AEnv.showWindow(winExportFile); - } - - @Override - public void onEvent(Event event) throws Exception { - if(event.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) - winExportFile.onClose(); - else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) - exportFile(); - } - - private void exportFile() { - try { - ListItem li = cboType.getSelectedItem(); - if(li == null || li.getValue() == null) - { - FDialog.error(0, winExportFile, "FileInvalidExtension"); - return; - } - - String ext = li.getValue().toString(); - IGridTabExporter exporter = exporterMap.get(ext); - if (exporter == null) - { - FDialog.error(0, winExportFile, "FileInvalidExtension"); - return; - } - - boolean currentRowOnly = chkCurrentRow.isSelected(); - File file = File.createTempFile("Export", "."+ext); - IADTabbox adTab = panel.getADTab(); - int selected = adTab.getSelectedIndex(); - int tabLevel = panel.getActiveGridTab().getTabLevel(); - Set tables = new HashSet(); - List childs = new ArrayList(); - List includedList = panel.getActiveGridTab().getIncludedTabs(); - for(GridTab included : includedList) - { - String tableName = included.getTableName(); - if (tables.contains(tableName)) - continue; - tables.add(tableName); - childs.add(included); - } - for(int i = selected+1; i < adTab.getTabCount(); i++) - { - IADTabpanel adTabPanel = adTab.getADTabpanel(i); - if (adTabPanel.getGridTab().isSortTab()) - continue; - if (adTabPanel.getGridTab().getTabLevel() <= tabLevel) - break; - String tableName = adTabPanel.getGridTab().getTableName(); - if (tables.contains(tableName)) - continue; - tables.add(tableName); - childs.add(adTabPanel.getGridTab()); - } - - exporter.export(panel.getActiveGridTab(), childs, currentRowOnly, file); - - winExportFile.onClose(); - winExportFile = null; - AMedia media = null; - media = new AMedia(panel.getActiveGridTab().getName() + "." + ext, null, exporter.getContentType(), file, true); - Filedownload.save(media, panel.getActiveGridTab().getName() + "." + ext); - } catch (Exception e) { - throw new AdempiereException(e); - } finally { - if (winExportFile != null) - winExportFile.onClose(); - } - } + private void doExport(ADWindowContent panel) { + ExportWindow window = new ExportWindow(); + window.init(panel); + + AEnv.showWindow(window); + } } diff --git a/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportWindow.java b/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportWindow.java new file mode 100644 index 0000000000..9e67901d30 --- /dev/null +++ b/org.adempiere.ui.zk.example/src/org/adempiere/ui/zk/example/action/ExportWindow.java @@ -0,0 +1,188 @@ +/** + * + */ +package org.adempiere.ui.zk.example.action; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.adempiere.base.IGridTabExporter; +import org.adempiere.base.Service; +import org.adempiere.exceptions.AdempiereException; +import org.adempiere.webui.adwindow.ADWindowContent; +import org.adempiere.webui.adwindow.IADTabbox; +import org.adempiere.webui.adwindow.IADTabpanel; +import org.adempiere.webui.component.Checkbox; +import org.adempiere.webui.component.ConfirmPanel; +import org.adempiere.webui.component.Label; +import org.adempiere.webui.component.ListItem; +import org.adempiere.webui.component.Listbox; +import org.adempiere.webui.component.Window; +import org.adempiere.webui.window.FDialog; +import org.compiere.model.GridTab; +import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.zkoss.util.media.AMedia; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Div; +import org.zkoss.zul.Filedownload; +import org.zkoss.zul.Hbox; +import org.zkoss.zul.Vbox; + +/** + * @author hengsin + * + */ +public class ExportWindow extends Window implements EventListener { + + /** + * generated serial id + */ + private static final long serialVersionUID = -4465587396361021680L; + + private Map exporterMap = null; + private Map extensionMap = null; + + private ConfirmPanel confirmPanel = new ConfirmPanel(true); + private Listbox cboType = new Listbox(); + private Checkbox chkCurrentRow = new Checkbox(); + private ADWindowContent panel; + + /** + * + */ + public ExportWindow() { + } + + public void init(ADWindowContent panel) { + this.panel = panel; + + exporterMap = new HashMap(); + extensionMap = new HashMap(); + List exporterList = Service.locator().list(IGridTabExporter.class).getServices(); + for(IGridTabExporter exporter : exporterList) + { + String extension = exporter.getFileExtension(); + if (!extensionMap.containsKey(extension)) + { + extensionMap.put(extension, exporter.getFileExtensionLabel()); + exporterMap.put(extension, exporter); + } + } + + setTitle(Msg.getMsg(Env.getCtx(), "Export") + ": " + panel.getActiveGridTab().getName()); + setWidth("450px"); + setClosable(true); + setBorder("normal"); + setStyle("position:absolute"); + + cboType.setMold("select"); + + cboType.getItems().clear(); + for(Map.Entry entry : extensionMap.entrySet()) + { + cboType.appendItem(entry.getKey() + " - " + entry.getValue(), entry.getKey()); + } + + cboType.setSelectedIndex(0); + + Vbox vb = new Vbox(); + vb.setWidth("100%"); + appendChild(vb); + + Hbox hb = new Hbox(); + Div div = new Div(); + div.setStyle("float: right"); + div.appendChild(new Label("Files of Type: ")); + hb.appendChild(div); + hb.appendChild(cboType); + cboType.setWidth("100%"); + vb.appendChild(hb); + + hb = new Hbox(); + chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly")); + chkCurrentRow.setSelected(true); + hb.appendChild(chkCurrentRow); + vb.appendChild(hb); + + vb.appendChild(confirmPanel); + confirmPanel.addActionListener(this); + + setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED); + } + + @Override + public void onEvent(Event event) throws Exception { + if(event.getTarget().getId().equals(ConfirmPanel.A_CANCEL)) + onClose(); + else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) + exportFile(); + + } + + private void exportFile() { + try { + ListItem li = cboType.getSelectedItem(); + if(li == null || li.getValue() == null) + { + FDialog.error(0, this, "FileInvalidExtension"); + return; + } + + String ext = li.getValue().toString(); + IGridTabExporter exporter = exporterMap.get(ext); + if (exporter == null) + { + FDialog.error(0, this, "FileInvalidExtension"); + return; + } + + boolean currentRowOnly = chkCurrentRow.isSelected(); + File file = File.createTempFile("Export", "."+ext); + IADTabbox adTab = panel.getADTab(); + int selected = adTab.getSelectedIndex(); + int tabLevel = panel.getActiveGridTab().getTabLevel(); + Set tables = new HashSet(); + List childs = new ArrayList(); + List includedList = panel.getActiveGridTab().getIncludedTabs(); + for(GridTab included : includedList) + { + String tableName = included.getTableName(); + if (tables.contains(tableName)) + continue; + tables.add(tableName); + childs.add(included); + } + for(int i = selected+1; i < adTab.getTabCount(); i++) + { + IADTabpanel adTabPanel = adTab.getADTabpanel(i); + if (adTabPanel.getGridTab().isSortTab()) + continue; + if (adTabPanel.getGridTab().getTabLevel() <= tabLevel) + break; + String tableName = adTabPanel.getGridTab().getTableName(); + if (tables.contains(tableName)) + continue; + tables.add(tableName); + childs.add(adTabPanel.getGridTab()); + } + + exporter.export(panel.getActiveGridTab(), childs, currentRowOnly, file); + + onClose(); + AMedia media = null; + media = new AMedia(panel.getActiveGridTab().getName() + "." + ext, null, exporter.getContentType(), file, true); + Filedownload.save(media, panel.getActiveGridTab().getName() + "." + ext); + } catch (Exception e) { + throw new AdempiereException(e); + } finally { + onClose(); + } + } +} diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/action/IAction.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/action/IAction.java index 331ca49e9d..6389551c55 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/action/IAction.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/action/IAction.java @@ -14,9 +14,14 @@ package org.adempiere.webui.action; /** + * Custom UI action provided through OSGi service. Implementation must be thread safe. * @author hengsin * */ public interface IAction { + /** + * + * @param target + */ public void execute(Object target); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 78de2defca..0c1ab0256e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -45,7 +45,6 @@ import org.adempiere.webui.apps.form.WCreateFromFactory; import org.adempiere.webui.apps.form.WCreateFromWindow; import org.adempiere.webui.apps.form.WPayment; import org.adempiere.webui.component.Listbox; -import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; import org.adempiere.webui.editor.IProcessButton; import org.adempiere.webui.editor.WButtonEditor; @@ -107,6 +106,7 @@ import org.zkoss.zul.Hbox; import org.zkoss.zul.Listitem; import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menupopup; +import org.zkoss.zul.Window.Mode; /** * @@ -948,7 +948,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget(); onModalClose(dialog.getProcessInfo()); + String s = breadCrumb.getStatusLine(); onRefresh(true, false); + breadCrumb.setStatusLine(s); } else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName())) { @@ -1617,7 +1619,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements @Override public void onCallback(Boolean result) { - onRefresh(false, false); + onRefresh(true, false); } }); @@ -2273,7 +2275,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements @Override public void onCallback(Boolean result) { - onRefresh(false, false); + onRefresh(true, false); } }); @@ -2331,7 +2333,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements @Override public void onEvent(Event event) throws Exception { if (!window.isCancel()) { - adtabPanel.getGridTab().dataRefresh(); + onRefresh(true, false); } } }); @@ -2403,7 +2405,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (error != null) breadCrumb.setStatusLine(error, true); - onRefresh(false, false); + onRefresh(true, false); } } }); @@ -2468,10 +2470,18 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements pi.setAD_Client_ID (Env.getAD_Client_ID(ctx)); ADForm form = ADForm.openForm(adFormID); form.setProcessInfo(pi); + Mode mode = form.getWindowMode(); form.setAttribute(Window.MODE_KEY, form.getWindowMode()); form.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT); + if (mode == Mode.HIGHLIGHTED || mode == Mode.MODAL) { + form.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + onRefresh(true, false); + } + }); + } SessionManager.getAppDesktop().showWindow(form); - onRefresh(false, false); } else { @@ -2487,7 +2497,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } else { - onRefresh(false, false); + onRefresh(true, false); } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromShipmentUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromShipmentUI.java index d64eec1313..bcfc906b4b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromShipmentUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromShipmentUI.java @@ -52,9 +52,8 @@ import org.compiere.util.Msg; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; -import org.zkoss.zul.Borderlayout; -import org.zkoss.zul.Center; import org.zkoss.zul.Space; +import org.zkoss.zul.Vlayout; public class WCreateFromShipmentUI extends CreateFromShipment implements EventListener, ValueChangeListener { @@ -152,29 +151,26 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi sameWarehouseCb.setTooltiptext(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", false)); upcLabel.setText(Msg.getElement(Env.getCtx(), "UPC", false)); - Borderlayout parameterLayout = new Borderlayout(); - parameterLayout.setHeight("110px"); - parameterLayout.setWidth("100%"); + Vlayout vlayout = new Vlayout(); + vlayout.setVflex("1"); + vlayout.setWidth("100%"); Panel parameterPanel = window.getParameterPanel(); - parameterPanel.appendChild(parameterLayout); + parameterPanel.appendChild(vlayout); Grid parameterStdLayout = GridFactory.newGridLayout(); - Panel parameterStdPanel = new Panel(); - parameterStdPanel.appendChild(parameterStdLayout); - - Center center = new Center(); - parameterLayout.appendChild(center); - center.appendChild(parameterStdPanel); + vlayout.appendChild(parameterStdLayout); - parameterStdPanel.appendChild(parameterStdLayout); Rows rows = (Rows) parameterStdLayout.newRows(); Row row = rows.newRow(); row.appendChild(bPartnerLabel.rightAlign()); - if (bPartnerField != null) + if (bPartnerField != null) { row.appendChild(bPartnerField.getComponent()); + bPartnerField.fillHorizontal(); + } if (! isRMAWindow) { row.appendChild(orderLabel.rightAlign()); row.appendChild(orderField); + orderField.setHflex("1"); } row = rows.newRow(); @@ -182,7 +178,8 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi row.appendChild(locatorField.getComponent()); if (! isRMAWindow) { row.appendChild(invoiceLabel.rightAlign()); - row.appendChild(invoiceField); + row.appendChild(invoiceField); + invoiceField.setHflex("1"); } row = rows.newRow(); @@ -196,6 +193,7 @@ public class WCreateFromShipmentUI extends CreateFromShipment implements EventLi // Add RMA document selection to panel row.appendChild(rmaLabel.rightAlign()); row.appendChild(rmaField); + rmaField.setHflex("1"); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromWindow.java index dac0aef2c4..e2a1350268 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WCreateFromWindow.java @@ -31,7 +31,6 @@ import org.compiere.util.Trx; import org.compiere.util.TrxRunnable; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; -import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Center; import org.zkoss.zul.North; @@ -125,12 +124,10 @@ public class WCreateFromWindow extends Window implements EventListener, W { public void run(String trxName) { - if (save(trxName)) - { - dispose(); - } + save(trxName); } }); + dispose(); } catch (Exception ex) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMatch.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMatch.java index 37cba7e55e..fdf8118cda 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMatch.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WMatch.java @@ -415,7 +415,7 @@ public class WMatch extends Match else if (e.getTarget() == bProcess) { //cmd_process(); - cmd_process(xMatchedTable, xMatchedToTable, matchMode.getSelectedIndex(), matchFrom.getSelectedIndex(), matchTo.getSelectedItem(), m_xMatched); + cmd_process(xMatchedTable, xMatchedToTable, matchMode.getSelectedIndex(), matchFrom.getSelectedIndex(), matchTo.getSelectedItem().getLabel(), m_xMatched); xMatchedTable = (WListbox) cmd_search(xMatchedTable, matchFrom.getSelectedIndex(), (String)matchTo.getSelectedItem().getLabel(), product, vendor, from, to, matchMode.getSelectedIndex() == MODE_MATCHED); xMatched.setValue(Env.ZERO); // Status Info diff --git a/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java b/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java index b8ddde1b47..08d4c5cdfc 100644 --- a/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java +++ b/org.adempiere.ui/src/org/compiere/grid/CreateFromShipment.java @@ -659,10 +659,9 @@ public abstract class CreateFromShipment extends CreateFrom } // Set locator iol.setM_Locator_ID(M_Locator_ID); - if (!iol.save()) - log.log(Level.SEVERE, "Line NOT created #" + i); + iol.saveEx(); // Create Invoice Line Link - else if (il != null) + if (il != null) { il.setM_InOutLine_ID(iol.getM_InOutLine_ID()); il.saveEx(); diff --git a/org.compiere.db.oracle.provider/.project b/org.compiere.db.oracle.provider/.project index 69710cd8fc..a621e9102a 100644 --- a/org.compiere.db.oracle.provider/.project +++ b/org.compiere.db.oracle.provider/.project @@ -20,6 +20,11 @@ + + org.eclipse.pde.ds.core.builder + + + org.eclipse.pde.PluginNature diff --git a/org.compiere.db.oracle.provider/META-INF/MANIFEST.MF b/org.compiere.db.oracle.provider/META-INF/MANIFEST.MF index 688968629c..5c6f1fa615 100644 --- a/org.compiere.db.oracle.provider/META-INF/MANIFEST.MF +++ b/org.compiere.db.oracle.provider/META-INF/MANIFEST.MF @@ -13,4 +13,5 @@ Bundle-ClassPath: ., Import-Package: org.osgi.framework Bundle-ActivationPolicy: lazy Bundle-Activator: org.adempiere.db.oracle.OracleBundleActivator +Service-Component: OSGI-INF/oracleprovider.xml diff --git a/org.compiere.db.oracle.provider/OSGI-INF/oracleprovider.xml b/org.compiere.db.oracle.provider/OSGI-INF/oracleprovider.xml new file mode 100644 index 0000000000..a0cf86b2c3 --- /dev/null +++ b/org.compiere.db.oracle.provider/OSGI-INF/oracleprovider.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.compiere.db.oracle.provider/build.properties b/org.compiere.db.oracle.provider/build.properties index 55924b0fe7..23c5fd06c7 100644 --- a/org.compiere.db.oracle.provider/build.properties +++ b/org.compiere.db.oracle.provider/build.properties @@ -1,9 +1,9 @@ -source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ ojdbc6.jar,\ c3p0-0.9.1.2.jar,\ - c3p0-oracle-thin-extras-0.9.1.2.jar + c3p0-oracle-thin-extras-0.9.1.2.jar,\ + OSGI-INF/oracleprovider.xml source.. = src/ diff --git a/org.compiere.db.oracle.provider/plugin.xml b/org.compiere.db.oracle.provider/plugin.xml index 669443a88e..140cae4df1 100644 --- a/org.compiere.db.oracle.provider/plugin.xml +++ b/org.compiere.db.oracle.provider/plugin.xml @@ -1,13 +1,6 @@ - - - - + + org.eclipse.pde.ds.core.builder + + + org.eclipse.pde.PluginNature diff --git a/org.compiere.db.postgresql.provider/META-INF/MANIFEST.MF b/org.compiere.db.postgresql.provider/META-INF/MANIFEST.MF index c9881a031d..bc054b4408 100644 --- a/org.compiere.db.postgresql.provider/META-INF/MANIFEST.MF +++ b/org.compiere.db.postgresql.provider/META-INF/MANIFEST.MF @@ -14,3 +14,4 @@ Import-Package: junit.framework;version="3.8.2", org.osgi.framework Bundle-ActivationPolicy: lazy Bundle-Activator: org.adempiere.db.postgresql.PostgreSQLBundleActivator +Service-Component: OSGI-INF/pgprovider.xml diff --git a/org.compiere.db.postgresql.provider/OSGI-INF/pgprovider.xml b/org.compiere.db.postgresql.provider/OSGI-INF/pgprovider.xml new file mode 100644 index 0000000000..43984b4889 --- /dev/null +++ b/org.compiere.db.postgresql.provider/OSGI-INF/pgprovider.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.compiere.db.postgresql.provider/build.properties b/org.compiere.db.postgresql.provider/build.properties index 01efe18ca8..d295ed7d48 100644 --- a/org.compiere.db.postgresql.provider/build.properties +++ b/org.compiere.db.postgresql.provider/build.properties @@ -1,8 +1,8 @@ -source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ postgresql.jar,\ plugin.xml,\ - c3p0-0.9.1.2.jar + c3p0-0.9.1.2.jar,\ + OSGI-INF/pgprovider.xml source.. = src/ diff --git a/org.compiere.db.postgresql.provider/plugin.xml b/org.compiere.db.postgresql.provider/plugin.xml index e853c82e7a..b872eec66c 100644 --- a/org.compiere.db.postgresql.provider/plugin.xml +++ b/org.compiere.db.postgresql.provider/plugin.xml @@ -1,13 +1,6 @@ - - - -