Chapter 13

INVOICES, STATEMENTS, AND RECEIPTS

Computer-generated invoices, statements, and receipts look like they mean business. But if you don't have a dedicated accounting program (and a computer to run it) in your office, producing electronic invoices, statements, and receipts can be a time-consuming task.

If your accounting needs are moderate, you can enlist the help of WordPerfect to produce the paperwork you need. The added advantage of WordPerfect-generated accounts is that you don't need to leave your regular work to make out a receipt. Call up a macro, enter the information, and print the result.

You'll find instructions on producing a number of different invoices, statements, and receipts in this chapter. All use macros and a few borrow functionality from WordPerfect's merge feature. What you'll find:


LETTER-STYLE INVOICE

If you are a professional offering your services to others, you can bill your time and expenses using the customary letter-style invoice. It's relatively easy to create, even easier if you do it on WordPerfect using macros.

A sample invoice template, providing the necessary formatting and math definitions, is included on the Applications Disk as INVOICE.TMP. In addition, the same formatting is included in a stand-alone style, INVOICE.STY, also included on the Applications Disk. Both the document and style templates use the following formatting:

These formats assume standard WordPerfect defaults, including single spacing and no page numbering. If you have set initial formats either using the Setup or Format commands, be sure to cancel them with the appropriate code or they could upset the appearance of the invoice. The [Math On] code should be at the very end of the document or style definition.

The invoice macro is available in two versions on the Applications Disk: One is called LETVOICE.WPM, and uses the INVOICE.TMP template document. The other is called STYVOICE.WPM, and uses the style format. You may wish to rename the version you use to something more convenient to remember and use, such as "INVOICE.WPM" "INV.WPM."

The invoice macro calls up the invoice template or style. It then moves the cursor to the end of the document and past any formatting codes (namely the [Math On] code). You are then prompted to type the name and address of the recipient of the invoice. Pressing [Enter] moves you down one line; press Exit ([F7]) when you are finished entering the name and address.

