Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0029422 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
feature request | [Openbravo ERP] 02. Master data management | minor | have not tried | 2015-03-26 10:22 | 2015-11-23 21:17 | |||
Reporter | rafademiguel | View Status | public | |||||
Assigned To | ebecerra | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | 797fabffe660 | ||||
Projection | none | ETA | none | Target Version | 3.0PR16Q1 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | vmromanos | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0029422: New option for Price List Schema Line: Fixed Price or Cost plus Margin Based | |||||||
Description | New option for Base List/Unit Price in Price List Schema Line: Fixed Price or Cost plus Margin Based Rules for prices calculation - If the set fixed List/Unit price is higher than the current cost plus List/unit Price margin, the price list will be created with the fixed price - If the set fixed List/Unit price is lower than the current cost plus List/Unit Price margin, then price list will be created using the cost plus the margin. | |||||||
Steps To Reproduce | No | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() diff --git a/src-db/database/model/functions/M_PRICELIST_CREATE.xml b/src-db/database/model/functions/M_PRICELIST_CREATE.xml --- a/src-db/database/model/functions/M_PRICELIST_CREATE.xml +++ b/src-db/database/model/functions/M_PRICELIST_CREATE.xml @@ -93,6 +93,7 @@ DBMS_OUTPUT.PUT_LINE('*** Unknown Parameter=' || Cur_Parameter.ParameterName) ; END IF; END LOOP; -- Get Parameter + -- Checks if instance is migrated to new cost engine SELECT count(1) INTO v_isCostMigrated FROM DUAL @@ -522,22 +523,25 @@ ) ; ELSE - UPDATE M_ProductPrice + UPDATE M_ProductPrice SET PriceList=ROUND(( CASE Cur_DiscountLine.List_Base WHEN 'C' THEN PriceList*(1+Cur_DiscountLine.LIST_MARGIN/100) WHEN 'FC' THEN CASE WHEN Cur_DiscountLine.List_Fixed >= PriceList THEN Cur_DiscountLine.List_Fixed ELSE PriceList*(1+Cur_DiscountLine.LIST_MARGIN/100) END + WHEN 'FCM' THEN CASE WHEN Cur_DiscountLine.List_Fixed >= PriceList*(1+Cur_DiscountLine.LIST_MARGIN/100) THEN Cur_DiscountLine.List_Fixed ELSE PriceList*(1+Cur_DiscountLine.LIST_MARGIN/100) END ELSE PriceList END ), v_StdPrecision), PriceStd=ROUND(( CASE Cur_DiscountLine.Std_Base WHEN 'C' THEN PriceStd*(1+Cur_DiscountLine.STD_MARGIN/100) WHEN 'FC' THEN CASE WHEN Cur_DiscountLine.Std_Fixed >= PriceStd THEN Cur_DiscountLine.Std_Fixed ELSE PriceStd*(1+Cur_DiscountLine.STD_MARGIN/100) END + WHEN 'FCM' THEN CASE WHEN Cur_DiscountLine.Std_Fixed >= PriceStd*(1+Cur_DiscountLine.STD_MARGIN/100) THEN Cur_DiscountLine.Std_Fixed ELSE PriceStd*(1+Cur_DiscountLine.STD_MARGIN/100) END ELSE PriceStd END ), v_StdPrecision), PriceLimit=ROUND(( CASE Cur_DiscountLine.Limit_Base WHEN 'C' THEN PriceLimit*(1+Cur_DiscountLine.LIMIT_MARGIN/100) WHEN 'FC' THEN CASE WHEN Cur_DiscountLine.List_Fixed >= PriceLimit THEN Cur_DiscountLine.Limit_Fixed ELSE PriceLimit*(1+Cur_DiscountLine.LIST_MARGIN/100) END + WHEN 'FCM' THEN CASE WHEN Cur_DiscountLine.List_Fixed >= PriceLimit*(1+Cur_DiscountLine.LIST_MARGIN/100) THEN Cur_DiscountLine.Limit_Fixed ELSE PriceLimit*(1+Cur_DiscountLine.LIST_MARGIN/100) END ELSE PriceLimit END ), v_StdPrecision), diff --git a/src-db/database/sourcedata/AD_FIELD.xml b/src-db/database/sourcedata/AD_FIELD.xml --- a/src-db/database/sourcedata/AD_FIELD.xml +++ b/src-db/database/sourcedata/AD_FIELD.xml @@ -63486,7 +63486,7 @@ <!--5255--> <AD_COLUMN_ID><![CDATA[6628]]></AD_COLUMN_ID> <!--5255--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5255--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5255--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @List_Base@!'F' & @List_Base@!'C' & @List_Base@!'FC']]></DISPLAYLOGIC> +<!--5255--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @List_Base@!'F' & @List_Base@!'C' & @List_Base@!'FC' & @List_Base@!'FCM']]></DISPLAYLOGIC> <!--5255--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5255--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5255--> <SEQNO><![CDATA[90]]></SEQNO> @@ -63516,7 +63516,7 @@ <!--5256--> <AD_COLUMN_ID><![CDATA[6629]]></AD_COLUMN_ID> <!--5256--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5256--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5256--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @List_Base@!'F' & @List_Base@!'C' & @List_Base@!'FC']]></DISPLAYLOGIC> +<!--5256--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @List_Base@!'F' & @List_Base@!'C' & @List_Base@!'FC' & @List_Base@!'FCM']]></DISPLAYLOGIC> <!--5256--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5256--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5256--> <SEQNO><![CDATA[100]]></SEQNO> @@ -63665,7 +63665,7 @@ <!--5261--> <AD_COLUMN_ID><![CDATA[6634]]></AD_COLUMN_ID> <!--5261--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5261--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5261--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @Std_Base@!'F' & @Std_Base@!'C' & @Std_Base@!'FC']]></DISPLAYLOGIC> +<!--5261--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @Std_Base@!'F' & @Std_Base@!'C' & @Std_Base@!'FC' & @Std_Base@!'FCM']]></DISPLAYLOGIC> <!--5261--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5261--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5261--> <SEQNO><![CDATA[180]]></SEQNO> @@ -63695,7 +63695,7 @@ <!--5262--> <AD_COLUMN_ID><![CDATA[6635]]></AD_COLUMN_ID> <!--5262--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5262--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5262--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @Std_Base@!'F' & @Std_Base@!'C' & @Std_Base@!'FC']]></DISPLAYLOGIC> +<!--5262--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & @Std_Base@!'F' & @Std_Base@!'C' & @Std_Base@!'FC' & @Std_Base@!'FCM']]></DISPLAYLOGIC> <!--5262--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5262--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5262--> <SEQNO><![CDATA[190]]></SEQNO> @@ -65183,7 +65183,7 @@ <!--5349--> <AD_COLUMN_ID><![CDATA[6715]]></AD_COLUMN_ID> <!--5349--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5349--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5349--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@List_Base@='F' | @List_Base@='FC')]]></DISPLAYLOGIC> +<!--5349--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@List_Base@='F' | @List_Base@='FC' | @List_Base@='FCM')]]></DISPLAYLOGIC> <!--5349--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5349--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5349--> <SEQNO><![CDATA[110]]></SEQNO> @@ -65213,7 +65213,7 @@ <!--5350--> <AD_COLUMN_ID><![CDATA[6716]]></AD_COLUMN_ID> <!--5350--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--5350--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--5350--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@Std_Base@='F' | @Std_Base@='FC')]]></DISPLAYLOGIC> +<!--5350--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@Std_Base@='F' | @Std_Base@='FC' | @Std_Base@='FCM')]]></DISPLAYLOGIC> <!--5350--> <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH> <!--5350--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--5350--> <SEQNO><![CDATA[170]]></SEQNO> @@ -275697,7 +275697,7 @@ <!--C3DA0880F565707CE040007F01003707--> <AD_COLUMN_ID><![CDATA[C3DA0880F54C707CE040007F01003707]]></AD_COLUMN_ID> <!--C3DA0880F565707CE040007F01003707--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--C3DA0880F565707CE040007F01003707--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--C3DA0880F565707CE040007F01003707--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@List_Base@='C' | @List_Base@='FC')]]></DISPLAYLOGIC> +<!--C3DA0880F565707CE040007F01003707--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@List_Base@='C' | @List_Base@='FC' | @List_Base@='FCM')]]></DISPLAYLOGIC> <!--C3DA0880F565707CE040007F01003707--> <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH> <!--C3DA0880F565707CE040007F01003707--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--C3DA0880F565707CE040007F01003707--> <SEQNO><![CDATA[150]]></SEQNO> @@ -275724,7 +275724,7 @@ <!--C3DA0880F566707CE040007F01003707--> <AD_COLUMN_ID><![CDATA[C3DA0880F54D707CE040007F01003707]]></AD_COLUMN_ID> <!--C3DA0880F566707CE040007F01003707--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--C3DA0880F566707CE040007F01003707--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> -<!--C3DA0880F566707CE040007F01003707--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@Std_Base@='C' | @Std_Base@='FC')]]></DISPLAYLOGIC> +<!--C3DA0880F566707CE040007F01003707--> <DISPLAYLOGIC><![CDATA[@DiscountType@='P' & (@Std_Base@='C' | @Std_Base@='FC' | @Std_Base@='FCM')]]></DISPLAYLOGIC> <!--C3DA0880F566707CE040007F01003707--> <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH> <!--C3DA0880F566707CE040007F01003707--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--C3DA0880F566707CE040007F01003707--> <SEQNO><![CDATA[230]]></SEQNO> diff --git a/src-db/database/sourcedata/AD_REF_LIST.xml b/src-db/database/sourcedata/AD_REF_LIST.xml --- a/src-db/database/sourcedata/AD_REF_LIST.xml +++ b/src-db/database/sourcedata/AD_REF_LIST.xml @@ -8252,6 +8252,17 @@ <!--137FAE2E0B2E41CB901067BC77E37EE7--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--137FAE2E0B2E41CB901067BC77E37EE7--></AD_REF_LIST> +<!--13BE42BFDE6448F1A8B1A179E17D3018--><AD_REF_LIST> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <AD_REF_LIST_ID><![CDATA[13BE42BFDE6448F1A8B1A179E17D3018]]></AD_REF_LIST_ID> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <VALUE><![CDATA[FCM]]></VALUE> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <NAME><![CDATA[Fixed Price or Cost plus Margin Based]]></NAME> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <AD_REFERENCE_ID><![CDATA[194]]></AD_REFERENCE_ID> +<!--13BE42BFDE6448F1A8B1A179E17D3018--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--13BE42BFDE6448F1A8B1A179E17D3018--></AD_REF_LIST> + <!--146E194904144669A27BEDDB0D79C47B--><AD_REF_LIST> <!--146E194904144669A27BEDDB0D79C47B--> <AD_REF_LIST_ID><![CDATA[146E194904144669A27BEDDB0D79C47B]]></AD_REF_LIST_ID> <!--146E194904144669A27BEDDB0D79C47B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff --git a/src-db/database/sourcedata/M_OFFER_TYPE.xml b/src-db/database/sourcedata/M_OFFER_TYPE.xml --- a/src-db/database/sourcedata/M_OFFER_TYPE.xml +++ b/src-db/database/sourcedata/M_OFFER_TYPE.xml @@ -8,6 +8,7 @@ <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--> <NAME><![CDATA[Price Adjustment]]></NAME> <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--> <PL_ORDER_IMPLEMENTOR><![CDATA[M_Promotion_Adjustment]]></PL_ORDER_IMPLEMENTOR> +<!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--> <EM_OBPOS_ISCATEGORY><![CDATA[N]]></EM_OBPOS_ISCATEGORY> <!--5D4BAF6BB86D4D2C9ED3D5A6FC051579--></M_OFFER_TYPE> </data> ![]() ![]() # HG changeset patch # User Alberto Santos <alberto.santos@openbravo.com> # Date 1446649276 -3600 # miƩ nov 04 16:01:16 2015 +0100 # Node ID 5c82f2e51e3c4a16793aa54b51cfebd10469d6c8 # Parent 8ed7fce0f028fe3fa057611c544699fae53da875 Modify files to implement automatic test diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/PriceListData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/PriceListData.java --- a/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/PriceListData.java +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelist/PriceListData.java @@ -74,6 +74,20 @@ } /** + * Set the costBasedPriceList value + * + * Description: This is a Price List Based on Cost + * + * @param value + * The costBasedPriceList value. + * @return The builder for this class. + */ + public Builder costBasedPriceList(Boolean value) { + this.dataFields.put("costBasedPriceList", value); + return this; + } + + /** * Set the currency value * * Description: An accepted medium of monetary exchange that may vary across countries. diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelistschema/PriceListSchemaLinesData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelistschema/PriceListSchemaLinesData.java --- a/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelistschema/PriceListSchemaLinesData.java +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/pricing/pricelistschema/PriceListSchemaLinesData.java @@ -160,6 +160,34 @@ } /** + * Set the listPriceDiscount value + * + * Description: Discount from list price as a percentage + * + * @param value + * The listPriceDiscount value. + * @return The builder for this class. + */ + public Builder listPriceMargin(String value) { + this.dataFields.put("listPriceMargin", value); + return this; + } + + /** + * Set the unitPriceDiscount value + * + * Description: Discount from unit price as a percentage + * + * @param value + * The unitPriceDiscount value. + * @return The builder for this class. + */ + public Builder unitPriceMargin(String value) { + this.dataFields.put("unitPriceMargin", value); + return this; + } + + /** * Set the surchargeListPriceAmount value * * Description: List Price Surcharge Amount diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListVersionTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListVersionTab.java --- a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListVersionTab.java +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListVersionTab.java @@ -50,6 +50,7 @@ */ public PriceListVersionTab(GeneratedTab<?> parentTab) { super(TITLE, IDENTIFIER, LEVEL, parentTab); + addChildTab(new ProductPriceTab(this)); } /** diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListWindow.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListWindow.java --- a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListWindow.java +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/PriceListWindow.java @@ -72,4 +72,13 @@ public PriceListVersionTab selectPriceListVersionTab() { return (PriceListVersionTab) selectTab(PriceListVersionTab.IDENTIFIER); } + + /** + * Select and return the Product Price tab. + * + * @return the Product Price tab. + */ + public ProductPriceTab selectProductPriceTab() { + return (ProductPriceTab) selectTab(ProductPriceTab.IDENTIFIER); + } } diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/ProductPriceTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/ProductPriceTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/ProductPriceTab.java @@ -0,0 +1,78 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2012 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Leo Arias <leo.arias@openbravo.com>. + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.gui.masterdata.pricing.pricelist; + +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelist.ProductPriceData; +import com.openbravo.test.integration.erp.modules.client.application.gui.GeneratedTab; +import com.openbravo.test.integration.erp.modules.client.application.gui.OBClassicPopUp; +import com.openbravo.test.integration.erp.modules.client.application.gui.TestRegistry; +import com.openbravo.test.integration.erp.modules.userinterface.smartclient.gui.Button; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTestException; +import com.openbravo.test.integration.selenium.SeleniumSingleton; +import com.openbravo.test.integration.selenium.Sleep; + +/** + * Executes and verifies actions on OpenbravoERP Product Price tab. + * + * @author ASA + * + */ +public class ProductPriceTab extends GeneratedTab<ProductPriceData> { + + /** The tab title. */ + static final String TITLE = "Product Price"; + /** The tab identifier. */ + static final String IDENTIFIER = "192"; + /** The tab level. */ + private static final int LEVEL = 2; + + /** + * Class constructor + * + */ + public ProductPriceTab(GeneratedTab<?> parentTab) { + super(TITLE, IDENTIFIER, LEVEL, parentTab); + } + + /** + * Process the transaction + * + * @throws OpenbravoERPTestException + */ + public void process() throws OpenbravoERPTestException { + final Button buttonCreateProductPrice = new Button( + TestRegistry.getObjectString("org.openbravo.client.application.toolbar.button.create.192")); + buttonCreateProductPrice.click(); + + final OBClassicPopUp createPeriods = new OBClassicPopUp( + TestRegistry + .getObjectString("org.openbravo.classicpopup./PriceList/ProductPrice_Edition.html")); + createPeriods.selectPopUpWithOKButton(); + createPeriods.clickOK(); + SeleniumSingleton.INSTANCE.switchTo().defaultContent(); + + // FIXME: This message is failing very often for Discount Price List + // // TODO: Check why sometimes is not checking properly the message. + Sleep.trySleep(); + // + // waitUntilMessageVisible(); + } +} diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/classic/ProductPriceTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/classic/ProductPriceTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/pricing/pricelist/classic/ProductPriceTab.java @@ -0,0 +1,47 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2012 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Leo Arias <leo.arias@openbravo.com>. + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.gui.masterdata.pricing.pricelist.classic; + +import com.openbravo.test.integration.erp.gui.tabs.GeneratedTab; + +/** + * Executes and verifies actions on OpenbravoERP Price List Version tab. + * + * @author elopio + * + */ +public class ProductPriceTab extends GeneratedTab { + + /** The tab title. */ + static final String TITLE = "Product Price"; + /** The tab level. */ + private static final int LEVEL = 2; + /** Identifier of the Product Price tab. */ + public static final String TAB = "tabname192"; + + /** + * Class constructor + * + */ + public ProductPriceTab() { + super(TITLE, LEVEL, TAB); + } +} diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceList.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceList.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceList.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceList.java @@ -104,6 +104,23 @@ } } + /** + * Execute the process that creates the Price List. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @throws OpenbravoERPTestException + */ + public static void select(MainPage mainPage, PriceListVersionData priceListVersionData) + throws OpenbravoERPTestException { + if (mainPage.isOnNewLayout()) { + PriceListVersionScript.select(mainPage, priceListVersionData); + } else { + PriceListVersionClassicScript.select(mainPage, priceListVersionData); + } + } } /** @@ -112,7 +129,7 @@ * @author plujan * */ - public static class ProductPrice { + public static class ProductPriceTab { public static void verify(MainPage mainPage, ProductPriceData productPriceData) { if (mainPage.isOnNewLayout()) { @@ -121,5 +138,14 @@ ProductPriceClassicScript.verify(mainPage, productPriceData); } } + + public static void select(MainPage mainPage, ProductPriceData productPriceData) + throws OpenbravoERPTestException { + if (mainPage.isOnNewLayout()) { + ProductPriceScript.select(mainPage, productPriceData); + } else { + ProductPriceClassicScript.select(mainPage, productPriceData); + } + } } } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionClassicScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionClassicScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionClassicScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionClassicScript.java @@ -75,4 +75,8 @@ priceListWindow.verifyProcessCompletedSuccessfully(); } + static void select(MainPage mainPage, PriceListVersionData priceListVersionData) { + throw new UnsupportedOperationException(); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/PriceListVersionScript.java @@ -73,4 +73,21 @@ // priceListVersionTab.assertProcessCompletedSuccessfully(); } + /** + * Execute the process that creates the Price List. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @throws OpenbravoERPTestException + */ + static void select(MainPage mainPage, PriceListVersionData data) throws OpenbravoERPTestException { + final PriceListWindow priceListWindow = (PriceListWindow) mainPage + .getView(PriceListWindow.TITLE); + + final PriceListVersionTab priceListVersionTab = priceListWindow.selectPriceListVersionTab(); + priceListVersionTab.select(data); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceClassicScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceClassicScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceClassicScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceClassicScript.java @@ -10,4 +10,9 @@ throw new UnsupportedOperationException(); } + public static void select(MainPage mainPage, ProductPriceData productPriceData) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException(); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelist/ProductPriceScript.java @@ -1,13 +1,27 @@ package com.openbravo.test.integration.erp.testscripts.masterdata.pricing.pricelist; import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelist.ProductPriceData; +import com.openbravo.test.integration.erp.gui.masterdata.pricing.pricelist.PriceListWindow; +import com.openbravo.test.integration.erp.gui.masterdata.pricing.pricelist.ProductPriceTab; import com.openbravo.test.integration.erp.modules.client.application.gui.MainPage; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTestException; public class ProductPriceScript { public static void verify(MainPage mainPage, ProductPriceData productPriceData) { - // TODO Auto-generated method stub - throw new UnsupportedOperationException(); + final PriceListWindow productPriceWindow = (PriceListWindow) mainPage + .getView(PriceListWindow.TITLE); + + final ProductPriceTab productPriceTab = productPriceWindow.selectProductPriceTab(); + productPriceTab.assertData(productPriceData); + } + + static void select(MainPage mainPage, ProductPriceData data) throws OpenbravoERPTestException { + final PriceListWindow priceListWindow = (PriceListWindow) mainPage + .getView(PriceListWindow.TITLE); + + final ProductPriceTab productPriceTab = priceListWindow.selectProductPriceTab(); + productPriceTab.select(data); } } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchema.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchema.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchema.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchema.java @@ -58,6 +58,24 @@ PriceListSchemaHeaderClassicScript.create(mainPage, priceListSchemaHeaderData); } } + + /** + * Select the record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param priceListSchemaHeaderData + * Price List Schema Header data. + */ + public static void select(MainPage mainPage, PriceListSchemaHeaderData priceListSchemaHeaderData) { + if (mainPage.isOnNewLayout()) { + PriceListSchemaHeaderScript.select(mainPage, priceListSchemaHeaderData); + } else { + PriceListSchemaHeaderClassicScript.select(mainPage, priceListSchemaHeaderData); + } + } } /** diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderClassicScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderClassicScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderClassicScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderClassicScript.java @@ -53,4 +53,18 @@ headerTab.verifySave(); } + /** + * Select a record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param priceListSchemaHeaderData + * The data of the record that will be created. + */ + static void select(MainPage mainPage, PriceListSchemaHeaderData priceListSchemaHeaderData) { + throw new UnsupportedOperationException(); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/pricing/pricelistschema/PriceListSchemaHeaderScript.java @@ -53,4 +53,22 @@ headerTab.assertSaved(); } + /** + * Select a record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param priceListSchemaHeaderData + * The data of the record that will be created. + */ + static void select(MainPage mainPage, PriceListSchemaHeaderData priceListSchemaHeaderData) { + PriceListSchemaWindow priceListSchemaWindow = new PriceListSchemaWindow(); + mainPage.openView(priceListSchemaWindow); + + HeaderTab headerTab = priceListSchemaWindow.selectHeaderTab(); + headerTab.select(priceListSchemaHeaderData); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testsuites/smoke/pricelistmanagement/PRIa_FixedPriceOrCostPlusMarginBased.java b/src-test/com/openbravo/test/integration/erp/testsuites/smoke/pricelistmanagement/PRIa_FixedPriceOrCostPlusMarginBased.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/testsuites/smoke/pricelistmanagement/PRIa_FixedPriceOrCostPlusMarginBased.java @@ -0,0 +1,170 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2012 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Pablo Lujan <plu@openbravo.com>. + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.testsuites.smoke.pricelistmanagement; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collection; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import com.openbravo.test.integration.erp.data.LogInData; +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelist.PriceListData; +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelist.PriceListVersionData; +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelist.ProductPriceData; +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelistschema.PriceListSchemaHeaderData; +import com.openbravo.test.integration.erp.data.masterdata.pricing.pricelistschema.PriceListSchemaLinesData; +import com.openbravo.test.integration.erp.data.selectors.ProductCompleteSelectorData; +import com.openbravo.test.integration.erp.data.selectors.ProductSelectorData; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTestException; +import com.openbravo.test.integration.erp.testscripts.masterdata.pricing.pricelist.PriceList; +import com.openbravo.test.integration.erp.testscripts.masterdata.pricing.pricelistschema.PriceListSchema; + +/** + * Execute the Setup User and Role flow of the smoke test suite. + * + * @author Alberto Santos + */ +@RunWith(Parameterized.class) +public class PRIa_FixedPriceOrCostPlusMarginBased extends OpenbravoERPTest { + + /** Log4j logger for this class. */ + private static Logger logger = Logger.getLogger(PRIa_FixedPriceOrCostPlusMarginBased.class); + + /* Data for this test. */ + private PriceListSchemaHeaderData priceListSchemaHeaderStandardData; + private PriceListSchemaLinesData priceListSchemaLinesLaptopData; + private PriceListSchemaLinesData priceListSchemaLinesSoccerBallData; + + private PriceListData priceListData; + private PriceListVersionData priceListVersionTestData; + private PriceListVersionData priceListVersionTestDateData; + private ProductPriceData productPriceLaptopData; + private ProductPriceData productPriceSoccerBallData; + private ProductPriceData productPriceLaptopDataSelect; + private ProductPriceData productPriceSoccerBallDataSelect; + + /** + * Class constructor. + */ + public PRIa_FixedPriceOrCostPlusMarginBased( + PriceListSchemaHeaderData priceListSchemaHeaderStandardData, + PriceListSchemaLinesData priceListSchemaLinesLaptopData, + PriceListSchemaLinesData priceListSchemaLinesSoccerBallData, PriceListData priceListData, + PriceListVersionData priceListVersionTestData, + PriceListVersionData priceListVersionTestDateData, ProductPriceData productPriceLaptopData, + ProductPriceData productPriceSoccerBallData, ProductPriceData productPriceLaptopDataSelect, + ProductPriceData productPriceSoccerBallDataSelect) { + + this.priceListSchemaHeaderStandardData = priceListSchemaHeaderStandardData; + this.priceListSchemaLinesLaptopData = priceListSchemaLinesLaptopData; + this.priceListSchemaLinesSoccerBallData = priceListSchemaLinesSoccerBallData; + this.priceListData = priceListData; + this.priceListVersionTestData = priceListVersionTestData; + this.priceListVersionTestDateData = priceListVersionTestDateData; + this.productPriceLaptopData = productPriceLaptopData; + this.productPriceSoccerBallData = productPriceSoccerBallData; + this.productPriceLaptopDataSelect = productPriceLaptopDataSelect; + this.productPriceSoccerBallDataSelect = productPriceSoccerBallDataSelect; + + logInData = new LogInData.Builder().userName("QAAdmin").password("QAAdmin").build(); + } + + /** + * Test parameters. + * + * @return collection of object arrays with data for the test + * @throws IOException + * + */ + @Parameters + public static Collection<Object[]> setupProductValues() throws IOException { + Calendar date = Calendar.getInstance(); + int day = date.get(Calendar.DAY_OF_MONTH); + int month = date.get(Calendar.MONTH) + 1; + int year = date.get(Calendar.YEAR); + String currentDate = day + "-" + month + "-" + year; + return Arrays.asList(new Object[][] { { + + // Create Pricelist Schema Standard + new PriceListSchemaHeaderData.Builder().name("Standard").build(), + new PriceListSchemaLinesData.Builder().productCategory("Distribution Goods") + .product(new ProductSelectorData.Builder().name("Laptop").build()) + .baseListPrice("Fixed Price or Cost plus Margin Based").fixedListPrice("15.00") + .listPriceMargin("15").standardBasePrice("Fixed Price or Cost plus Margin Based") + .fixedStandardPrice("0.00").unitPriceMargin("0").build(), + new PriceListSchemaLinesData.Builder().productCategory("Distribution Goods") + .product(new ProductSelectorData.Builder().name("Soccer Ball").build()) + .baseListPrice("Fixed Price or Cost plus Margin Based").fixedListPrice("10.00") + .listPriceMargin("10").standardBasePrice("Fixed Price or Cost plus Margin Based") + .fixedStandardPrice("0.00").unitPriceMargin("0").build(), + + // Create Pricelist + new PriceListData.Builder().name("test").salesPriceList(true).currency("EUR") + .costBasedPriceList(true).build(), + new PriceListVersionData.Builder().name("test").priceListSchema("Standard").build(), + new PriceListVersionData.Builder().name("test " + currentDate).priceListSchema("Standard") + .basePriceListVersion("test").build(), + new ProductPriceData.Builder() + .product(new ProductCompleteSelectorData.Builder().name("Laptop").build()) + .standardPrice("10.00").listPrice("15.00").build(), + new ProductPriceData.Builder() + .product(new ProductCompleteSelectorData.Builder().name("Soccer Ball").build()) + .standardPrice("10.00").listPrice("11.00").build(), + new ProductPriceData.Builder().product( + new ProductCompleteSelectorData.Builder().name("Laptop").build()).build(), + new ProductPriceData.Builder().product( + new ProductCompleteSelectorData.Builder().name("Soccer Ball").build()).build() } }); + } + + /** + * Test the setup client and organization flow. + * + * @throws IOException + * @throws OpenbravoERPTestException + */ + @Test + public void FixedOrCostPlusMarginPrice() throws IOException, OpenbravoERPTestException { + logger.info("** Start of test case [PRIa]Create pricelist schema **"); + PriceListSchema.Header.select(mainPage, priceListSchemaHeaderStandardData); + PriceListSchema.Lines.create(mainPage, priceListSchemaLinesLaptopData); + PriceListSchema.Lines.create(mainPage, priceListSchemaLinesSoccerBallData); + logger.info("** End of test case [PRIa]Create pricelist schema **"); + + logger.info("** Start of test case [PRIa] Create Pricelist **"); + PriceList.PriceListTab.create(mainPage, priceListData); + PriceList.PriceListVersionTab.create(mainPage, priceListVersionTestData); + PriceList.PriceListVersionTab.processCreatePricelist(mainPage); + PriceList.PriceListVersionTab.create(mainPage, priceListVersionTestDateData); + PriceList.PriceListVersionTab.processCreatePricelist(mainPage); + PriceList.ProductPriceTab.select(mainPage, productPriceLaptopDataSelect); + PriceList.ProductPriceTab.verify(mainPage, productPriceLaptopData); + PriceList.ProductPriceTab.select(mainPage, productPriceSoccerBallDataSelect); + PriceList.ProductPriceTab.verify(mainPage, productPriceSoccerBallData); + logger.info("** End of test case [PRIa] Create Pricelist **"); + } +} | |||||||
![]() |
|
![]() |
|
(0081626) hgbot (developer) 2015-11-09 16:06 |
Repository: erp/devel/pi Changeset: 797fabffe660b62e5f304477e6fcf00d17460b0d Author: Alberto Santos <alberto.santos <at> openbravo.com> Date: Mon Nov 09 16:06:16 2015 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/797fabffe660b62e5f304477e6fcf00d17460b0d [^] Fixed issue 29422.Adds Fixed price or Cost plus margin. --- M src-db/database/model/functions/M_PRICELIST_CREATE.xml M src-db/database/sourcedata/AD_FIELD.xml M src-db/database/sourcedata/AD_REF_LIST.xml --- |
(0081691) vmromanos (viewer) 2015-11-11 11:18 |
Code review + testing OK |
(0081692) vmromanos (viewer) 2015-11-11 11:18 |
https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-9878 [^] |
(0082189) hudsonbot (viewer) 2015-11-23 21:17 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2015-03-26 10:22 | ebecerra | New Issue | |
2015-03-26 10:22 | ebecerra | Assigned To | => Sandrahuguet |
2015-03-26 10:22 | ebecerra | OBNetwork customer | => No |
2015-03-26 10:22 | ebecerra | Modules | => Core |
2015-03-26 10:22 | ebecerra | Triggers an Emergency Pack | => No |
2015-03-26 10:30 | rafademiguel | Review Assigned To | => Sandrahuguet |
2015-03-26 10:30 | rafademiguel | Reporter | ebecerra => rafademiguel |
2015-03-26 10:30 | rafademiguel | Assigned To | Sandrahuguet => ebecerra |
2015-03-26 10:30 | rafademiguel | Target Version | => 3.0PR15Q3 |
2015-03-26 10:32 | rafademiguel | Review Assigned To | Sandrahuguet => gorkaion |
2015-06-29 13:17 | psarobe | Target Version | 3.0PR15Q3 => |
2015-06-30 12:14 | ebecerra | File Added: FixedPrice_or_CostplusMarginBased.diff | |
2015-10-20 10:51 | Asantos9 | File Added: issue29422.export | |
2015-11-06 10:02 | vmromanos | Review Assigned To | gorkaion => vmromanos |
2015-11-06 10:02 | vmromanos | Target Version | => 3.0PR16Q1 |
2015-11-06 12:54 | Asantos9 | File Added: AutomatedTestFixedOrCostPlusMarginPrice.patch | |
2015-11-09 16:06 | hgbot | Checkin | |
2015-11-09 16:06 | hgbot | Note Added: 0081626 | |
2015-11-09 16:06 | hgbot | Status | new => resolved |
2015-11-09 16:06 | hgbot | Resolution | open => fixed |
2015-11-09 16:06 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/797fabffe660b62e5f304477e6fcf00d17460b0d [^] |
2015-11-11 11:18 | vmromanos | Note Added: 0081691 | |
2015-11-11 11:18 | vmromanos | Status | resolved => closed |
2015-11-11 11:18 | vmromanos | Note Added: 0081692 | |
2015-11-23 21:17 | hudsonbot | Checkin | |
2015-11-23 21:17 | hudsonbot | Note Added: 0082189 |
Copyright © 2000 - 2009 MantisBT Group |