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

#3462 [Bug Report] Total matched invoice qty https://github.com/ademp… #3464

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

e-Evolution
Copy link
Contributor

…iere/adempiere/issues/3462

@e-Evolution e-Evolution added this to the 3.9.4 milestone May 21, 2021
@e-Evolution e-Evolution self-assigned this May 21, 2021
@e-Evolution e-Evolution linked an issue May 21, 2021 that may be closed by this pull request
+ "WHERE io.M_InOut_ID = M_InOutLine.M_InOut_ID "
+ "AND io.DocStatus IN ('CO','CL'))";
MInOutLine[] inOutLines = MInOutLine.getOfOrderLine(Env.getCtx(), key, whereClause, get_TrxName());
log.fine ("Receipt Lines with OrderLine = #" + inOutLines.length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code allows allocate receipt from order when a order have receipt allocated.

How to think you resolve this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The invoice match with purchase order was designed to validate the invoiced quantity with respect to the ordered quantity, so it should not be associated with a material receipt, for that it is the correspondence of receipt of materials with purchase order.

So these lines of code cause bad behavior.

The logic assigns the first receipt of materials that it finds even when it already has a previous match, in the case of partial or multiple receipts it generates the match for the same receipt of material causing a big problem with the matches, having to fix this manually which implies time and confusion in users

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put here a step by step for replicate it. This funcionality is legacy and has very little changes. I want to be sure of it

@yamelsenih
Copy link
Member

Hi @e-Evolution I think that this change make a bad implemetation for core, the original funcionality allows allocate the receipt with invoice and is a legacy funcionality.

Maybe is better if the original bug is resolved. I can make a local environment for test it tomorrow.

Best regards.

@yamelsenih
Copy link
Member

Hi @e-Evolution Please put here a step by step for replicate it. This funcionality is legacy and has very little changes. I want to be sure of it

@marcalwestf
Copy link
Collaborator

@yamelsenih Yamel, @e-Evolution Victor provided the step-by-step reproduction instructions with issue #3462

@marcalwestf
Copy link
Collaborator

@e-Evolution, @yamelsenih as I understand this pull request, the error occurs when you:
1.- Complete a Purchase Order.
2.- Create an Invoice (Vendor) and use the Purchase Order to generate an Invoice Line, but not for the whole quantity ordered.
3.- Complete the Invoice (Vendor).
4.- Stay in the Invoice (Vendor) window and create a Material Receipt. Complete the Material Receipt.
5.- Create another Invoice (Vendor) and use the Purchase Order to get an Invoice Line, but not for the whole quantity ordered.

-> Here you can see that the Material Receipt Line of step 4 is referenced in the Invoice Line of the second Invoice, which is an error because there has not been a Material Receipt for this Invoice.

This behavior can be reproduced with standard Adempiere and it is suppressed with this Pull request.

@marcalwestf
Copy link
Collaborator

...the deleted code that @yamelsenih asks to be explained is in my opinion dangerous because it gets the first material receipt line that matches the invoice quantity or the first material receipt line if none matches.

This means if there is already one material receipt line and the quantity doesn't match, it will be referenced. And this is an error.
So in my opinion is OK to eliminate the reference to MInOutLine.

Copy link
Collaborator

@marcalwestf marcalwestf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • error was reproduced on standard Adempiere
  • error was fixed with changes by this pull request

-> Test passed

@marcalwestf
Copy link
Collaborator

@e-Evolution Victor, there are some checks pending
Thanks

@yamelsenih perhaps you can review also the changes and cast your opinion.

@yamelsenih
Copy link
Member

I agree, just update this branch with last changes for approval from CI

@yamelsenih yamelsenih merged commit 79c9ed1 into adempiere:develop Jun 26, 2021
e-Evolution added a commit to e-Evolution/adempiere that referenced this pull request Jun 28, 2021
* develop: (63 commits)
  Fixed error with Dependent Entities for Record Access (adempiere#3480)
  Remove deprecated methods for Order (adempiere#3484)
  Fixed error when a Purchase order is voided (adempiere#3449)
  adempiere#3469 [Bug Report] In the process Generate an Invoice from the Receipt is not validate if an Invoice was generated adempiere#3469 (adempiere#3470)
  adempiere#3467 [Bug Report] Generate Receipt from Invoice process is not validate if was generate a Material Receipt from a previous execution adempiere#3467 (adempiere#3468)
  adempiere#3462 [Bug Report] Total matched invoice qty adempiere#3462 (adempiere#3464)
  Improve Standard Request Type (adempiere#3453)
  Revert "adempiere#3266 Error in calculating quantity ordered or reserved for Sales Order, manufacturing order and distribution order adempiere#3266"
  Update IT_Query to be more robust in the case where there are multiple clients in the database.  The previous tests assumed the seed was being used for the test which may not always be correct. (+1 squashed commits)
  adempiere#3465 [Bug Report] Error when try delete a material receipt created from Invoice adempiere#3465
  Add support to included role for ASP This pull request allows merge the ASP for a role when this is part of other role as include roles
  Fix parent link
  Fixed error with parent link for W_Category
  Add some columns for RV_C_RFQResponse
  Fixed wrong search for concept acct When a **Payroll Process** is processed and is create facts, the account from concept is created based on Account Schema, payroll of process and business partner group.
  Add Purchasing Tab to Business Partner
  Fixed error with Import ARXML of Print format When a print format is header and line like is **Invoice Header** and the print format is exported as .arxml format. The definition is exported but when is imported in other ADempiere instance the lines are missing.
  Fixed error with NPE for system reports When a print format is created from system and called from a company is throwed a error NPE:
  Update release.yml
  Update ExportReference.sh
  ...

# Conflicts:
#	base/src/org/compiere/model/MOrder.java
e-Evolution added a commit to e-Evolution/adempiere that referenced this pull request Jul 1, 2021
* develop: (29 commits)
  Add overwrite values from Smart Browser field
  Allows define system events for validation of Standard Request Type
  Validate client
  Add better approach for validation engine
  Add optional value for source price list
  Add support to data type as mapping from entities (adempiere#3476)
  Adding the Weight and Volume field into Sales Order and Purchase Order  Feature/3473 (adempiere#3474)
  Add the database function to get the daily salary (adempiere#3458)
  Error in calculating quantity ordered or reserved for manufacturing order and distribution order  (adempiere#3472)
  Fixed error with missing parameter for Requisition PO Create (adempiere#3475)
  Fixed error with Dependent Entities for Record Access (adempiere#3480)
  Remove deprecated methods for Order (adempiere#3484)
  Fixed error when a Purchase order is voided (adempiere#3449)
  Update MPPForecastDefinitionLine.java
  adempiere#3469 [Bug Report] In the process Generate an Invoice from the Receipt is not validate if an Invoice was generated adempiere#3469 (adempiere#3470)
  adempiere#3467 [Bug Report] Generate Receipt from Invoice process is not validate if was generate a Material Receipt from a previous execution adempiere#3467 (adempiere#3468)
  adempiere#3462 [Bug Report] Total matched invoice qty adempiere#3462 (adempiere#3464)
  Fixed error with translation value for reference
  fix: BP Group getSQlWhere in Forecast Run Create.
  Fixed error with Crosstab for Smart Browser
  ...
@e-Evolution e-Evolution deleted the feature/3462_Ok branch July 12, 2021 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 bug 10 Reviewed by Peer 13 Pending Acceptance For Pull Requests: Pending Acceptance 23 Reproduced The case could be reproduced (MM) Material Management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] Total matched invoice qty
3 participants