When the macro senses you have pressed Exit, it branches to the next segment, which enters the "INVOICE" header. Enter each invoice item, then press [Enter] to express the cursor to the dollar amount column (DON'T press the [Tab] key). Enter a dollar amount, then press [Enter] again.

To enter another line in the invoice, press [Enter] as instructed. The macro then lines up the cursor to allow you enter another item.

To finish the invoice, type a plus (+) instead of the [Enter] key after typing a number into the dollar amount column. Pressing + key automatically adds a "TOTAL" in the last line and a = math symbol in the amounts column. The invoice is then calculated for you.

You will want to edit the INVOICE.TMP document template, INVOICE.STY style, and invoice macros as necessary to customize them for your own application. Specifically, you'll need to provide your own name, address, signature line, and Social Security number.


LETVOICE.WPM (provided on the Applications Disk)

{Retrieve}invoice.tmp{Enter}
{Home}{Home}{Home}{Down}

{ASSIGN}2~~
{LABEL}loop~
{VAR 2}
{LOOK}2~
{IF}"{VAR 2}"="{Exit}"~
{Enter}{Enter}
{Bold}{Center}I N V O I C E{Bold}{Enter}{Enter}
For Professional Services Rendered:{Enter}{Enter}
{GO}enter_items~
{ELSE}    
{GO}loop~
{END IF}
 {LABEL}enter_items~
{ASSIGN}3~0~
{LABEL}loop1~
{IF}"{VAR 3}"="+"~
{GO}calc~
{ELSE}
{GO}line~
{END IF}

{LABEL}calc~
{Indent}TOTAL{Tab}+{Enter}
{Columns/Tables}MC
{Columns/Tables}MF
{Enter}{Enter}{Enter}{Enter}
________________________________{Enter}
<Your Name Here>{Enter}
SSN:###-##-####{Enter}
{QUIT}

{LABEL}line~
{Indent}{PAUSE}{Tab}{PAUSE}
{CHAR}3~Press + if finished of Enter to go on.~{Enter}
{GO}loop1~

IMPORTANT NOTE: Be sure to press [Enter] after entering a description and amount; don't press [Tab] to express to the amount column after entering a description.

Note that pressing the Exit key in WordPerfect normally exits the current document or menu. In this case it doesn't. Why? The IF structure, as written here, passes all keystrokes except the one it is looking for. In this case, the instruction looks for {Exit}, the code for the Exit key. As long as you don't press Exit, the macro repeats the loop where it scans the keyboard and prints out the characters you type.

The moment you press Exit, the loop stops, and because the loop doesn't go back to the beginning, the {Exit} code isn't entered into the document. In other words, it is effectively "trapped" by the macro. If variable 1 were missing from the loop, no characters would print out at all.

The STYVOICE.WPM macro is similar, except that it calls up the INVOICE.STY style instead of the INVOICE.TMP template document.

{DISPLAY OFF}
{Style}Rinvoice.sty{Enter}
O
{Home}{Home}{Home}{Down}{Left}
{DISPLAY ON}

The display is turned off so that the screen doesn't show the access of the invoice style.

 

AUTO-CALCULATED INVOICE AND STATEMENT

Perhaps your invoice is a little more complicated, or you are in the business of selling goods and not professional services. In that case, you need a more conventional invoice format. This invoice was created entirely in WordPerfect without any intervention by the user other than entering the raw data. WordPerfect calculated all of the results and filled in all the blanks.

The invoice macro seems fairly complex, but when broken down into its various routines it's really quite simple. You don't need to know exactly how the invoice macro works to use it, but you'll need to acquaint yourself with its structure should you want to rewrite it to suit your individual requirements.

The INVOICE.WPM macro uses an table template, provided on the Applications disk as INVOICE.TAB.


INVOICE.WPM (provided on the Applications Disk)

1. {IF}{SYSTEM}document~!=256~
   {BELL}
   {CHAR}key~{Up}{Up}
   Sorry, the document screen is not empty.  Save the 
   current document{Enter}, if necessary, and clear the screen (press  
   Exit n, n).{Enter}
   Press any key to continue  ~
   {QUIT}
   {END IF}
2. {ON CANCEL}{CALL}cancel~~
   {ON ERROR}{GO}error~~
   {ON NOT FOUND}{GO}not_found~~
3. {ASSIGN}pass~~
   {DISPLAY OFF}
   {Retrieve}invoice.tab{Enter}
4. {Search}BILL TO:{Search}{Item Down}
   {CALL}cust~
5. {LABEL}ship-to~
   {ASSIGN}pass~1~
   {Search Left}SHIP TO:{Search}{Item Down}
6. {LABEL}ship_entry~
   {CHAR}key~{^]}1{^\} Enter as {^]}S{^\}AME  
   {^]}2 D{^\}uplicate Lines  
   {^]}3 R{^\}e-enter Lines  
   {^]}1{^\}{Left}~
   {CASE}{VARIABLE}key~~
   {Enter}~same~
   1~same~  S~same~  s~same~
   2~dup~   D~dup~   d~dup~
   3~cust~  R~cust~  r~cust~
   ~ {GO}ship_entry~
7. {LABEL}same~
   {ASSIGN}pass~~
   SAME
   {GO}start_inv~
   {LABEL}dup~
   {ASSIGN}pass~~
   {VARIABLE}name~{Item Down}
   {VARIABLE}comp~{Item Down}
   {VARIABLE}add~{Item Down}
   {VARIABLE}city~{Item Down}
   {GO}start_inv~
8. {LABEL}cust~
   {TEXT}name~Enter name  ~
   {VARIABLE}name~
   {Item Down}
   {TEXT}comp~Enter company  ~
   {VARIABLE}comp~
   {Item Down}
   {TEXT}add~Enter address ~
   {VARIABLE}add~
   {Item Down}
   {TEXT}city~Enter city, state, & zip  ~
   {VARIABLE}city~
   {Item Down}
   {IF}{VARIABLE}pass~=1~ {ASSIGN}pass~~
   {GO}start_inv~
   {ELSE}
   {RETURN}
   {END IF}
9. {LABEL}start_inv~
   {Search}{Columns/Tables}T{Search}
   {Item Down}
   {ASSIGN}item#~1~
   {DISPLAY ON}
