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
IDEMPIERE-5836 Adding support for stocked expense product #2039
Conversation
@@ -595,7 +595,7 @@ public boolean isItem() | |||
@Override | |||
public boolean isStocked () | |||
{ | |||
return super.isStocked() && isItem(); | |||
return super.isStocked() && (isItem() || PRODUCTTYPE_ExpenseType.equals(getProductType())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change the javadoc accordingly
@@ -698,7 +698,7 @@ protected boolean beforeSave (boolean newRecord) | |||
|
|||
// Reset Stocked if not Item | |||
//AZ Goodwill: Bug Fix isStocked always return false | |||
if (!PRODUCTTYPE_Item.equals(getProductType())) | |||
if (!PRODUCTTYPE_Item.equals(getProductType()) && !PRODUCTTYPE_ExpenseType.equals(getProductType())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change the comment too.
Also, please check line 666 of MProduct, there is a validation and storage managing code when changing from Item to not-Item, not sure about the effect, probably changing from Item to Expense doesn't matter now if the Stocked flag is maintained.
Line 918 (beforeDelete) has also a validation about storage
SET SQLBLANKLINES ON | ||
SET DEFINE OFF | ||
|
||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 5 is wrong "I forgot to set the DICTIONARY_ID_COMMENTS System Configurator" better to delete it or make it correct
|
||
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator | ||
-- Aug 8, 2023, 1:27:56 PM IST | ||
UPDATE AD_Field SET DisplayLogic='@IsSummary@=''N'' & @ProductType@=I | @ProductType@=E', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsToolbarButton=NULL,Updated=TO_DATE('2023-08-08 13:27:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=1026 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic here is wrong, is showing the Stocked flag when the product is marked as Summary and Expense.
You need to add parenthesis on the OR condition, or reorder it to check the IsSummary at the end
; | ||
|
||
-- Oct 2, 2023, 3:38:33 PM IST | ||
UPDATE AD_Column SET Callout='org.compiere.model.CalloutProduct.productType',Updated=TO_TIMESTAMP('2023-10-02 15:38:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7795 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CalloutProduct class is missing on the pull request
@@ -199,6 +199,11 @@ public ArrayList<Fact> createFacts (MAcctSchema as) | |||
Map<String, BigDecimal> batchLotCostMap = null; | |||
DocLine_InOut line = (DocLine_InOut) p_lines[i]; | |||
MProduct product = line.getProduct(); | |||
//If expense type stocked product, no impact on COGS as it not deducting inventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when doing a manual material receipt - is complaining with "No Costs for ..." - if the expense product is not to be posted, then the posting must not throw error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were creating cost. now creating new PR which has no cost created at all and so it will not throw any error.
@@ -245,6 +245,11 @@ else if (MAcctSchema.COSTINGLEVEL_BatchLot.equals(costingLevel)) | |||
} | |||
else | |||
{ | |||
//if product type expense and stocked, then no needs to do posting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posting an Internal Use Inventory is throwing this error:
15:42:49.073===========> Doc_Inventory.post: [371]
java.lang.NullPointerException: Cannot invoke "org.compiere.model.MProduct.getProductType()" because "product" is null
at org.compiere.acct.Doc_Inventory.createFacts(Doc_Inventory.java:249)
at org.compiere.acct.Doc.postLogic(Doc.java:741)
at org.compiere.acct.Doc.post(Doc.java:625)
https://idempiere.atlassian.net/browse/IDEMPIERE-5836
Pull Request Checklist
Tests
Documentation