Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Marking records in table
Message
From
24/08/2001 11:23:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
24/08/2001 11:15:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00548667
Message ID:
00548680
Views:
7
This message has been marked as the solution to the initial question of the thread.
>I have a receivables table and I want to flag them so I can move them to a history table or I want to
>change the amount owed.
>
>Here is an example of my data
>
>Acct_num;Price;Inv_date
>1;40.00;06/27/01
>1;40.00;07/27/01
>
>The customer pays 60 dollars. I want to flag the oldest date as paid and then replace the next one with
>the remaining amount owed which would be 20 dollars. This is just an example of what I need to do. The
>oldest record needs to be changed first and then continue on. Any ideas on how I could do this?
>
>TIA,
>Tyler

If partial payments are possible, add a field that states what part of the debt is paid. Replace the information in a SCAN loop. Something like:
SEEK lnClient
SCAN while lyPayment > 0
  if price <= lyPayment
    replace debt with 0, paid with .T.
  else
    replace debt with debt - lyPayment
  endif
  * decrement lyPayment; I think this will require a temp variable
ENDSCAN
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform