1 (edited by kkalgidim 2018-06-08 16:27:33)

Topic: check previous orders if customer has any debt

Hi,
My project has
customer table
order table

order table has paid boolean field. So i can check if customer paid or not from this field.
I want to add new calculated field for customer if previos orders paid or not?

Becuase when customer come to my shop and said i want to pay for the last order.
By this way i can check it if customer has any order not paid before

I attached the project
I am using search button on Form1 and show on grid1

according to my language on project
kim=customer table
siparis=order table
ara=search
siparis.odendimi = order.paid


I hope someone helpme

2 (edited by derek 2018-06-07 17:19:41)

Re: check previous orders if customer has any debt

Hello Kkalgidim,
I had a problem with your attachment so I made a small example for you to show you one way - there may be other ways too. 
Please look at the calculated fields to see how you can show orders that have not been paid (I have used 4 calculated fields - 1. all orders, 2. unpaid orders, 3. paid orders and 4. all of these combined.
If you just copy the code into your own application, I think you will be okay.  Please note that you need to add a line of script to refresh form1.tablegrid1 (your customer tablegrid) otherwise the changes to the calculated fields do not immediately display.
Let me know if there is any problem and I hope this helps,
Regards,
Derek.

Post's attachments

Attachment icon kkal example.zip 338.06 kb, 28 downloads since 2018-06-07 

Re: check previous orders if customer has any debt

Perfect!
Thats what i want!

Thanks Derek, appriciate for your help and example.