10.{LABEL}enter_items~
   {VARIABLE}item#~{Item Right}
   {TEXT}key~Enter the quantity  ~
   {VARIABLE}key~{Item Right}
   {TEXT}key~Enter the description  ~
   {IF EXISTS}key~
   {ASSIGN}key~{MID}key~0~27~~
   {VARIABLE}key~
   {END IF}
   {Item Right}
   {TEXT}key~Enter the unit price  ~
   {VARIABLE}key~
   {GO}do_another~
11.{LABEL}do_another~
   {IF}{VARIABLE}item#~>23~
   {GO}no_more~ {END IF}
   {CHAR}key~{^\}Do another ({^]}Y{^\}es/{^]}N{^\}o)?  
   {^]}Y{^\}{Left}~
   {CASE}{VARIABLE}key~~
   {Enter}~again~
   Y~again~ y~again~
   N~done~  n~done~
   ~
   {GO}do_another~
   {LABEL}again~
   {ASSIGN}item#~{VARIABLE}item#~+1~
   {Item Right}
   {GO}enter_items~
   {LABEL}done~
   {DISPLAY OFF}{Columns/Tables}{Goto}E2{Enter}
   MPD
   {ASSIGN}item#~{VARIABLE}item#~-1~
   {VARIABLE}item#~{Enter}
   MC
   {Goto}C26{Enter}{Exit}{DISPLAY ON}
   {LABEL}payment~
   {CHAR}key~{^]}1 C{^\}ash  {^]}2 V{^\}isa  
   {^]}3 M{^\}astercard  
   {^]}4{^\} CO{^]}D{^\}  {^]}5 O{^\}ther  
   {^]}1{^\}{Left}~
   {CASE}{VARIABLE}key~~ {Enter}~cash~
   1~cash~  C~cash~  c~cash~
   2~visa~  V~visa~  v~visa~
   3~mc~    M~mc~    m~mc~
   4~cod~   D~cod~   d~cod~
   5~oth~   O~oth~   o~oth~
   ~
   {GO}payment~
   {LABEL}cash~
   CASH
   {GO}order~
   {LABEL}visa~
   {TEXT}key~Enter Visa number  ~
   VISA# {VARIABLE}key~
   {GO}order~
   {LABEL}mc~
   {TEXT}key~Enter Mastercard number  ~
   M/C# {VARIABLE}key~
   {GO}order~
   {LABEL}cod~
   COD
   {GO}order~
   {LABEL}oth~
   {TEXT}key~Enter payment method  ~
   {IF EXISTS}key~
   {ASSIGN}key~{MID}key~0~26~~ {VARIABLE}key~
   {END IF}
   {GO}order~
12.{LABEL}order~
   {DISPLAY OFF}{Columns/Tables}{Goto}C27{Enter}{Exit}
   {DISPLAY ON}
   {TEXT}key~Order taken by:  ~
   {IF EXISTS}key~
   {ASSIGN}key~{MID}key~0~26~~
   {VARIABLE}key~
   {END IF}
13.{LABEL}notes~
   {DISPLAY OFF}{Columns/Tables}{Goto}C28{Enter}{Exit}{End}
   {DISPLAY ON}
   {TEXT}key~Notes about the order  ~
   {IF EXISTS}key~
   {ASSIGN}key~{MID}key~0~31~~
   {VARIABLE}key~
   {END IF}
   {DISPLAY OFF}{Home}{Home}{Up}{DISPLAY ON}
14.{CHAR}key~The invoice is now ready to be edited or printed.  
   Press a key to continue  ~
   {CALL}clear_var~
   {QUIT}
15.{LABEL}no_more~
   {BELL}{CHAR}key~ No more room for additional items.  Press a key to 
   complete the invoice  ~
   {GO}done~
16.{LABEL}cancel~
   {BELL}{CHAR}key~
   {^\}Are you sure you want to quit ({^]}Y{^\}es/{^]}N{^\}o)  
   {^]}N{^\}{Left}~
   {CASE}{VARIABLE}key~~
   Y~quit~  y~quit~
   N~ret~   n~ret~   {Enter}~ret~
   ~
   {RETURN}
   {LABEL}quit~
   {CALL}clear_var~
   {QUIT}
   {LABEL}ret~
   {RETURN}
17.{LABEL}clear_var~
   {ASSIGN}key~~
   {ASSIGN}item#~~
   {RETURN}
18.{LABEL}error~
   {BELL}{CHAR}key~
   Sorry, can't find the INVOICE.TAB file.  Press a key to 
   continue  ~
   {Cancel} {QUIT}
19.{LABEL}not_found~
   {BELL}{CHAR}key~
   Sorry, the invoice template is corrupted.  Press a key to 
   quit  ~
   {Exit}nn
   {CALL}clear_var~
   {QUIT}

 

 

POINT OF SALE RECEIPT

The last thing you want your customers to do is wait in line while you fiddle with a computer to produce a receipt for them. And it's anti-productive for you because you could be spending the time helping others and turning a greater profit. This point of sale receipt system uses preprinted or blank forms and a macro engine to speed up the process. The system is based on WordPerfect's Advance feature which allows you to specify an exact position on the page for text. Advance is most often used as a forms fill-in device, because it allows you to use pre-printed forms and still get the information in the right blanks.

IMPORTANT NOTE: Not all printers support advance, or all of the advance functions. This macro uses using the Right and Line advance commands, which most printers can use.

There are many ways to implement forms fill-in -- including using document comments for instructions -- but the macro technique shown here is the most fool-proof. It can be readily modified to work with any form for any application. The macro presented below also contains routines that calculate the amounts and enter a total.


FILLIN.WPM (provided on the Applications Disk)

1. {DISPLAY OFF}
   {LABEL}setup~
   {Format}LM0.5"{Enter}0.5"{Enter}0 PM0.5"{Enter}0.5"{Enter}{Exit}
   {Switch}{Exit}nn
   {Columns/Tables}MD
   {Right}{Right}{Right}0A*B{Enter}{Exit}O{Switch}
2. {TEXT}key~Enter the order number  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~1~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter today's date  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~3~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter the salesperson  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~5~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter sold to name  ~
   {ASSIGN}rt~0.5~
   {ASSIGN}ln~9~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter sold to address  ~
   {ASSIGN}rt~0.5~ {ASSIGN}ln~11~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter sold to city, state, and ZIP  ~
   {ASSIGN}rt~0.5~
   {ASSIGN}ln~13~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter bill to name  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~9~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter bill to address  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~11~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter bill to city, state ZIP  ~
   {ASSIGN}rt~4.5~
   {ASSIGN}ln~13~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter telephone number  ~
   {ASSIGN}rt~0.5~
   {ASSIGN}ln~15~ {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter shipped via  ~
   {ASSIGN}rt~2.0~
   {ASSIGN}ln~15~
   {CALL}adv~
   {VARIABLE}key~{Enter}
   {TEXT}key~Enter date shipped  ~
   {ASSIGN}rt~6.5~
   {ASSIGN}ln~15~
   {CALL}adv~
   {VARIABLE}key~{Enter}
3. {ASSIGN}item~1~
   {ASSIGN}base~0~
4. {LABEL}items~
   {ASSIGN}row~{VARIABLE}base~+19~
   {TEXT}quan~Enter the QUANTITY of item {VARIABLE}item~  ~
   {ASSIGN}rt~0.5~
   {ASSIGN}ln~{VARIABLE}row~~
   {CALL}adv~
   {VARIABLE}quan~{Enter}
   {TEXT}key~Enter the DESCRIPTION of item {VARIABLE}item~  ~
   {ASSIGN}rt~1.0~
   {ASSIGN}ln~{VARIABLE}row~~
   {CALL}adv~
   {VARIABLE}key~{Enter} {TEXT}price~Enter the UNIT PRICE of item
   {VARIABLE}item~  ~
   {ASSIGN}rt~5.5~
   {ASSIGN}ln~{VARIABLE}row~~
   {CALL}adv~
   {Tab Align}{VARIABLE}price~{Enter}
5. {CALL}compute~
6. {ASSIGN}rt~6.5~
   {ASSIGN}ln~{VARIABLE}row~~
   {CALL}adv~
   {Move}41
   {Tab Align}{End}{Enter}
7. {CHAR}key~{^\}Do another ({^]}Y{^\}es/{^]}N{^\}o)?  
   {^]}Y{^\}{Left}~
   {IF}"{VARIABLE}key~"="y"|"{VARIABLE}key~"="Y"|
      "{VARIABLE}key~"="{Enter}"~
      {ASSIGN}base~{VARIABLE}base~+2~
      {ASSIGN}item~{VARIABLE}item~+1~
      {GO}items~
   {ELSE}
      {GO}terms~
   {END IF}
