Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clarifying (new?) concept for Invoice Data Entry
Message
From
05/10/2004 12:10:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00948485
Message ID:
00948830
Views:
22
Damn it, the first thing I have to do is look up some of the technical terms (bookkeeping, taxes, etc.), which I may, or may not, have heard in Spanish...

>Hi Hilmar,
>
>Here is what I was thinking, please correct me.
>
>I have a Invoice-Parent, Invoice-LineItems, Invoice-Grid tables and we will concentrate on Invoice-Grid table.
>
>In it I will have a column for Line #, AcctID, Percentage, Amount (if a % is specified I will have to fill in Amount, else the user presses enter and fills in the Amount, they will be one or the other), ...

IIRC, what I did in a similar situation is to put both a percentage and an amount. If the user left the percentage zero, an absolute amount could be used. If the user specified a percentage # 0, any amount would be overwritten.

>OH WOW!, I just remembered, the above calculation for excise now lies in shambles. I have to have Excise, Cess and similar values calculated on a LineItem basis. As the govt. reporting is on Item basis. So even if the below eg. the line-wise Excise and Excise on total amt. does tally, as the no. of LineItems increase and with varied types of items, there comes a point when there will be a difference of +/- 1 or 2 between the LineItem total of Excise and total amt. calculation of Excise of the same Invoice.
>
>To make matters worse the total of excise in a given period from all the Invoices is then compared with the submitted Excise Return which also has calculated the same excise amount on an item to item basis for the same period. So this leads to a difference as much as Rs.20 in the same period depending on the turnover. The difference is then technically answerable by the client to the authorities.
>
>I am sorry but please advise where does this leave the original idea.

I am a little confused, with the details.

Anyway, my previous idea was to calculate the line items, and then do a calculation over the total of the invoice - separately from the line items.

But if you need to apply certain formulae to all line items, one by one, that should be possible, too.

> Anyways as I was typing this I just received a phone call from a client of the original app asking my if it was possible to round the Excise Amount but not the Cess Amount because X Ltd. company to whom they supply has an Oracle system which does just this and is having problems sanctioning invoice payments due to rounding differences <g>. More Wow, the govt. has in works Service Charge which will be a percetage of Excise and/or Cess so that is %age of %age <g>.

It seems you will have to apply rounding functions, either automatically for all your calculations, or by giving the user the possibility of applying round() or a UDF.

BTW, for applying formulae which will be evaluated with eval(), it seems convenient to give the user a guide of common VFP expressions, which might include:

  • Use an asterisk for multiplication.
  • round()
  • Priority of operators, for example, 1 + 2 * 3 = 7 (not 9). Use of parentheses.
  • Some common VFP functions.
  • Any UDF you find convenient to include.
    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
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform