[ 
https://issues.apache.org/jira/browse/OFBIZ-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774255#action_12774255
 ] 

Deyan commented on OFBIZ-3141:
------------------------------

Yup, strangely but it all works with the demo data. 
Seems like I missed something when I tested it...

My confusion came from the invoice item types: we have: ITM_DISCOUNT_ADJ and 
INV_DISCOUNT_ADJ. 

Usually when you make an ITEM DISCOUNT you get an invoice item ITM_DISCOUNT_ADJ 
and the ID of the product, the discount is meant for. 
When you make a SALE DISCOUNT I thought we should get an invoice item of type 
INV_DISCOUNT_ADJ, as it is not related to any items - it is a general invoice 
discount. However it seems like this is not the case. When you make a SALE 
DISCOUNT you simply get 
an INV_DISCOUNT_ADJ invoice item with no product_id set ( check the screenshot 
). 

So it seems like I haven't configured some accounting settings and this is 
probably the reason I'm getting the exception above. 
Please ignore this bug for now :)


> Unable to create invoice discount 
> ----------------------------------
>
>                 Key: OFBIZ-3141
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3141
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: Release Branch 9.04
>         Environment: Linux, postgres
>            Reporter: Deyan
>         Attachments: patch.patch
>
>
> Use Ofbiz POS for example: 
> 1) Add an order item
> 2) Add sale discount ( type amount - 2.00 price and click Sale Disc )
> 3) Try to complete the transaction:
> Exception: org.ofbiz.entity.transaction.GenericTransactionException
> Message: The current transaction is marked for rollback, not beginning a new 
> transaction and aborting current operation; the rollbackOnly was caused by: 
> Error in simple-method [Post a AcctgTrans 
> [file:/home/ghost/workspace/ofbiz_balkantex_pos/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml#postAcctgTrans]]:
>  ; [Gl account id is not set for [VR00001] or mapping not found for account 
> type ]
> ---- stack trace 
> ---------------------------------------------------------------
> org.ofbiz.entity.transaction.GenericTransactionException: The current 
> transaction is marked for rollback, not beginning a new transaction and 
> aborting current operation; the rollbackOnly was caused by: Error in 
> simple-method [Post a AcctgTrans 
> [file:/home/ghost/workspace/ofbiz_balkantex_pos/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml#postAcctgTrans]]:
>  ; [Gl account id is not set for [VR00001] or mapping not found for account 
> type ]
> org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:109)
> org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:81)
> org.ofbiz.entity.GenericDelegator.findOne(GenericDelegator.java:1599)
> org.ofbiz.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:1687)
> org.ofbiz.accounting.invoice.InvoiceServices.checkInvoicePaymentApplications(InvoiceServices.java:1960)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:597)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:96)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:54)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:390)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:219)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:159)
> org.ofbiz.accounting.invoice.InvoiceServices.createInvoiceForOrder(InvoiceServices.java:812)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:597)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:96)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:54)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:390)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:219)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:159)
> org.ofbiz.order.order.OrderChangeHelper.createOrderInvoice(OrderChangeHelper.java:298)
> org.ofbiz.order.order.OrderChangeHelper.completeOrder(OrderChangeHelper.java:118)
> org.ofbiz.order.shoppingcart.CheckOutHelper.processPayment(CheckOutHelper.java:1085)
> org.ofbiz.order.shoppingcart.CheckOutHelper.processPayment(CheckOutHelper.java:876)
> org.ofbiz.pos.PosTransaction.processSale(PosTransaction.java:873)
> org.ofbiz.pos.event.PaymentEvents.processSale(PaymentEvents.java:417)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:597)
> org.ofbiz.pos.config.ButtonEventConfig.invoke(ButtonEventConfig.java:208)
> org.ofbiz.pos.config.ButtonEventConfig.invokeButtonEvent(ButtonEventConfig.java:105)
> org.ofbiz.pos.component.PosButton$1.construct(PosButton.java:121)
> net.xoetrope.xui.helper.SwingWorker$2.run(Unknown Source)
> java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------------------
> The bug is in accounting: GeneralLedgerServices.xml # 
> getGlAccountFromAccountType

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to