8. {LABEL}terms~
   {CHAR}key~{^\}Terms: {^]}1 C{^\}ash  {^]}2{^\} CO{^]}D{^\}  
   {^]}3{^\} On {^]}A{^\}ccount  {^]}4{^\} Char{^]}g{^\}e  
   {^]}1{^\}{Left}~
   {CASE}{VARIABLE}key~~ {Enter}~cash~
      1~cash~  C~cash~  c~cash~
      2~cod~   D~cod~   d~cod~
      3~acct~  A~acct~  a~acct~
      4~chg~   G~chg~   g~chg~
      ~
   {GO}terms~
   {LABEL}cash~
   {ASSIGN}rt~0.4~
   {ASSIGN}ln~51~
   {CALL}adv~
   X{Enter}
   {GO}subtotal~
   {LABEL}cod~
   {ASSIGN}rt~0.4~
   {ASSIGN}ln~53~
   {CALL}adv~
   X{Enter}
   {GO}subtotal~
   {LABEL}acct~
   {ASSIGN}rt~0.4~
   {ASSIGN}ln~55~
   {CALL}adv~
   X{Enter}
   {GO}subtotal~
   {LABEL}chg~ 
   {ASSIGN}rt~0.4~
   {ASSIGN}ln~57~
   {CALL}adv~
   X{Enter}
   {GO}subtotal~
9. {LABEL}subtotal~
   {Switch}{End}{Enter}
   {Tab}{Tab}{Tab}{Tab}{Backspace}+
   {Columns/Tables}MC
   {Left}{Block}{Word Left}{Block Copy}{Cancel}{Switch}
   {ASSIGN}rt~6.5~
   {ASSIGN}ln~51~
   {CALL}adv~
   {Move}41{Tab Align}{End}{Enter}
10.{LABEL}salestax~
   {Switch}{Exit}nn
   {Columns/Tables}MD
   {Right}{Right}0
   A*.065{Enter}{Exit}O
   {Tab}{Move}41{End}{Tab}{Tab}
   {Columns/Tables}MC
   {Left}{Block}{Word Left}{Block Copy}{Cancel}{Switch}
   {ASSIGN}rt~6.5~
   {ASSIGN}ln~53~
   {CALL}adv~
   {Move}41 {Tab Align}{End}{Enter}
11.{LABEL}total~
   {Block}{Up}{Up}
   {Block Copy}{Cancel}{Home}{Down}
   {Switch}{Exit}nn
   {Columns/Tables}MO
   {Move}41
   {Home}{Home}{Down}
   {Enter}{Tab}+
   {Columns/Tables}MC
   {Left}{Block}{Word Left}
   {Block Copy}{Cancel}{Switch}
   {ASSIGN}rt~6.5~
   {ASSIGN}ln~55~
   {CALL}adv~
   {Move}41
   {Tab Align}{End}{Enter}
   {CALL}reset~
   {QUIT}
12.{LABEL}adv~
   {Format}
   OAR{VARIABLE}rt~"{Enter}
   AI{VARIABLE}ln~{Enter}{Exit}
   {RETURN}
13.{LABEL}reset~
   {Switch}{Exit}nn{Switch} {DISPLAY ON}
   {QUIT}
14.{LABEL}compute~
   {Switch}{End}{Enter}
   {Tab}{VARIABLE}quan~{Tab}{VARIABLE}price~{Tab}{Tab}
   {Columns/Tables}MC
   {Left}{Block}{Word Left}{Block Copy}{Cancel}{Switch}
   {RETURN}

To determine the location for printing lines of text, create a temporary document filled with rows of numbers, starting with 1 and continuing to 70 or another character position for the right margin. Format the document with zero margins (if your printer can accommodate no margins), then print it on one of your forms. Use the numbers and rows to calculate the placement of each Right and Line Advance command entry.

Note that the Advance form fill-in feature works best when using forms designed for typewriter entry. If the form is designed for handwritten entry, you may have difficulty getting all the lines to fit properly.

