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

[Bug Report] Generate Receipt from Invoice process is not validate if was generate a Material Receipt from a previous execution #3467

Closed
e-Evolution opened this issue May 22, 2021 · 4 comments

Comments

@e-Evolution
Copy link
Contributor

Bug report

Generate Receipt from Invoice process is not validate if was generate a Material Receipt from a previous execution enable the possibility that generate multiple times causing inconsistencies.

Steps to reproduce

1.-Create an Invoice from Purchase Order And Complete the document
2.-Generate Receipt from Invoice and go Material Receipt and complete.
3.-Try Generate Receipt from Invoice and the process generate other receipt again

Screenshot or Gif

image

Expected behavior

The system only need allow generate a single Material Receipt by Invoice Line

Other relevant information

  • Your OS: MacOS
  • Java version: 1.8
  • ADempiere version: 3.9.3
  • Browser safari
  • DB Provider: Pg
  • DB version:12.2
@e-Evolution e-Evolution added this to the 3.9.4 milestone May 22, 2021
@e-Evolution e-Evolution self-assigned this May 22, 2021
e-Evolution added a commit to e-Evolution/adempiere that referenced this issue May 22, 2021
…not validate if was generate a Material Receipt from a previous execution adempiere#3467
@marcalwestf marcalwestf added 10 Reviewed by Peer 19 Not reproducible The bug/error not reproducible as described labels Jun 5, 2021
@marcalwestf
Copy link
Collaborator

hi Victor @e-Evolution ,
just followed your steps to reproduce, but I couldn't create a Material Receipt twice:

1.- Working with Adempiere and a 393 database:
Selection_171

2- Create and Complete a Purchase Order
Selection_172

  1. Create and complete an Invoice based on the Purchase Order:
    imagen

4.- Generate and complete a Material Receipt based on the Purchase Invoice:
imagen

5.- Try to generate a Material Receipt from the same Purchase Invoice:
Selection_170
Selection_169

-> Adempiere doesn't allow to create a Material Receipt twice.

Perhaps I am using a different configuration or doing a different workflow?
Thanks

@e-Evolution
Copy link
Contributor Author

e-Evolution commented Jun 5, 2021

@marcalwestf hola Mario, the problem is when create múltiples invoices for an single purchase order , so the case is when you hace the parcial receipt

because the matched is with first material receipt always

Kind regards

@marcalwestf
Copy link
Collaborator

marcalwestf commented Jun 5, 2021

aaah OK @e-Evolution Victor thanks for the explanation.

I thus did the following:
1.- Create and complete a Purchase Order for one product e.g. 666 units.
2.- Create a Purchase Invoice; generate the Invoice Line based on the Purchase Order (e.g. 111 units). Complete this partial Invoice.
3.- Stay at the Invoice; generate and complete a Material Receipt.
4.- Repeat step 2 with another quantity. You will notice that t the Invoice line has already a reference to the Receipt Line created in step 2 !!
5.- Repeat step 3.
6.- Repeat steps 2 and 3 until the quantity of the Purchase Order has been reached.
7.- Repeat step 3: It is possible to create Material Receipts from the Invoice even if the quantity of the Purchase Order has been reached.

-> Error reproduced.

@marcalwestf marcalwestf added 23 Reproduced The case could be reproduced and removed 19 Not reproducible The bug/error not reproducible as described labels Jun 5, 2021
yamelsenih pushed a commit that referenced this issue Jun 26, 2021
…ate if was generate a Material Receipt from a previous execution #3467 (#3468)
e-Evolution added a commit to e-Evolution/adempiere that referenced this issue 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 issue 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
  ...
@nsarlabos
Copy link
Collaborator

Hi @e-Evolution, we have tried and found an error, below are the steps we do:

  • Create a purchase order and complete it
  • Create an invoice (vendor) and its lines using the "Create From Order / Receipt" button, then complete it
  • From the invoice, generate the receipt of materials using the "Generate Receipt from Invoice" button

What happens is that the material receipt is not generated, and the following error message is obtained:

image

Checking the "InvoiceCreateInOut" class, this happens in the "createLine (MInvoice invoice, MInvoiceLine invoiceline)" method.
In our test, where the ordered quantity was 100 and also the invoiced quantity, the value obtained for the variable "qtyNotMatched" is -100, so the method makes a "return" and the material receipt header remains null, returning the above error on line 80 of the class in mentioned.

image

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

3 participants