How can I change Price for an Article individually in an invoice (1 Viewer)

silentwolf

Active member
Local time
Today, 02:49
Joined
Jun 12, 2009
Messages
559
Hi guys,

I got an ArticleTable with current prices.

When I create a Invoice I like to pick an Article for my InvoiceDetailForm and fill the Price and description with those values.
However how could I change the price in the InvoiceDetailsForm if I like to charge more or less for that customer but keep the original Price remaining in the Article Table.

Could not find the right thing on the net so hopefully someone can give me a hint?

Many thanks

Albert
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:49
Joined
Feb 19, 2013
Messages
16,610
you need to use vba code to populate the price control.

Assuming you are picking an article using a combo, you'll be bringing the PK and description through as a matter of course. Include the price in the rowsource, you don't need to display it in the dropdown. Then in the combo afterupdate event put

me.txtPrice=me.cboArticles.column(2)

you haven't provided any names or other detail, so change the above to suit.
 

silentwolf

Active member
Local time
Today, 02:49
Joined
Jun 12, 2009
Messages
559
Hi Cj_London,

thanks for your reply.

But then it does change the original Price of the Product or not?

What I like to do is to change it just for the Price in the according Invoice Detail

So in the "Product" Table there is

ProdID ..................................PK
ProdArticle.......................... Text
ProdDescription................Text
ProdPrice...............................Currency

I pick the Product via combobox your right cboProduct

qryProduct includes all the above fields.

Most of the time the price will be kept as in the Table but when ProdID =1 = ProdPrice 141,00 maybe I like to give the customer for 140.00 Euros.

But I don't like to change the Price in the Product Table.

When I do it with afterUpdate then it changes the ProdPrice to the new price I put in the txtProdPrice.

Hope that is understandable?
 

silentwolf

Active member
Local time
Today, 02:49
Joined
Jun 12, 2009
Messages
559
Hmm ok than I need to check it again.

Thanks will try!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:49
Joined
Feb 19, 2013
Messages
16,610
take the time to understand what the code is doing
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:49
Joined
Feb 19, 2002
Messages
43,233
The point of copying the price from the product table to the order details table is so that you can override the price on any given order but not affect the standard price.

AFTER the item is selected and the code copies the standard price to the order details, you can then change the value for that line item ONLY.
 

silentwolf

Active member
Local time
Today, 02:49
Joined
Jun 12, 2009
Messages
559
Hi guys,

sorry was not here but did manage to work it out as you said!

Many thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:49
Joined
Feb 19, 2002
Messages
43,233
Thanks for posting back that the solution worked. That is always helpful to people who find this thread years later:)
 

Users who are viewing this thread

Top Bottom