-
Notifications
You must be signed in to change notification settings - Fork 8
/
ZGL546.txt
1559 lines (1503 loc) · 36.6 KB
/
ZGL546.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
title 'gl546--financial statement main module - wide '
system
;
;
define m01:'gl546 (financial statement - wide) 12/29/81'
;
; notes:
; 1/16/76...written...ns
; 1/26/76... gl10 i was reading into gdet instead of recg..ns
; 1/3/76... the level 6 of the income statement puts out l and p depending on whether the total is profit or loss.
; 3/02/76... there seems to be a problem with printing the income statement..ns
; correction in c50 - on pass for scheduled accts i wasnt going back
; to b15..ns
; 4/8/76....chng in gl30 lacct checking for le instead of eq...ns
; 5/6/76...correcting overflow proble in crq (top5 and line count )...ns
; 6/17/76....conversion from g930 to g530...ns
; 6/18/76...finishing conv...ns
; 6/21/76...moved call sign in subr. sttype...ns
; 6/22/76...corrected f30 and rounding error on division of opposite signs..ns
; 6/23/76...adding branches - page eject on new branch (change to gl65)..ns
; 7/2/76...chng..master layout, brn is now 3 digits...ns
; 7/7/76...lbrn wasnt initialized..ns
; 7/9/76...new master 131 bytes - 2 headers...ns
; 7/15/76...change in library..ns
; 7/28/76... change in typest - 'f' prints as an 'e' if amount and total are the same..ns
; 8/17/76...program incorporated into standard general ledger application
; with name change, by g.l. gillette. at the
; same time, certain cosmetic changes to formats and messages,
; plus minor program modifications, were made.
; 9/15/76... change in underline at gl67r..ns
; 9/20/76...change in paper size to 11 x 14 7/8...and stack heading (changes crq)
; added option to not print page and number, and ft2 - same indent as ft3...ns
; 10/12/76...in income statement : 4,5, &6 totals are reversed, &
; level one was turning off - sfl switch.(fixed in sub. tl)..ns
; 10/21/76...fixed subr. sign and added option in case they dont have carriage
; tape with vtab. and changing subr. sign to reverse anytime the total includes 100% of
; base income...ns
; 11/1/76...cleaning up glread..ns
; 11/4/76...added check in ckamt to see if it is a money account..ns
; 10/27/76...changed bsdate and stdate to 40 characters..glg
; 11/19/76..changed edpc to put parens around negs at same time as sign...glg
; 11/19/76..added two line feeds after income statement date and check for line=7 right after top..glg
; 11/19/76..lengthened f16 to allow for 40-char client name and recompiled with new record format...glg
; 12/6/76...changes for titus co. income statement - doesnt tof on each branch,
; accumulates totals beypnd one branch....also fixed scheduled dol1
; showing up in d account...ns
; 12/11/76...merging gl545 and gl546...ns
; 12/16/76...fixing ft2..ns
; 12/22/76..cosmetic changes in option msgs; changed ckbal so tested balance
; balance correctly; no-opt'd ckbal in schedules because it didn't
; work right..glg&pp
; 1/16/77...adding option to allow income statement more than one month in
; current month column..ns
; 1/24/77...took out work1..ns
; 3/15/77...new options (revf - reverse sign, underlines changed)..ns
; 3/23/77...changing glread so that if there is a branch without any totals
; it will not totally overlook the next branch...ns
; 4/15/77...adding clear and ?clr..ns
; 2/26/77...reversing m06b/c, only printing $ on d account if d has the indicator,
; 3. page count on option 1 reset not right, 4.format wrong in ty91
; 5. page ejection on first line (cover letter doesnt eject)..ns
; 4/18/77...edpc is backward on sign reversal and adding 1 char. to mask03..ns
; 5/03/77...accounts whose sign was reversed printed on financial statements
; even if they had no activity and suppression was selected: this
; is now fixed..per sa 77016..glg
; 6/6/77...tof problem when there are 4 lines in last page of bal. sheet
; the income statment will not print...ns
; 7/20/77...1. problem on blank page bet. on bs and p&l if they hit just right,
; 2. schedule on p&l only showed first header as bal. sheet...ns
; 8/5/77...unposted option change...ns
; 9/12/77...problem with paging and page numbering on wide paper...ns
; 10/26/77...schedule (if only income statement scheduled no top of form
; also if last account is a schedule it prints no schedules...ns
; 10/27/77...breaking fs into two modules. gl546 is the main phase(but the second module..ns
; 11/14/77...if statement wrong in c20..(caused 'd' account to work wrong)..ns
; 11/15/77...1. f account $ only in column b.
; 2. underline option 7 second underline was too long (f14a,f14an)...ns
; 5/22/78...indenting "centered" description, surpress f accounts if
; tamt & x1 are 0, also title off 1 space...ns
; 6/12/78...change in case d acct is the only account w/i a branch...ns
; 7/26/78...change at gl75. now printing total level 3 in column b (per documentation)...ns
; 10/02/78...modified for h-l accounts...ns
; 06/21/79...dividing program into wide and narrow modules for memory requirements..ns (wide)
; 07/13/79...marty rewrote formats on reports...ns
; 08/02/79...changing signon mess..ns
; 08/22/79..changing retained earnings on crossing yr end..ns
; 8/29/79...line count correction..ns
; 9/19/79...removed printing of dollar sign if ytd only is being printed...jwb
; 9/25/79...modified subroutine ckamt to handle retained earnings different
; when running a financial statement for prior period...jwb
; 10/08/79...modified to check for current month and y-t-d balance on p&l
; accts...jwb
; sw2 =0 not on
; 1 says we are in the scheduled accounts so
; dont do any underlining or spacing until
; we're out of this section..
;
; 05/21/80...modified to calculate retained earnings balance correctly...kag
;12/22/81...changed logic in ck87 to correct retained earnings calculation...pmr
;
;
; 12/29/81...recompile to have a common date base...dl
;
;
;
;=============================================================================
;
record recg(131)
set ?gid:0; 6 byte integer - br/maj/min 2 digits, 6 digits, 3 digits
set ff:0; f1=blank - no leading char, $= if money acct print $,
; if title account $= print $ on next money account.
; ( = enclose in parent. if neg.
; f2= # of lines of overlining. (0,1,2)
;
set vv:0; v1=type acct (title,money,total,etc.)
; v2=scheduled or not
; v3=center title or which col. a or b
; v4=total level or indicates 'c' type title
string desc(30); description
set pos:0; entered but not posted amounts
set cmo:0; current month
set mon2:0; last month
set mon3:0; 2 months ago
set mon4:0; 3 months ago
set mon5:0; 4 months ago
set mon6:0
set mon7:0
set mon8:0
set mon9:0
set mona:0
set monb:0
set monc:0
set mond:0; this month last year
set mone:0; last month last year
set monf:0; 2 months ago - last year
;
set ?cbal:0; current balance (does not include post)
set ?pbal:0; last years total prior to monf
; (ie. if cmo is 6/76 - mond=6/75, mone=5/75, mond=4/75,
; and ?pbal is total as of 3/75)
set usef:0; 0=no postings, 1=print whether postings or not, 2=postings
set ?inv:0; this is where inventory current period amount is stored
; this is generated in h account generation progr.
;
endrec
;
record headb(131)
string client(40); clients name
string coment(50); disclaimer
set month:0; current postings are (mmyy) (date of cmo)
set yrend:0; month of fiscal year end (mm)
set post:0; if post=3 retain all details to end of year.
set ?bsea:0; balance sheet ending account #
set ?plact:0; profit loss accout #
set hh:0; haflg=h accts?, h0=neg in paren, h1=dig.in brn, h2=maj, h3=min, h4=sub, h5=posting to p/r
set mnum:0; # of months of postings in current year
set acnt:0; accountant
string xa(1); special sw
endrec
;
file gmst:sys0,class=2,rnd,recsiz=131,key=rel0
;
record hd4(131)
define m11:'balance sheet '
define m12:'income statement '
endrec
record hd5(131)
string topcom1(64),topcom2(64); disclaimer lines at top
endrec
;
;
record hacct(67)
set ?hid:0,hff:0,hvv:0
string hdesc(30)
string dec(10)
set cur:0,?a9:0
endrec
copy list
; copy uses library "g"
;
;
;
file crt:sysipt
file prt:syslst,class=1,seq
;
file control:sys2,class=2,seq,filtyp=a
external stat,msg,ioerr,gupsi,pupsi,lfeed,cget,?edit,bltrun
entrypoint crt
;
;======================
; program logic
;======================
entry
open io (crt,gmst,list,control), output prt
call gupsi(upsi)
'topcom1'='null'
'topcom2'='null'
curp(crt,1,1)
curb(crt,79)
call msg(m01)
curp(crt,1,24)
read(control,f16)h0,bsdate,key,?ret,cerel
read(control,f16a)fiv,a2,aa,opt1,actopt,ans,tape,cmm,cyy,mm,mo,stdate,mnum
'lbrn'='null'
a010:
readb(list,listb)
call stat(1)
if(?lid.lt.0)go to a010
fiv=?lid
go to (a010,a010,a030,a040)on fiv
if(?lid.ne.0)goto b05
readb(gmst,headb)
call stat(1)
go to a010
a030:
readb(gmst,hd4)
call stat(1)
go to a010
a040:
readb(gmst,hd5)
call stat(1)
b05:
call bltrun(client)
call cent132(client,fclt)
call bltrun(m11); balance sheet
call cent132(m11,fcom1)
encode(head1,fcom1)m11
call bltrun(m12); income statement
call cent132(m12,fcom1)
encode(head2,fcom1)m12; income statment
call bltrun(bsdate)
call cent132(bsdate,fbdte)
call bltrun(stdate)
call cent132(stdate,fsdte)
call bltrun(coment); disclaimer
call cent132(coment,fcom1)
ifs(topcom1.eq.null)go to b06
call bltrun(topcom1)
call cent132(topcom1,ftop1)
b06:
ifs(topcom2.eq.null)go to b10
call bltrun(topcom2)
call cent132(topcom2,ftop2)
b10:
call glread
;
b15:
if(?gid.gt.?bsea)go to c55; income statement accts
go to (b18)on pass; reading master a second time for scheduled accounts only
if(l2.eq.2)go to c10; scheduled acct
b18:
go to (b30,b40,b50,b40,b40,b40)on l1
;
b20:; l1=0; headings
call bltrun(desc); center it just incase
call cent132(desc,f240)
; titled account
go to (b22,b21)on l4
call crq
go to b23
b21:
topflg=1; says print the title line in the header
lsw=0
call top
topflg=0
go to b28
b22:
call top
b23:
if(l3.eq.2)go to b25
write(prt,f250)desc ;wide
go to b28
;
;
b25:
write(prt,f240)desc; wide
;
b28:
go to (c50)on a4; in the income statement
go to b10
;
b30:; l1=1 - d acct (precedes scheduled accounts
?sgid=?gid
srel=rel0
sl2=l2; if this is 4 dont print the d account
goto b28
;
b40:; money accounts
call typest; write account
goto b28
;
b50:; total level (g account type)
call clracct
fa1=l4-1
call tget(?x1,fa1,?x1,6)
call sign(?x1); this will always get cleared so we are using it here
call crq
go to (b57,b58,b56)on l3
go to (b56,b57)on l4
go to b58
b56:
call print(ft1)
go to b59
b57:
call print(ft2)
go to b59
b58:
call print(ft3)
b59:
'dol1'='null'
if(l4.ne.6)go to c81
if(sfl.ne.1)go to b81
call ckbal
b81:
?tx6=?x6
sfl=sfl+1
go to c81
;
;============================================================================
;================== scheduled accounts=====================
;
;
c10:
call ?clr(?b6,?curamo,0)
if(?gid.gt.?bsea)go to c12; p&l
a3=1; this is a flag that indicates that there are scheduled accounts
go to c15
;
c12:
a3a=1
;
;
c15:
sw2=1
if(sl2.eq.4)go to c16; dont print d account
if(l1.eq.5)goto c16; j account has money in current & ytd but doesnt add to total
if(l1.ne.2)goto c15f; ok
if(l4.eq.7)go to c16; i accounts have money, but not added to total
; if record isnt a money account ?tamt & ?camt=0
;
c15f:
;
call ?tamtadd(?b6,0)
call ?cmoadd(?curamo,0)
c16:
call glread
go to (c20)on pass; 10/26 this only happens if the last account on file is a schedule
if(l2.eq.2)go to c15
;
c20:
?lid=?gid; sets up where master was at this point
nrel=rel0; saves the rel. key of the master
rel0=srel; saved relative key from the d account
if(sl2.eq.4)go to c26
if(?sgid.eq.0)go to c25
readb(gmst,recg)
call stat(1)
call dvv; find l1 etc
if(l1.le.3)go to c22; ok
if(l1.eq.6)go to c22;ok
readb(gmst,hacct)
call stat(1)
;
c22:
;
call gl60
c25:
;
?tamt=?b6
?cmo=?curamo
call typest
c26:
;
rel0=nrel
readb(gmst,recg)
call stat(1)
sw2=0
call gl60; entry point in glread
goto (c60)on a4; income account
go to b15
;
;
;
;
;
c50:
call glread
;
if(?gid.le.?bsea)go to b15; this happens when reading first record for scheduling
;
;
c55:
go to (c60)on a4; income account
lsw=0
call ?clr(?x0,?x1,?x2,?x3,?x4,?x5,?x6,?x7,0)
a4=1
call ?clr(?y1,?y2,?y3,?y4,?y5,?y6,?y7,0)
if(l1.ne.0)go to c58; first record isnt a title account
if(l4.gt.0)go to c60; will call top of form
c58:
call top
line=line-1; only place where crq isnt followed by printing
;
c60:
go to (c70)on pass; reading master a 2nd time for scheduled accounts only
if(l2.eq.2)go to c10; scheduled account
c70:
if(l1.eq.0)go to b20; titled account
go to (b30,b40,c80,b40,b40,b40)on l1
;
c80:
;
fa1=l4-1; total level minus 1 to find the proper place in the table
call tget(?tx,fa1,?x1,6)
call tget(?ty,fa1,?y1,6)
call tl
c81:
go to (d20,d25,d30,d40,d45,d40)on fa1; this is total level - 1
;
d10:
call ?clr(?x0,?x1,?y1,0)
go to c50
;
d20:
call ?clr(?x2,?y2,0)
goto d10
d25:
call ?clr(?x3,?y3,0)
goto d20
;
d30:
call ?clr(?x4,?y4,0)
go to d25
;
d40:
call ?clr(?x5,?y5,0)
go to d30
;
d45:
call ?clr(?x6,?y6,?x7,?y7,0)
dfl=0; says restart the 100% baseline - this is for deptmentalization
go to d40
;
;
;=============================================================================
;=============== s u b r o u t i n e s =======================================
;=============================================================================
; subroutine directory
; censtr- centers print line for date
; ckbal - checks to see if statement is in bal
; glread - reads g/l master file
; typest- prints details for balance sheet
; sttype- prints details for income statement
; tl - total lines for income statement
; cksn - checks signs for rounding with + or - 5
; cksn1 - checks signs of ?ty and ?incur for rounding
; ckamt - determines which month is current for finan. statement
; crq - increases line counter
; (top)- part of crq (top of form and heads it)
; sign - checks to see if sign should be reversed and edits
; into num1.
;============================================================================p
;
;=======================
;=========================
subroutine ckbal
;======================
?x6=0-?x6
if(?tx6.ne.?x6)call msg(m23) ; beep if out of balance
?x6=0-?x6
return
;
;=====================
subroutine glread
;=====================
gl30:; read from master file
readb(list,listb)
go to (gl70)on status; write the schedules
if(?lid.le.100)go to gl30; headers
readb(gmst,recg)
call stat(1)
if(?gid.le.0)go to gl30; deleted accounts
call dvv
if(l4.gt.7)go to gl30; v4=8 says no print
if(l1.eq.6)goto gl30f; inventory beg. & ending same record layout
if(l1.lt.4)go to gl30f; b/c/d/e/f or g accounts
readb(gmst,hacct)
call stat(1)
;
gl30f:
;
if(?gid.le.?bsea)go to gl60; balance sheet ending account
go to (gl35,gl60)on dfl; 1=100% baseline info , 2=after 100% base info
; 0=not into 100% yet
call dacct; decodes gid
;
gl31:
if(pass.ne.1)go to gl31f
if(a3a.eq.0)go to gl70; end of file cause no schedules in income statement
;
gl31f:
'lbrn'='brn'
lbr=br
dfl=1; first income account
note(list,newpnt)
call ?clr(?inytd,?incur,0)
if(finc.ne.0)goto gl35; first income account address
finc=newpnt; save this address
;
gl35:
br=?gid/bil
if(br.ne.lbr)go to gl40; the branch had * no * totals within it
call ckamt; figures which months amount we are working with
if(l1.eq.5)go to gl37; j account is not part of total
if(l1.ne.2)go to gl36
if(l4.eq.7)go to gl37; i account is not part of total
;
gl36:
call ?tamtadd(?inytd,0)
call ?cmoadd(?incur,0)
;
gl37:
;
if(l1.ne.3)go to gl30; not to end of income
if(l2.eq.2)go to gl30; scheduled
if(l4.lt.2)go to gl30; not to end of income
gl40:
if(aa.ne.1)go to gl41
page=0
gl41:
?inytd=0-?inytd; reverse the sign of the income
?incur=0-?incur; reverse the sign of the income
dfl=2; beyond income accts in income statement
point(list,newpnt)
go to gl30
;
;
;
gl50:; reading work3 - scheduled info
if(l4.ne.6)go to gl51
sfl=sfl+1; signals liabilities
gl51:
if(l1.ne.1)go to gl52
ssw=l2; if l2=0/1 print schedule, if l2=3 dont print schedule
gl52:
if(l2.ne.2)go to gl30
if(ssw.eq.3)go to gl30; don't print the schedule
go to gl61
;
gl60:
call dvv
call dacct
go to (gl60f) on sw2; 6/12/78
ifs(brn.ne.lbrn)go to gl31
;
gl60f:;6/12/78
;
go to (gl50)on pass
;
gl61:
call ckamt
goto (gl61f)on sw2; 6/12/78
'lbrn'='brn'
;
gl61f:;6/12/78
;
ifs(actopt.eq.yes)go to gl62
call clracct
go to gl65
;
gl62:
'maj'='bl6'
encode(maj,fn6)nmaj
if(nmin.ne.0)go to gl64
'min'='null'
go to gl65
;
gl64:
'acct'='bl3'
encode(acct,f08a)nmin
decode(acct,f08)min
;
gl65:
go to (gl65f)on pass
if(l2.eq.2)go to gl69; dont print $ on d acct if scheduled acct
;
gl65f:
goto (gl69)on sw2; we are coming from the schedule(c10-c30
'acct'='zer3'
encode(acct,f08a)ff; f1=$ or not
decode(acct,f16a)f0,f1,f2; f2=lines of underlining
if(f1.ne.1)go to gl66
'dol1'='dol'; puts $ in next money printout
gl66:
if(f2.eq.0)go to gl69
revf=f2/2*2; see if f2 is an even number 3/15
if(revf.eq.f2)go to gl67; double underline
'mss'='m19'
go to gl67g
;
gl67:
'mss'='m17'; double underline
;
gl67g:; determine which format - if this item is an f or g 1 0r 2 use f14a
line=line+1
if(?last.gt.?bsea)go to gl67p; income portion ony has one underline option
?lid=?gid
go to (gl67a,gl67a,gl67b,gl67b,gl67c,gl67c,gl67d,gl67d,gl67e)on f2
gl67a:; prints line in a column only
call fa(f14a)
go to gl69
;
gl67b:; prints line in b column
call fa(f14b)
go to gl69
;
gl67c:; prints line in c column
call fa(f14c)
go to gl69
;
gl67d:
call faa(f14a)
go to gl69
gl67e:
call faa(f14b); column b & c
go to gl69
;
gl67p:; underlineing in income section
go to (gl67r,gl67r)on a2; no current in a2=1 or 2
call faa(f13)
go to gl69
;
gl67r:
write(prt,f13)null,mss
gl69:
?last=?gid
if(l1.eq.6)go to gl69c
if(l1.gt.3)go to gl69f; revf flag is in f0 in h account types
;
gl69c:
;
revf=usef/10; 3/15
usef=usef-(revf*10) ; 5/03..sa 77016
return
;
gl69f:
;
revf=f0
usef=1
return
;
;
;
;
gl70:; finished with master now go back and list scheduled info
go to (gl40)on dfl; ended which totaling income for branch
pass=pass+1
if(pass.gt.1)go to gl85; pass=0, reg.; pass=1 scheduled, pass=2 finished
'lbrn'='null'
?gid=0
rewind list
if(a3.ne.0)go to gl72; there was no scheduled info
if(a3a.eq.0)go to gl85; no income scheduled accounts
?gid=?sgid; this should be an income account
point(list,finc); first income cacct
gl72:
a3=dfl=a4=sfl=0
if(aa.ne.1)go to gl75; 2/25
page=0; 2/25
gl75:
if(a3.eq.0)go to gl30; caused extra top of form...7/17/78..ns
call top; top of forms for the schedule whether they are in the income or bs.
; a4=indicates income statement
go to gl30
;
gl85:
nmin=nines
call top
call msg(m10); eoj
close prt,crt,gmst,list
stop 0
;
;=======================
subroutine dacct
;=======================
'acct'='zer12'
encode(acct,f07)?gid
decode(acct,f08)brn,nmaj,nmin
br=?gid/bil
return
;
;=======================
subroutine dvv
;=======================
'acct'='zer4'
encode(acct,fn4)vv
decode(acct,f16a)l1,l2,l3,l4
return
;
;
;=====================
subroutine typest ; writes money details for balance sheet
;=====================
;
ifstring(ans.eq.yes)go to ty10; print all
if(?tamt.ne.0)go to ty10; may be a d acct from scheduled
if(l4.ne.1)go to ty05
if(?x0.ne.0)go to ty10
if(l3.eq.0)go to ty05
if(?x1.ne.0)go to ty10; column b printing uses total level 1, column a uses total 0
ty05:
;
if (?gid. le. ?bsea) goto ty08
if (?cmo. ne. 0) goto ty09
if (?tamt. ne. 0) goto ty09
;
ty08:
;
if(usef.ne.1)go to ty50; don't print it if no money and not always flagged as print
;
ty09:
;
if(l1.gt.3)go to ty50; don't print j/k/l unless they have balances
;
ty10:
if(?gid.gt.?bsea)go to sttype; income details
call xupdate
call crq
call sign(?tamt)
go to (ty20)on l4; f account
go to (ty11,ty12)on l3
call print(ft1)
go to ty40
ty11:
call print(ft2)
go to ty35
ty12:
call print(ft3)
go to ty30
;
ty20:
;
'num2'='num1'
call sign(?x1)
if(l3.ne.0)go to ty21
call sign(?x0)
if(?tamt.eq.?x0)go to ty11
write(prt,ft1)brn,maj,min,desc,null,num2+1,dol1,num1+1; column a&b
go to ty35; just clear ?x0
ty21:
if(?tamt.eq.?x1)go to ty12
write(prt,ft2)brn,maj,min,desc,null,num2+1,dol1,num1+1; col b & c
;
;
ty30:
call ?clr(?x1,0)
ty35:
call ?clr(?x0,0)
;
;
ty40:
'dol1'='null'
ty50:
return
;
;==================
subroutine print
;==================
;
direct
lda- x+
sta pr10+5
cpl
;
pr10:
write(prt,ft1)brn,maj,min,desc,dol1,num1+1
return
;
;==============
;
subroutine sttype; writes detail lines in income statement section
;==================
;
?tx=?tamt
?ty=?cmo
ty70:
'dol2'='dol1'
call crq
call calperc
if(?inytd.eq.0)go to ty100; no % because no income
go to (ty80,ty90,ty100)on a2; options 0=std, 1=no current, 2= no ytd %3=no %
ty76:
write(prt,f30)brn,maj,min,desc,dol2,num2+1,num3+1,dol1,num1+1,num4+1
go to ty120
;
;
ty80:; a2=1, no currents
'num2'='spc10'
'num3'='spc10'
'dol2'='null'
go to ty76
;
;
ty90:; a2=2, ytd, no %
'num4'='spc10'
go to ty80; no current & no ytd%
ty100:; current & ytd but no %
go to (ty90,ty90)on a2; no current
'num4'='spc10'
'num3'='spc10'
go to ty76
ty120:
'dol1'='null'
if(l1.eq.5)goto ty130; j account is a memo - not added
if(l1.ne.2)goto ty125
if(l4.eq.7)goto ty130; i account is an input (non-contra) account dont add to total
;
ty125:
if(l1.eq.3)go to ty130; total account
;
call xupdate
call ?cmoadd(?y1,?y2,?y3,?y4,?y5,?y6,?y7,0)
;
ty130:
;
return
;
;===================
subroutine xupdate
;===================
;
if(l1.eq.5)go to xu10
if(l1.ne.2)goto xu05
if(l4.eq.7)goto xu10; i account
;
xu05:
;
call ?tamtadd(?x0,?x1,?x2,?x3,?x4,?x5,?x6,?x7,0)
;
xu10:; l1=5 is memo account - not added to total
return
;
;==================
subroutine ?tamtadd
;==================
;
direct
lda- x+
bnz *+3
rsr
sta ad10+3
sta ad10+13
cpl
;
ad10:
?y1=?y1+?tamt
go to ?tamtadd
;==================
subroutine ?cmoadd
;================
direct
lda- x+
bnz *+3
rsr
sta ad15+3
sta ad15+13
cpl
ad15:
?x0=?x0+?cmo
go to ?cmoadd
;
;=====================
subroutine clracct;
;=====================
'brn'='null'
'maj'='null'
'min'='null'
return
;===================
subroutine tl; total line for income statment
;==================
call clracct
go to ty70
;
;
;=========================
subroutine calperc; calculates percentage and finds 5 or -5 as rounding factor
;=======================
if(?tx.lt.0)go to cks10
if(?inytd.lt.0)go to cks15; opposite signs
cks08:
fiv=5
;
go to cks16
;
cks10:
if(?inytd.lt.0)go to cks08; same signs
;
cks15:
fiv=-5
;
cks16:
?pcytd=?tx*hthou/?inytd+fiv/10
;
if(?ty.lt.0)go to cks20
if(?incur.lt.0)go to cks25
;
cks18:
fiv=5
go to cks30
;
cks20:
if(?incur.lt.0)go to cks18
cks25:
fiv=-5
cks30:
?pccur=?ty*hthou/?incur+fiv/10
call sign(?ty)
'num2'='num1'
call sign(?tx)
call edpc
return
;
;
subroutine ckamt; determines what months values are to be used
;=====================
;
if(l1.gt.3)goto ck12
if(l1.ne.2)goto ck15; not a money account
;
;
go to (ck10,ck20,ck20)on opt1; 0=standard, 1=all entered (not just current), 2=use previous month for current,3=longer than 1 mon
?tamt=?cbal; total posted
?cmo=cmo; current months postings
return
;
ck10:
?tamt=?cbal+pos; total posted and entered
?cmo=pos
return
;
ck12:; j & k accounts
;
;
if(l1.eq.6)go to ck14; beginning/ending inventory
?tamt=?a9
?cmo=cur
;
;
return
;
ck14:; beg/ending inventory
;
;
?tamt=?pbal; this is ytd as figured in h account calculation program
?cmo=?inv; this is current amount as figured in h account calculation prog.
return
;
ck15:; not a money account
call ?clr(?tamt,?cmo,0)
return
;
;
ck20:
?tamt=?cbal
fa1=mo;zero if crossing fiscal year
?cmo=0
if(fa1.ne.0)go to ck21
fa1=cmm-mm; this crosses the year end boundary
;