Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With VFP DryCleaning POS Pickup Form

Status
Not open for further replies.

foxprox558

Programmer
Oct 19, 2013
53
0
0
US
Ok, So if you will take a look at the picture attached to the thread, you will see the basic layout of the pickup form

the order database is arranged to store the customer number of the customer, when you choose the customer from the top of the form, search through the orders database and find all the orders so you can select the ones you need to pick up.
I need help with putting them in this grid and having it to where you can select multiple orders and have it auto-total in the bottom text box, then save them all as paid when you push pay. This Should Be The Final Problem I'm having. Sorry for the numerous posts, but as said before, I'm kind of new to FoxPro!
 
No, that wouldn't work, because it wouldn't loop and get ALL the names
 
Ok. I am not very strong at implementing combobox as per your requirements. However, I strongly believe that grid solution, as mentioned by many experts in this forum is the viable and easy. You may have to read more about combobox.

I like the design that you have on your form. It looks neat. May be you can start with this solution and modify as you learn more.

Good Luck


Nasib
 
Yes, but I don't have much time to learn. I have a client that I'm writing this program for, It is designed to be very basic (just to get him out of a DOS FoxPro system) and I told him I would have It by The end of the month, so If the grid will work, please tell me how to reorganize the form.
 
You will see all the customers all the time on the left grid. After the search it will only show the Searched customer's orders in the right grid. This way you could also use the up arrow and down arrow to find the customer. There are endless ways to search and show the data. Whatever you think is the right solution for your customer that is what is required.

nasib
 
in the 'Find' button you can calculate the amount and show it on the screen. Then with 'Pay' button you can update the orders(details) table. and that is it.

the code for 'Find' is

* Code start here
local TotAmount
select details
sum AMOUNT to TotAmount for ( STAT = 'P' ) and ( SELECTED = .t. ) and ( details.CUSTNO == customer.CUSTNO )
thisform.text2.value = '$' + alltrim(str(TotAmount,2))

select customer

return



* in your Pay button click() method
* if you are satisfied with the result amount then you can issue the following
select details
replace all STAT with 'O' for ( STAT = 'P' ) and ( SELECTED = .t. ) and ( details.CUSTNO == customer.CUSTNO )
select customer

return

*


nasib
 
>what is 'm.lcCustno'? where does the 'm' come from?
simply use it or remove the ml., it also works without. I won't explain that, it's a topic of it's own.

>also, is curOrdersGRD supposed to be the on-screen grid?
I already asked about curOrders, and that's a cursor, curOrdersGRD also is a cursor, the cursor generated with the other query for the load of your form. Please read what I explained in detail and you know where the different code parts have to go into your form.

cur is a prefix you can expect from me for ANY cursor, if you see something with cur from me, it's a cursor. The GRD suffix denotes, that this cursor should be displayed by the grid.

Bye, Olaf.
 
even when I switch to the grid method, 2 grids, still leaving the buttons, deleting all combo box code, just a last name search box, Search button, and find button. I still get the alias error
 
>Yes, but I don't have much time to learn. I have a client that I'm writing this program for, It is designed to be very basic (just to get him out of a DOS FoxPro system) and I told him I would have It by The end of the month

You have quite some time then. A week. Of course I don't know how much else you need to do in this DOS to Window porting, but you can only offer what you can do. Perhaps solve the time problem first and ask for more time?

For having that problem you ask quite a lot about code you even didn't try. If you're at that stage of time pressure, I would only ask back, when something doesn't work, (and tell what doesn't work). Either you care to learn something or you don't. In this case you won't get around to know a bit more details about the grid. For example, that it always takes data and displays it. It needs it from the start of the form, not just after a button click, that won't work. You then will not be able to have a checkbox and let it have code to update the total. The gird loses all it's inner components and recreates it, if you just set the recordsource.

Bye, Olaf.
 
I have tried the code, I keep getting errors I've never had on any other programs I've written in FoxPro.
 
Hi again:

I will modify a bit

Note: UPPERCASE are all field names such as, AMOUNT, SELECTED, CUSTNO
these fields must exist in your databses as required. for example AMOUNT field must exist in your orders.dbf (details) databse. If you have different name then use that.

You should read all the command which are presented to you in this thread. Unless you fully understand these command you will not be able to debug or make any logic changes.

try to understand the difference in

select customer

and

select customer.*, ...

also try to understand what the statement 'use orders in 0 alias details' does. once you understand it you would not get anymore 'file in use' error else you will be able to correct it yourself.

To me you are on a good start now and you have a lots of material to grasp.

everyone wants to help you to their time limit. this is a great forum. we all are learning.


let us start again...

the code for 'Find' is

* Code start here
local TotAmount
local t_CurRec
select details
t_CurRec = recno()

sum AMOUNT to TotAmount for ( STAT = 'P' ) and ( SELECTED = .t. ) and ( details.CUSTNO == customer.CUSTNO )
thisform.text2.value = TotAmount && Modify the look and feel on your form if needed.
go t_CurRec

select customer

thisform.refresh && Please read this command in help file

return



* in your Pay button click() method
local t_CurRec
select details
t_CurRec = recno()
replace all STAT with 'O' for ( STAT = 'P' ) and ( SELECTED = .t. ) and ( details.CUSTNO == customer.CUSTNO )
go t_CurRec
select customer
thisform.refresh

return

*
if you get any error message, let us know.

try it

nasib
 
is 'amount' the total? because an order can have up to 8 items a piece.
 
in my example, AMOUNT is the field name where the price for each order is stored. if you have a different field name then change it to that. What is the field name where you have stored the Price for each item in your orders.dbf database ?
 
there are 8 price fields
cost1
cost2
cost3
cost4
cost5
cost6
cost7
&
cost8
I have a receipt printed from those, they are summed by the report
 
I guess this should work.


* Code start here
local TotAmount
local t_CurRec
select details
t_CurRec = recno()

local TotCost1, TotCost2, TotCost3, TotCost4, TotCost5, TotCost6, TotCost7, TotCost8
local TotAmount

select details
t_CurRec = recno()
do while datails.CUSTNO == customer.CUSTNO
if STAT ='P' and SELECTED = .t.
* for ii = 1 to 8
* ic = str(ii,1)
* TotCost&ic = COST&ic
* endfor
TotCost1 = TotCost1 + COST1
TotCost2 = TotCost2 + COST2
TotCost3 = TotCost3 + COST3
TotCost4 = TotCost4 + COST4
TotCost5 = TotCost5 + COST5
TotCost6 = TotCost6 + COST6
TotCost7 = TotCost7 + COST7
TotCost8 = TotCost8 + COST8
endif
skip
enddo
TotAmount = TotCost1 + TotCost2 + TotCost3 + TotCost4 + TotCost5 + TotCost6 + TotCost7 + TotCost8
thisform.text2.value = TotAmount && Modify the look and feel on your form if needed.

go t_CurRec
select customer
thisform.refresh && Please read this command in help file
return
 
I got 3 Baker's dozens of errors with the Init() code!
 
init() was working before ?

we only are changing find.click() code.

give some example of errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top