1 &version 2
  2 &- ***********************************************************
  3 &- *                                                         *
  4 &- * Copyright, (C) Honeywell Information Systems Inc., 1984 *
  5 &- *                                                         *
  6 &- * Copyright (c) 1972 by Massachusetts Institute of        *
  7 &- * Technology and Honeywell Information Systems, Inc.      *
  8 &- *                                                         *
  9 &- ***********************************************************
 10 &-
 11 &- HISTORY COMMENTS:
 12 &-  1) change(2019-05-25,Swenson), approve(2019-05-25,MCR10059),
 13 &-     audit(2019-06-01,GDixon), install(2019-06-01,MR12.6g-0023):
 14 &-     Have "ec master bill prepare" tell admin to use a 4-digit year rather
 15 &-     than a 2-digit year for "ec master bill run".
 16 &-                                                      END HISTORY COMMENTS
 17 &-
 18 &-
 19 &-  Modification history:
 20 &-  Modified 1984-12-11 BIM for new value segments.
 21 &-
 22 &- Multics billing operations
 23 &- ------------------------------
 24 &-
 25 &trace &command off
 26 &trace &input off
 27 &goto &1
 28 &-
 29 &label prepare
 30 &trace &command on
 31 &-
 32 &- Usage: ec biller prepare access-name-to-run-bills
 33 &default &"" &[user name].&[user project].a
 34 print billing_footnote
 35 &print $$$ if file not up to date, edit it
 36 st -dt disk_stat
 37 &print $$$ if disk report not current, 'ec master drp'
 38 &-
 39 &print Checking access to segments and directories for &2
 40 ec util check_access >sc1>sat rw &2
 41 ec util check_access >sc1>pdt sma &2
 42 ec util check_access ([segs >sc1>pdt>*.pdt -absp]) rw &2
 43 &-
 44 &print $$$ arguments for bill run are mm dd yyyy bxxxxx
 45 &quit
 46 &-
 47 &- ---------------------------
 48 &-
 49 &label run
 50 &-
 51 &- If this installation requires card output from billing runs, then
 52 &- the following line should be commented out:
 53 &if &[exists argument &4] &then &goto cards_not_required
 54 &if &[not [exists argument &5]] &then exec_com err noarg
 55 &if &[not [or [equal [substr &5 1 1] "B"] [equal [substr &5 1 1] "b"]]]
 56 &then exec_com err badarg &5 not voucher
 57 &label cards_not_required
 58 &print $ now doing billing for &2/&3/&4 (&5)
 59 value_set -pn sys_admin abort_crank true
 60 &print $ crank will abort now until "bill accept" has run
 61 sort_reqfile
 62 sort_projfile
 63 compute_bill safe_pdts>sat safe_pdts
 64 daily_summary -nosum -nocutr
 65 &- above commands make sure got all charges if diskreport ran after crank.
 66 exec_com util del (mailing_copy long_bill short_bill bill msum cards miscs.print)
 67 iocall attach sumry file_ msum w
 68 write_billing_summary &2 &4
 69 iocall detach sumry
 70 &if &[not [exists argument &5]] &then &goto no_cards
 71 iocall attach cards file_ cards w
 72 punch_MIT_deck &2 &3 &4 &5
 73 iocall detach cards
 74 &print $ now dprinting cards and sumry
 75 setacl cards r IO.SysDaemon
 76 &if &[exists file cards]
 77 &then dpn1 -ds "***SPECIAL***" -he [value_get -pn sys_admin accts0_addr] -mcc cards
 78 &label no_cards
 79 exec_com util dp (msum cards) accts0 1
 80 exec_com util dp (msum cards) default 1
 81 iocall attach acct_bill file_ bill w
 82 iocall attach mailing_copy file_ mailing_copy w
 83 iocall attach bill broadcast_ acct_bill w
 84 iocall attach bill broadcast_ mailing_copy w
 85 write_acct_bill &2 &4
 86 iocall detach bill
 87 iocall detach acct_bill
 88 exec_com util dp bill accts0 1
 89 exec_com util dp bill default 1
 90 iocall attach long file_ long_bill w
 91 iocall attach long_bill broadcast_ long w
 92 iocall attach long_bill broadcast_ mailing_copy w
 93 iocall attach short_bill file_ short_bill w
 94 iocall attach both_bills broadcast_ long_bill w
 95 iocall attach both_bills broadcast_ short_bill w
 96 write_user_usage_report safe_pdts>sat safe_pdts reqfile projfile miscfile
 97 iocall detach (both_bills long_bill short_bill mailing_copy long)
 98 file_output miscs.print
 99  misc$print_all_miscs
