Cannot void Material Receipt matched to Purchase Order

Description

Steps to reproduce:

  • Client has set SysConfig CLIENT_ACCOUNTING as Disabled

  • Material Receipts are matched to Purchase Orders > Created are not posted MatchPO records (Posted = N)

  • User wants to Void already matched a MR > BUG: Material receipt is not possible to Void

BUG: Problem is in MMatchPO class, method reverse. There is condition which allow to reverse only MatchPO records which are Posted and not reversed yet. But we have not Posted records because client has set CLIENT_ACCOUNTING as Disabled.

Discussed at: https://groups.google.com/forum/#!topic/idempiere/0I0r5Pqo-eE

Environment

None

Activity

Show:
Tomáš Švikruha
December 1, 2014, 2:47 PM

isPosted in condition replaced by isProcessed (as mentioned in google group, this is probably a typo bug)

萩原秀明
June 2, 2016, 11:04 AM

Hi, I am Hideaki Hagiwara in Japan.

I found that MMatchInv class have reverse() method and use IsPosted() like a MMatchPO.reverse() method

And MatchInvReverse and MatchPOReverse that are process classes use isPosted() to check before perform reverse() method.

I made patch.

Please check IDEMPIERE-2347_2.patch

萩原秀明
June 2, 2016, 11:22 AM

Sorry, I can not attach a patch. but very little patch.

diff -r 8dabfdd1306d -r d18612e42751 org.adempiere.base/src/org/adempiere/process/MatchInvReverse.java
— a/org.adempiere.base/src/org/adempiere/process/MatchInvReverse.java Mon May 30 15:35:25 2016 +0900
+++ b/org.adempiere.base/src/org/adempiere/process/MatchInvReverse.java Thu Jun 02 19:58:37 2016 +0900
@@ -48,7 +48,7 @@
if (inv.get_ID() != p_M_MatchInv_ID)
throw new AdempiereException("@NotFound@ @M_MatchInv_ID@ " + p_M_MatchInv_ID);

- if (inv.isPosted())
+ if (inv.isProcessed())
{
Timestamp reversalDate = Env.getContextAsDate(getCtx(), "#Date");
if (reversalDate == null) {
diff -r 8dabfdd1306d -r d18612e42751 org.adempiere.base/src/org/adempiere/process/MatchPOReverse.java
— a/org.adempiere.base/src/org/adempiere/process/MatchPOReverse.java Mon May 30 15:35:25 2016 +0900
+++ b/org.adempiere.base/src/org/adempiere/process/MatchPOReverse.java Thu Jun 02 19:58:37 2016 +0900
@@ -46,7 +46,7 @@
MMatchPO po = new MMatchPO (getCtx(), p_M_MatchPO_ID, get_TrxName());
if (po.get_ID() != p_M_MatchPO_ID)
throw new AdempiereException("@NotFound@ @M_MatchPO_ID@ " + p_M_MatchPO_ID);
- if (po.isPosted())
+ if (po.isProcessed())
{
Timestamp reversalDate = Env.getContextAsDate(getCtx(), "#Date");
if (reversalDate == null) {
diff -r 8dabfdd1306d -r d18612e42751 org.adempiere.base/src/org/compiere/model/MMatchInv.java
— a/org.adempiere.base/src/org/compiere/model/MMatchInv.java Mon May 30 15:35:25 2016 +0900
+++ b/org.adempiere.base/src/org/compiere/model/MMatchInv.java Thu Jun 02 19:58:37 2016 +0900
@@ -366,7 +367,7 @@
*/
public boolean reverse(Timestamp reversalDate)
{
- if (this.isPosted() && this.getReversal_ID() == 0)
+ if (this.isProcessed() && this.getReversal_ID() == 0)
{
MMatchInv reversal = new MMatchInv (getCtx(), 0, get_TrxName());
PO.copyValues(this, reversal);

萩原秀明
June 2, 2016, 11:43 AM

Sorry, I can not attach a Patch.

So, I created new ticket.

Fixed

Assignee

Tomáš Švikruha

Reporter

Tomáš Švikruha

Labels

None

Tested By

None

Priority

Major
Configure