Fixes ISSUE-55392: Eco-contribution: Calculation based on multiplicator
Overview
This development adds a new way to calculate the price of Contributions as well as extending the Product API. Services and Contributions information can now be seen from their related product of type Item (currently only for records created via the "Relate Products" process).
What's New
Application Dictionary
New & Modified Tables and Columns
M_ProductRelation
A record in Tables and Columns has been created for viewing ServiceProduct records from the the related main product with the following configuration:
Table Name |
Data Origin |
Data Package |
Data Access Level |
Query |
---|---|---|---|---|
M_ProductRelation | HQL Query | org.openbravo.model.ad.access | Organization |
select distinct sp.id as id, sp.organization as organization, sp.product, sp.relatedProduct, p.searchKey as searchKey, p.name as name, p.productType as productType, sp.multiplicator as multiplicator from ServiceProduct sp join sp.product as p where @additional_filters@ |
Column Name | DB Column | Reference |
---|---|---|
Related Product | relatedProduct | OBUISEL_Selector Reference |
Multiplicator | multiplicator | Number |
Organization | organization | OBUISEL_Selector Reference |
Product | product | OBUISEL_Selector Reference |
Product Type | productType | List |
Name | name | String |
Search Key | searchKey | String |
ID | id | ID |
ServiceProduct & ServiceProductCategory
A foreign-key column in both ServiceProduct and ServiceProductCategory has been set as "Child Property in Parent Entity" in order to create a one-to-many mapping from the Product entity:
Table | DB Column Name | Parent Entity | Path from Product |
---|---|---|---|
ServiceProduct | M_Related_Product_ID | Product | serviceProductMRelatedProductIDList |
ServiceProductCategory | M_Product_Category_ID | Product Category | productCategory.serviceProductCategoryList |
A new column used for contribution price calculation has also been added with the following values:
Column Name | DB Column | Reference |
---|---|---|
Multiplicator | multiplicator | Number |
New & Modified Windows, Tabs, and Fields
Related Services and Contributions
A tab has been created in the Product window for the viewing records from the M_ProductRelation table with the following elements:
Tab Name | Table | UI Pattern | Tab Level |
---|---|---|---|
Related Services and Contributions | M_ProductRelation | Read Only | 1 |
Field Name | DB Column | Sequence Number | Displayed |
---|---|---|---|
Organization | organization | 10 | Yes |
Search Key | searchKey | 20 | Yes |
Name | name | 30 | Yes |
Product Type | productType | 50 | Yes |
Multiplicator | multiplicator | 70 | Yes |
serviceProductId | id | 100 | No |
Related Products & Related Product Categories
The Related Products and Related Product Categories tabs have been modified by making the "Organization through the addition of the "Multiplicator" field.
New & Modified References
A new list reference value have been created with the following data:
List Name | Values |
---|---|
Product Subtype Price Calculation |
|
Data Model
M_PRODUCT_SERVICE and M_PRODUCT_SERVICE_CATEGORY
The ServiceProduct and ServiceProductCategory model definitions have been changed with the addition of the following element:
Column Name | Required | Type | Default |
---|---|---|---|
MULTIPLICATOR | N | NUMERIC | 1 |
Links
RM-13093
Jira:55392
Mantis:MRs:
- Core: !1229 (closed)
- WebPOS: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1561/
- WebPOS2: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2618/
- Business API: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/269/
- WebPOS Sampledata: https://gitlab.com/openbravo/ci/modules/org.openbravo.test.mobile.sampledata/-/merge_requests/138/
- Retail Sampledata: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sampledata/-/merge_requests/100/
- Retail Automatic Tests Sampledata: https://gitlab.com/openbravo/ci/modules/org.openbravo.retail.testsampledata/-/merge_requests/96/
- Business API Tests: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/merge_requests/67