You can readily adapt the FILLIN.WPM macro to fit a form of your own. If the form uses non-calculated entries, you can fill it out by providing a prompt, and indicating where the entry is to placed. Specifically:

  1. Prompt for input, using the {CHAR} or {TEXT} commands. The user's entry is placed into a variable.
  2. Assign a location for Right Advance. This measurement is the distance from the left edge of the page (not the left margin) to the start of the entry.
  3. Assign a location for Line Advance. Alternatively, you can use the Down Advance command. In both cases, this measurement is from the top edge of the page.
  4. Call the "adv" routine, which enters the actual codes you previously stored for Right and Line Advance into the document.
  5. Place the response from the {CHAR} of {TEXT} prompt into the document. In most instances, you will want to follow it with a hard return.

Repeat this step for each entry. Entries that must be calculated require that WordPerfect compute the result. You can use the math feature, as demonstrated in this macro, or you can use the table feature. You can build a table for computational purposes in Doc 2, and use it to provide the numbers that are placed into Doc 1.

 

AUTO-CALCULATED EXPENSE REPORT

The next time you must complete an expense report, have WordPerfect do it! Not only will it produce a cleaner final result, but its automatic calculation will insure you that you'll get back every penny owed to you (on the flip side, it will also make sure that you repay every cent due the company!). The macro shown here is particularly helpful for secretaries and administrative assistants who must fill out perhaps a dozen or more expense reports a week.

The auto-calculated expense report uses a pre-formatted table template, which is included on the Supplement Disk as EXPENSE.TAB.

The EXPENSE.TAB document can be used with most all printers, including line and laser printers. The document is formatted with no less than 1/4-inch margins (so it will work with laser printers) and comes formatted for the Standard Printer definition. Before you use the template, you may want to retrieve it and define your own printer. Resave the document (under the same name). Be sure to keep a copy of the original EXPENSE.TAB document in case you need to refer to it again. The template document is designed for 10 pitch (characters per inch) printers, so the entry columns for each day of the week can accommodate numbers up to 999.99. Larger numbers can be entered, but they disturb the format of the table (the expense report macro still functions; however, it may no longer print on just one page).

If you use a printer that's capable of a smaller print pitch or thinner margins, reset these formats accordingly. You can then manually increase the size of each day-of-the-week column. See the WordPerfect manual for more details on working with tables. Note that you can also fill in the expenses table manually. You can use this technique to experiment with formatting.

The macro automatically calls up the EXPENSE.TAB document when it starts. You are then prompted to enter the following information:

The expense report automatically calculates business miles and multiplies it by 26 cents per mile, as allowed by the IRS for tax years starting with 1989 (you can modify the math definition if required). The totals for each cash expenditure, as well as daily totals, are calculated for you. The TOTAL shows the cash expenses plus any business mileage.

The Summary of Expenses is a convenience your company may not require. It shows the total for cash expenses (taken from the previous calculation) and total charged expenses on company credit cards (or personal credit cards when filling out a separate credit expense report). The Summary of Mileage is different from the Business Miles entry earlier in the report. You'd use this section if you drive a company car or had the use of a company-owned or -rented car sometime in the week. WordPerfect automatically calculates the total mileage based on the beginning and ending odometer, and subtracts any personal mileage.

The Balance subtracts the expense total from an outstanding cash advance, if any. If you owe the company money, the amount is shown as a negative value (for example, -5,698.98). If the company owes you, the amount is shown alone.

Here is an inside look at the EXPENSE.WPM macro.


EXPENSE.WPM (provided on the Applications Disk)

1. {IF}{SYSTEM}document~!=256~
     {BELL}
     {CHAR}key~{Up}
     {^\}Sorry, the document is not empty.  Do you want to clear 
     the{Enter}screen?  (Doing so will erase the current 
     contents.)  {^]}Y{^\}es/{^]}N{^\}o  {^]}N{^\}{Left}~
     {CASE}{VARIABLE}key~~
        {Enter}~ stop~
        N~stop~  n~stop~
        Y~clear~ y~clear~
        ~
     {LABEL}stop~
     {DISPLAY OFF} {DISPLAY ON}
     {QUIT}
     {LABEL}clear~
     {Exit}nn
   {END IF}
2. {ON CANCEL}{GO}cancel~~
   {ON ERROR}{GO}no_file~~
   {DISPLAY OFF}
   {Retrieve}expense.tab{Enter}
   {Search}{Columns/Tables}T{Search}
   {DISPLAY ON}
3. {LABEL}name~
   {End}
   {TEXT}key~Enter your name  ~
   {VARIABLE}key~
   {LABEL}week_end~
   {ASSIGN}goto~b1~
   {CALL}goto~
   {End}
   {TEXT}key~Enter week ending  ~
   {VARIABLE}key~
   {LABEL}week~
   {ASSIGN}goto~c1~
   {CALL}goto~
   {End}
   {TEXT}key~Enter today's date  ~ {VARIABLE}key~
   {DISPLAY OFF}{Search}{Columns/Tables}T{Search}
   {DISPLAY ON}
3. {LABEL}dest~
   {Item Down}{Item Right}
   {CALL}message~
   {ASSIGN}key~~
   {LABEL}dest_loop~
   {LOOK}key~
   {IF}"{VARIABLE}key~"="{Tab}"|"{VARIABLE}key~"="{Enter}"~
     {Indent}
   {ELSE}
   {IF}"{VARIABLE}key~"="{Exit}"~
     {Item Down}
     {GO}miles~
   {ELSE}
     {VARIABLE}key~
     {GO}dest_loop~
   {END IF}{END IF}
   {GO}dest_loop~
4. {LABEL}miles~
   {CALL}wait_exit~
   {Item Down}
5. {FOR}cycle~1~11~1~
     {CALL}wait_exit~
   {END FOR}
6. {LABEL}remain~
   {STATUS PROMPT}~
   {ASSIGN}goto~D22~
   {CALL}goto~
   {TEXT}key~Enter total charged expenses  ~
   {VARIABLE}key~
   {ASSIGN}goto~d27~
   {CALL}goto~
   {TEXT}key~Enter beginning odometer reading  ~
   {VARIABLE}key~
   {ASSIGN}goto~d26~
   {CALL}goto~
   {TEXT}key~Enter ending odometer reading  ~
   {VARIABLE}key~
   {ASSIGN}goto~d29~
   {CALL}goto~
   {TEXT}key~Enter personal mileage  ~
   {VARIABLE}key~
   {ASSIGN}goto~a33~
   {CALL}goto~
   {TEXT}key~Enter outstanding cash advance or allowance  ~
   {VARIABLE}key~
   {DISPLAY OFF}{Columns/Tables}MC{Exit}{DISPLAY ON}
   {QUIT}
8. {LABEL}wait_exit~
   {ASSIGN}key~~ {LABEL}loop~
   {IF}{SYSTEM}column~>8~
     {GO}exit~
   {END IF}
   {LOOK}key~
   {CASE}{VARIABLE}key~~
     {Enter}~ exp~
     {Exit}~  exit~
     {HPg}~   remain~
     ~
   {VARIABLE}key~
   {GO}loop~
   {LABEL}exp~
   {Tab}
   {GO}loop~
   {LABEL}exit~
   {DISPLAY OFF}{Item Down}
   {WHILE}{SYSTEM}column~!=2~
   {Item Left}
   {END WHILE}
   {DISPLAY ON}
   {RETURN}
9. {LABEL}message~
   {STATUS PROMPT}
   {^P}^E
   {^P}^E^AEnter expense, press Exit when done (Tab or Enter to
   express)
   {^P}^E^B~
   {RETURN}
10.{LABEL}clear~
   {STATUS PROMPT}~
   {RETURN}
11.{LABEL}goto~
   {DISPLAY OFF}
   {Columns/Tables}{Goto}{VARIABLE}goto~{Enter}{Exit}
   {DISPLAY ON}
   {RETURN}
12.{LABEL}cancel~
   {STATUS PROMPT}~
   {DISPLAY OFF}
   {DISPLAY ON}
   {QUIT}
13.{LABEL}no_file~
   {BELL}{CHAR}key~
   Sorry, the EXPENSE.TAB file can't be found.  
   Press a key to continue  ~
   {Cancel}
   {QUIT}

---

 Top Contents

WordPerfect 5.1 Macros and Templates
Electronic Edition
Copyright 1990, 1997, Gordon McComb.  All Rights Reserved.
First published by Bantam Electronic Publishing, 1990.
http://www.gmccomb.com/