100 revert_output
101 &print $ now dprinting long bill
102 exec_com util dp long_bill accts0 1
103 exec_com util dp long_bill default 1
104 &-
105 exec_com util del system_month.report
106 file_output system_month.report; system_monthly_report today.use_totals last_month.use_totals; revert_output
107 exec_com util dp system_month.report admin0 2
108 exec_com util dp system_month.report default 1
109 &-
110 &quit
111 &-
112 &- ------------------------
113 &-
114 &label accept
115 &-
116 &if &[not [exists argument &2]] &then exec_com err noarg
117 copy projfile HF>&2.projfile -brief
118 copy reqfile HF>&2.reqfile -brief
119 copy miscfile HF>&2.miscfile -brief
120 copy today.use_totals HF>&2.use_totals
121 exec_com util del last_month.use_totals
122 copy today.use_totals last_month.use_totals
123 usage_total safe_pdts>sat safe_pdts projfile last_month.use_totals
124 reset_use_totals today.use_totals daily_report.control
125 &-
126 up_ctr
127 clear_reqfile
128 clear_projfile
129 clear_sat smf.cur.sat
130 reset_usage >system_control_dir>sat >system_control_dir>pdt safe_pdts>sat safe_pdts
131 misc$reset_misc
132 &- truncate instead of deleting and creating, to preserve the acl
133 truncate miscfile
134 reset_disk_meters
135 value_set -pn sys_admin abort_crank false
136 &print $ crank is now free to run
137 &-
138 &- Comment this back in when console_report and sys_full_report are ready.
139 &- exec_com util del system_full.list
140 &- file_output system_full.list
141 &- sys_full_report -print
142 &- revert_output
143 &- delete sys_full_report_seg
144 
145 &- exec_com util del console.list
146 &- console_report -sort
147 &- file_output console.list
148 &- console_report -print
149 &- revert_output
150 &- console_report -clear
151 exec_com util dp (console.list system_full.list) admin0 2
152 exec_com util dp (console.list system_full.list) default 1
153 &-
154 &label rqbill
155 &if &[exists file cards]
156 &then dpn2 -bf -he [value_get -pn sys_admin accts0_addr] -ds [value_get -pn sys_admin accts0_dest] -mcc cards
157 exec_com util dp (mailing_copy bill long_bill msum bill cards diskreport miscs.print) accts0
158 exec_com util dp system_month.report assurance1
159 &- exec_com util dp system_month.report director2
160 exec_com util dp system_month.report director3
161 exec_com util dp system_month.report director4
162 exec_com util dp system_month.report director5
163 exec_com util dp system_month.report director6
164 exec_com util dp (system_month.report short_bill diskreport bill msum cards miscs.print) director7
165 &- exec_com util dp (system_month.report short_bill diskreport long_bill msum bill cards miscs.print) admin0
166 &- exec_com util dp (system_month.report short_bill diskreport long_bill msum bill cards miscs.print) admin1
167 exec_com util dp system_month.report sysprg0
168 exec_com util dp system_month.report sysprg1
169 exec_com util dp system_month.report sysprg2
170 exec_com util dp (mailing_copy miscs.print short_bill) default 1
171 &quit
172 &-
173 &- ----------------------
174 &-
175 &label delete
176 exec_com util del (mailing_copy long_bill short_bill bill msum cards miscs.print)
177 &quit
178 &-
179 &- -------------------------
180 &-
181 &label &1
182 exec_com err illegal_arg &1
183 &quit
184 &- ----