Topic: Recurrent invoices uses customer pricelist instead of template prices

When i create a recurrent invoice, i need to choose a pricing and a template.
I expect that frontaccounting uses the pricing to generate the prices, but instead of this it uses the pricing from the template.

We are aware that we are using an older version of FA, 2.1.2 but i couldn't find anything on this in the changelog, so i assume it hasn't changed since 2.1.2.

Re: Recurrent invoices uses customer pricelist instead of template prices

Hello,
Are you sure you have set things up correctly. These routines have been tested rigoriously.
The algorithm to get the line prices can be found here:

In the file /sales/includes/sales_db.inc

Line 86
function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=null)

Please look and try to follow the algorithms to see that it really does many operations depeding on how you have set up the prices.

/Joe

Re: Recurrent invoices uses customer pricelist instead of template prices

Joe,

I am pretty sure that all is setup correctly,
can you confirm me that this is not a known bug in 2.1.2 and has been fixed a while ago?

if it's not known, i will try in the online demo and see if i can reproduce it.

Re: Recurrent invoices uses customer pricelist instead of template prices

Yes, please try if you can reproduce your error in the demo.
If you get an error, then let it be on the demo, so I can follow it.

/Joe

Re: Recurrent invoices uses customer pricelist instead of template prices

Joe,

we did the test on the demo server.

I created all the needed items (client, company etc) with the name Jack
We made 2 price lists, jack and jackreduction

When we go to the customer Jack we see Sales Type/Price List: Jack

The item we are buying is a 17 inch VGA screen item number 102
price on Jack: 100
price on Jackreduction: 50

Now we create a template, where we used the Jackreduction.
Sales Order #539 and the price is 50

Then we create an recurrent invoice with use of 539 as template and print it.
When we nog checkout customer transactions we see Sales Invoice #478 with a total of 110 and not 55 as expected.

it seems, the invoice is made using the sale price linked to the customer instead of the price linked to the template.

Re: Recurrent invoices uses customer pricelist instead of template prices

Just to ensure that we are not misunderstanding each other.
When the line prices are calculated it uses the current customers (that are addresses in the recurrent invoice) sales type and/or currency.
Not the price from the template. The template is only telling which items are to go on the recurrent invoice and are not linked to the customers that are receiving the invoice.
I hope it works that way.

/Joe

Re: Recurrent invoices uses customer pricelist instead of template prices

Joe,

I see it working in this way, but i think there would be an easyer way, let me try to write it down for you.

Let's say we have 2 pricelists, one for the regular prices, and one with discount prices.
In your example we have 2 possibilities:
1. regular prices
2. discount price on everything.

But let's take an insurance company for example.
The more products you conclude the more reduction you get.
So the first product is regular price, the second product gets discount, etc etc.

In the current way of Frontaccounting this is not possible, since you have a pricelist for each person. A workaround would be to make a specific pricelist for each customer but with 100's of clients this is not workable.

If the pricelist linked to an template is used, we can serve 100's of customers with just 2 pricelists. This means the first product is bought from the first list, and the second (and other products) are bought from a list with reduction on it.

I hope my example is clear enough, it's quite a complicated story...


Kind regards,
Jack

Re: Recurrent invoices uses customer pricelist instead of template prices

Hello, I see what you mean. We will have to do some internal descussions about this.

/Joe

Re: Recurrent invoices uses customer pricelist instead of template prices

Joe, if you need some extra input from our side, just let me know.

Re: Recurrent invoices uses customer pricelist instead of template prices

Can we add an option to the template where we can choose which price to use.
I have removed the line in the file /sales/includes/sales_db.inc
Line 86
function get_price ($stock_id, $currency, $sales_type_id, $factor=null, $date=null)

Now the price on the template is being used but this means that the templates needs to be updated as soon as a price change is in effect, which in my case are only maybe once a year.

Re: Recurrent invoices uses customer pricelist instead of template prices

We have to take into consideration the currency, if used.
We are still considering. If this is going to be an option, we need another field in the recurrent invoice, and the database for 2.3 is locked, so this will first be implemented in 2.4 if we do so.
In the meantime, you can do what Gerhard suggest.

/Joe