Skip to content

Fixes ISSUE-55392: Eco-contribution: Calculation based on multiplicator

Frank González requested to merge openbravo/devel/openbravo:fr/55392 into master

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
  • M - "By product multiplicator"

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

Jira: RM-13093

Mantis: 55392

MRs:

Docs:

Testing Performed

Edited by Frank González

Merge request reports