home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / database / cdbms / invoice.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-01  |  622 b   |  32 lines

  1. /* -------------------- invoice.c ----------------------- */
  2.  
  3. /*
  4.  * produce invoices from the clients file
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include "cdata.h"
  9. #include "cbs.c1"
  10.  
  11. struct clients cl;
  12.  
  13. main()
  14. {
  15.     static int fl [] = {CLIENTS, -1};
  16.     double atof();
  17.  
  18.     db_open("", fl);
  19.     while (TRUE)    {
  20.         if (next_rcd(CLIENTS, 1, &cl) == ERROR)
  21.             break;
  22.         printf("\n\n\nInvoice for Services Rendered\n");
  23.         printf("\n%s", cl.client_name);        
  24.         printf("\n%s", cl.address);
  25.         printf("\n%s, %s %s", cl.city, cl.state, cl.zip);
  26.         printf("\n\nAmount Due: $%10.2f\n",
  27.                     atof(cl.amt_due) / 100);
  28.     }
  29.     db_cls();
  30. }
  31.  
  32.