Topic: Potential Bug - Dimension 2 not utilized in Direct Invoice

Hi there,

When entering a Direct Invoice, my selection of Dimension 2 does not seem to be properly processed; the GL entries show Dimension 1 but Dimension 2 does not make it to the records, and when running a report based on that Dimension, the transaction does not appear.

There is additionally no opportunity to classify payments into Dimensions when receiving them.

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Actually, I wonder if the problem is that a Dimension 1 was added to the item being sold, but not a Dimension 2, and then the Invoice attempted to set both Dimensions.

Would that be an issue? I ask this with regards to the following code is sales_invoice_db.inc:

$dim2 = ($invoice->dimension2_id != $customer['dimension2_id'] ? $invoice->dimension2_id :
                    ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]));

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Yes, it appears that if an item has dimensions set, this overrides the dimensions set in the Invoice.

Is this the anticipated use-case of Dimensions?

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Yes, the dimensions set on an item overrides the one set in invoice.

Joe

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Sorry to spam with posts - but I thought that I would illustrate my usage here:

I'm using Dimensions for fund accounting for a nonprofit.

Dimension 1 is the primary fund (cost and revenue centre) - these Dimensions include Operating Fund, Capital Fund, Events, etc.

Dimension 2 is where some projects or sub-funds are defined; here, individual events are created or specific restricted funds or endowments.

I'm recording cash sales from tickets at an event. I thought the easiest way to do this would be to create a Cash Sales customer and Direct Invoice the Cash Sales customer the amount collected as admissions revenue and then record the payment.

I have an 'item' created (Ticket Revenue) that has a Dimension 1 defined, but not a Dimension 2 (want to re-use the item for multiple events).

Because I can't find a direct cash sales menu option (there had been mention of one, but I cannot find it), I had created an invoice for Cash Sales and had selected the two dimensions - one for Events, and the second for the specific event.  Added in the item, and processed the invoice.

According to the GL transactions, only the item's Dimensions were applied, not the Dimensions I applied during the input of the invoice.

I suppose I have a couple of work-arounds:
- Create a different Cash Sales customer with the proper dimensions for each event.
- Manually edit the dimensions on the associated transactions through MySQL.

Is there a way to ensure that the dimension attribution in the Direct Invoice page sticks, instead of being overridden?

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Remove the dimensions from the items should do it.

Dimensions can only be used on income or expense accounts from invoices. You must use JV to enter dimensions on balance accounts.

Joe

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Ah, that's even easier - for some reason I didn't think about the logical chain in the item overriding the customer. I'll give it a try!

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Joe - on my test database, I did the following:

- Added an item with no dimensions.
- Added a customer with no dimensions.
- Created an invoice through Direct Invoice and set dimensions via this page.
- Added the Item without dimensions to the invoice.
- Processed the invoice.

Unfortunately, the Dimensions set on the Invoice page - which are different from the dimensions (none) set on Customer creation - did not stick through posting the income to the GL.

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Ok, I will have a look at this later this evening.

Joe

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

Thank you, Joe.

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

If it helps - the purchasing equivalent (with a Supplier without Dimensions, adding during Supplier Invoice creation) works - the assigned dimensions when entering an invoice stick through the invoice creation.

So it appears to be just the sales invoicing side.

Re: Potential Bug - Dimension 2 not utilized in Direct Invoice

This has now been fixed. HG repository updated.

The  changed file /sales/includes/cart_class.inc has been attached here.

I was wrong regarding the item dimension overrides invoice dimension. The invoice dimension overrides the item dimension. Sorry.

/Joe

Post's attachments

cart_class.inc 18.3 kb, 3 downloads since 2012-11-09 

You don't have the permssions to download the attachments of this post.