1 02/28/85 write_user_usage_report
 2 
 3 Syntax as a command:  write_user_usage_report sat_path pdt_dir reqfile
 4    projfile miscfile
 5 
 6 
 7 Function:  produces one or more pages for each project, giving the
 8 usage for the month for all users.
 9 
10 
11 Arguments:
12 sat_path
13    is the pathname of a copy of the SAT.  This data base contains a
14    list indicating the valid projects and the projects deleted during
15    the month.
16 pdt_dir
17    is the pathname of the directory where the copies of the PDTs are
18    found.  These segments contain per-user virtual CPU, memory units,
19    and terminal usage for each project.
20 reqfile
21    is the pathname of the reqfile segment.  This segment contains
22    per-account requisition information.
23 
24 
25 projfile
26    is the pathname of the projfile segment.  This segment contains
27    per-project information.
28 miscfile
29    is the pathname of the miscfile segment.  This segment contains
30    miscellaneous charges and detailed information for the month for
31    each project.
32 
33 
34 Notes:  The command writes its output on four switches, named:
35 long_bill, mailing_copy, short_bill, and both_bills.  These switches
36 must have been previously attached (all I/O attachments are the
37 responsibility of the caller).  Output intended for both the long and
38 short versions of the bill is written on the both_bills switch.  The
39 long version of the bill is written on the long_bill switch.  This
40 version has from one to four sections per project to include.
41 
42       summary of total charges (one line per user)
43       summary of interactive charges (one line per shift per user)
44       summary of interactive charges (one line per queue per user)
45       summary of I/O daemon charges (one line per queue per user)
46 
47 
48 The mailing copy version of the bill (written on the mailing_copy
49 switch) includes all of the above, plus the following.
50 
51 1. Page containing the mailing address of the intended recipient
52    precedes the section for each project.
53 
54 2. Current billing rates at the site are printed at the end of the
55    total-charge summary.
56 
57 3. Contents of the billing_footnote segment (if it exists) are printed
58    in the total-charge summary, after the billing rates.  The
59    billing_footnote segment contains announcement material for all
60    project supervisors.
61 
62 
63 The short version of the bill (written on the short_bill switch)
64 consists of the per-project total-charge summary followed by a grand
65 total page.
66 
67 If a user entry appears in a PDT for which there is no reqfile or
68 projfile entry, the command types out an error message and aborts.
69 
70 If the calculated total dollar figure for an account (the sum of the
71 user dollar figures in the PDT entries) does not match the total dollar
72 figure kept in the reqfile, an error message is printed giving both
73 totals, and the command continues using the total dollar figure from
74 reqfile.
75 
76 
77 It should be noted that, since the charges for each user are computed
78 and stored as floating-point binary numbers, some rounding occurs
79 during the conversion of each user's usage figures to dollars and cents
80 for printing.  Thus, discrepancies occur between the sum of the printed
81 user usage figures and the total usage figure for the account.  The
82 total figure is the one that is billed.
83 
84 This command is used by biller.ec to create the long_bill, short_bill,
85 and mailing_copy segments.
86 
87 The operation of this command depends on the proper attachment of the
88 I/O switches (by biller.ec).