Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent users from creating duplicate main prices #2510

Closed
metas-ts opened this issue Sep 20, 2017 · 1 comment
Closed

Prevent users from creating duplicate main prices #2510

metas-ts opened this issue Sep 20, 2017 · 1 comment

Comments

@metas-ts
Copy link
Member

Is this a bug or feature request?

Enhancement

What is the current behavior?

It does not make any sense from a functioal POV, but sues can create multiple "main prices".
A main price is a price without attributes, packagings etc.
It is for example used to get the default price UOM.

If a user creates two main prices for one PLV and product, they can do so, but later there will be DBMoreThenOneRecordsFoundExceptions

Which are the steps to reproduce?

E.g.

  • create two main prices
  • create a new sales order line with the respective product
  • select a subscription contract (C_Flatrate_Conditions)

=> fails with a DBMoreThenOneRecordsFoundException and one needs to look at the stacktrace and the exception's whereclause and params info to see wtf is going on
=> not to be excepted from a user who might have a customer on the phone right now :-)

What is the expected or desired behavior?

  • If a user enters a new main product and there is one already, throw an exception the user can understand
    • same if we hit a prexisting dublicate
  • But if there are somehow preexisting dublicates, then don't hassle the user if he/she tries to
    • deactivate one of them
    • add a not-main product
@metas-ts metas-ts self-assigned this Sep 20, 2017
metas-ts added a commit that referenced this issue Sep 20, 2017
* AbstractTrxManager: user wrapIfNeeded which can return a more specific
DBException subclass
* Trx: remove unneeded ifs
* TimeUtil and DBException: minor, see for yourself


Prevent users from creating duplicate main prices #2510
metas-ts added a commit that referenced this issue Sep 20, 2017
* Move ProductPriceQuery to the right package
* Add ProductPrices to contain static (convenience-)methods around
ProductPriceQuery
  * Add the assertion method to prevent duplicates
  * Add dedicated little exception with AD_Message to inform users about
the problem
* Add model interceptor M_ProductPrice to call the assertion method
* lots of minor changes due to the introduction of ProductPrices and
moving of static methods to it

Prevent users from creating duplicate main prices #2510
metas-ts added a commit that referenced this issue Sep 20, 2017
* ProductPriceQuery: remove one unused method
* ProductPrices.retrieveMainProductPriceIfExists: 
the optional was barely used, change it to ..OrNull
* TimeUtil: fix codacy issue

Prevent users from creating duplicate main prices #2510
metas-ts added a commit that referenced this issue Sep 20, 2017
Prevent users from creating duplicate main prices #2510
metas-ts added a commit that referenced this issue Sep 20, 2017
Prevent users from creating duplicate main prices #2510
@metas-ts metas-ts removed their assignment Sep 20, 2017
metas-ts added a commit that referenced this issue Sep 24, 2017
[#608](metasfresh/metasfresh-webui-api-legacy#608) CU
Quantity in Excel Export from HU Editor is wrong
[#2477](#2477)
Subscription Import Window Adjustments
[#588](metasfresh/metasfresh-webui-api-legacy#588)
Cloning Feature: Error when cloning BOM
[#2541](#2541) Allow
filtering by product group in window product
[#2538](#2538) Remove
legacy LDAP code
[#576](metasfresh/metasfresh-webui-api-legacy#576)
Implement batch entry for Sales/Purchase Invoice documents
[#2484](#2484) allow
using partner product numbers and name for entering order line
[#2502](#2502) Allow
multiple shipment schedules per orderline
[#2395](#2395) Drop
C_Flatrate_Conditions.IsNewTermCreatesOrder together with java code
[#2529](#2529) Import
System users
[#607](metasfresh/metasfresh-webui-api-legacy#607)
AD_Column.IsMandatory shall be overwritten by MandatoryLogic
[#2514](#2514) Support
importing multiline fields
[#603](metasfresh/metasfresh-webui-api-legacy#603)
Handle incorrect AD_Window_ID in URL
[#1167](metasfresh/metasfresh-webui-frontend-legacy#1167)
Edit Fields in Main Grid View
[#2146](#2146) Implement
Generic Multi Tags / labels for records
[#2501](#2501) Import
Requests
[#2510](#2510) Prevent
users from creating duplicate main prices
[#2344](#2344) Support
version 02 CAMT54 file
[#1197](metasfresh/metasfresh-webui-frontend-legacy#1197)
frontend: export view to excel
[#2482](#2482) Allow
disabling of model interceptors on the fly
[#1194](metasfresh/metasfresh-webui-frontend-legacy#1194)
Use API to fetch the locale
[#591](metasfresh/metasfresh-webui-api-legacy#591)
Filter by warehouse when selecting HUs to issue
[#593](metasfresh/metasfresh-webui-api-legacy#593)
Remove Clone action if not supported
[#2492](#2492) Process
C_Dunning_Candidate_Process fails
[#491](metasfresh/metasfresh-webui-api-legacy#491)
Wrong widget Type for Date-Range in Process Parameter

me-45
@metas-rc metas-rc self-assigned this Oct 3, 2017
@metas-rc
Copy link
Member

metas-rc commented Oct 3, 2017

Results of IT

  • OK: Duplicate main prices cannot be created
  • OK: Other kind of duplicate prices ( with attributes or handling units) are allowed.
  • OK: I get a human friendly error message when I try to save a duplicate in swing.
  • NOK: I get no message at all when I want to do it on webui, only that the entry is invalid. No other reason. I talked with Teo and he said the solution shall be related with this task so I added the case here: Problems on invalid entries saving metasfresh-webui-api-legacy#614

@metas-rc metas-rc closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants