1 <BR><BR><A NAME="history"><FONT SIZE="+2">Payment History</FONT></A><BR>
4 % if ( $payby{'BILL'} && $curuser->access_right('Post payment') ) {
5 <% $s++ ? ' | ' : '' %>
6 <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<% $p %>edit/cust_pay.cgi?popup=1;payby=BILL;custnum=<% $custnum %>', 392, 336, 'cust_pay_popup' ), CAPTION, 'Enter check payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter check payment</A>
9 % if ( $payby{'CASH'} && $curuser->access_right('Post payment') ) {
10 <% $s++ ? ' | ' : '' %>
11 <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<% $p %>edit/cust_pay.cgi?popup=1;payby=CASH;custnum=<% $custnum %>', 392, 336, 'cust_pay_popup' ), CAPTION, 'Enter cash payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter cash payment</A>
14 % if ( $payby{'WEST'} && $curuser->access_right('Post payment') ) {
15 <% $s++ ? ' | ' : '' %>
16 <A HREF="<% $p %>edit/cust_pay.cgi?payby=WEST;custnum=<% $custnum %>">Enter Western Union payment</A>
19 % if ( ( $payby{'CARD'} || $payby{'DCRD'} )
20 % && $curuser->access_right('Process payment')
21 % && ! $cust_main->is_encrypted($cust_main->payinfo)
23 <% $s++ ? ' | ' : '' %>
24 <A HREF="<% $p %>misc/payment.cgi?payby=CARD;custnum=<% $custnum %>">Process credit card payment</A>
27 % if ( ( $payby{'CHEK'} || $payby{'DCHK'} )
28 % && $curuser->access_right('Process payment')
29 % && ! $cust_main->is_encrypted($cust_main->payinfo)
31 <% $s++ ? ' | ' : '' %>
32 <A HREF="<% $p %>misc/payment.cgi?payby=CHEK;custnum=<% $custnum %>">Process electronic check (ACH) payment</A>
35 % if ( $payby{'MCRD'} && $curuser->access_right('Post payment') ) {
36 <% $s++ ? ' | ' : '' %>
37 <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<% $custnum %>">Post manual (offline) credit card payment</A>
42 % if ( $curuser->access_right('Post credit') ) {
43 <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<% $p %>edit/cust_credit.cgi?<% $custnum %>', 392, 336, 'cust_credit_popup' ), CAPTION, 'Enter credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">Enter credit</A>
47 % if ( $curuser->access_right('View customer tax exemptions') ) {
48 <A HREF="<% $p %>search/cust_tax_exempt_pkg.cgi?custnum=<% $custnum %>">View tax exemptions</A>
52 % if ( $conf->exists('batch-enable')
53 % && $curuser->access_right('View customer batched payments')
55 View batched payments:
56 % foreach my $status (qw( Queued In-transit Complete All )) {
57 <A HREF="<% $p %>search/cust_pay_batch.cgi?status=<% $status{$status} %>;custnum=<% $custnum %>"><% $status %></A>
58 <% $status ne 'All' ? '|' : '' %>
67 %foreach my $cust_bill ($cust_main->cust_bill) {
68 % my $pre = ( $cust_bill->owed > 0 )
69 % ? '<B><FONT SIZE="+1" COLOR="#FF0000">Open '
71 % my $post = ( $cust_bill->owed > 0 ) ? '</FONT></B>' : '';
72 % my $invnum = $cust_bill->invnum;
73 % my $link = $curuser->access_right('View invoices')
74 % ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
77 % 'date' => $cust_bill->_date,
78 % 'desc' => $link. $pre.
79 % "Invoice #$invnum (Balance \$". $cust_bill->owed. ')'.
80 % $post. ( $link ? '</A>' : '' ),
81 % 'charge' => $cust_bill->charged,
85 %#payments (some false laziness w/credits)
86 %foreach my $cust_pay ($cust_main->cust_pay) {
88 % my $payby = $cust_pay->payby;
91 % if ( $payby eq 'CARD' ) {
92 % $payinfo = $cust_pay->paymask;
93 % } elsif ( $payby eq 'CHEK' && $cust_pay->paymask =~ /^(\d+)\@(\d+)$/ ) {
94 % $payinfo = "ABA $2, Acct #$1";
96 % $payinfo = $cust_pay->payinfo;
98 % my @cust_bill_pay = $cust_pay->cust_bill_pay;
99 % my @cust_pay_refund = $cust_pay->cust_pay_refund;
101 % my $target = "$payby$payinfo";
102 % $payby =~ s/^BILL$/Check #/ if $payinfo;
103 % $payby =~ s/^CHEK$/Electronic check /;
104 % $payby =~ s/^PREP$/Prepaid card /;
105 % $payby =~ s/^CARD$/Credit card #/;
106 % $payby =~ s/^COMP$/Complimentary by /;
107 % $payby =~ s/^CASH$/Cash/;
108 % $payby =~ s/^WEST$/Western Union/;
109 % $payby =~ s/^MCRD$/Manual credit card/;
110 % $payby =~ s/^BILL$//;
111 % my $info = $payby ? "($payby$payinfo)" : '';
113 % my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' );
114 % if ( scalar(@cust_bill_pay) == 0
115 % && scalar(@cust_pay_refund) == 0 ) {
116 % #completely unapplied
117 % $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
118 % $post = '</FONT></B>';
119 % if ( $curuser->access_right('Apply payment') # ) {
120 % || $curuser->access_right('Post payment') ) { #remove after 1.7.3
121 % $apply = qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_bill_pay.cgi?!.
123 % qq!', 392, 336, 'cust_bill_pay_popup' ), CAPTION, 'Apply payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!;
125 % } elsif ( scalar(@cust_bill_pay) == 1
126 % && scalar(@cust_pay_refund) == 0
127 % && $cust_pay->unapplied == 0 ) {
128 % #applied to one invoice, the usual situation
129 % $desc = ' applied to Invoice #'. $cust_bill_pay[0]->invnum;
130 % } elsif ( scalar(@cust_bill_pay) == 0
131 % && scalar(@cust_pay_refund) == 1
132 % && $cust_pay->unapplied == 0 ) {
133 % #applied to one refund
134 % $desc = ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date);
138 % foreach my $app ( sort { $a->_date <=> $b->_date }
139 % ( @cust_bill_pay, @cust_pay_refund ) ) {
140 % if ( $app->isa('FS::cust_bill_pay') ) {
141 % $desc .= ' '.
143 % ' applied to Invoice #'. $app->invnum.
145 % #' on '. time2str("%D", $cust_bill_pay->_date).
146 % } elsif ( $app->isa('FS::cust_pay_refund') ) {
147 % $desc .= ' '.
149 % ' refunded on '. time2str("%D", $app->_date).
152 % die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund";
155 % if ( $cust_pay->unapplied > 0 ) {
156 % $desc .= ' '.
157 % '<B><FONT COLOR="#FF0000">$'.
158 % $cust_pay->unapplied. ' unapplied</FONT></B>';
159 % if ( $curuser->access_right('Apply payment') # ) {
160 % || $curuser->access_right('Post payment') ) { #remove after 1.7.3
161 % $desc .= qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_bill_pay.cgi?!.
163 % qq!', 392, 336, 'cust_bill_pay_popup' ), CAPTION, 'Apply payment', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!;
169 % my $view = qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}view/cust_pay.html?link=popup;paynum=!.
171 % qq!', 540, 336, 'view_cust_pay_popup' ), CAPTION, 'Payment Receipt', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">view receipt</A>)!;
174 % my $refund_days = $conf->config('card_refund-days') || 120;
175 % if ( $cust_pay->closed !~ /^Y/i
176 % && $cust_pay->payby =~ /^(CARD|CHEK)$/
177 % && time-$cust_pay->_date < $refund_days*86400
178 % && $cust_pay->unrefunded > 0
179 % && $curuser->access_right('Refund payment')
181 % $refund = qq! (<A HREF="${p}edit/cust_refund.cgi?payby=$1;!.
182 % qq!paynum=!. $cust_pay->paynum. '"'.
183 % qq! TITLE="Send a refund for this payment to the payment gateway"!.
188 % if ( $cust_pay->closed !~ /^Y/i
189 % && ( ( $cust_pay->payby eq 'CARD'
190 % && $curuser->access_right('Credit card void')
192 % || ( $cust_pay->payby eq 'CHEK'
193 % && $curuser->access_right('Echeck void')
195 % || ( $cust_pay->payby !~ /^(CARD|CHEK)$/
196 % && $curuser->access_right('Regular void')
201 % $void = qq! (<A HREF="javascript:areyousure('!.
202 % qq!${p}misc/void-cust_pay.cgi?!. $cust_pay->paynum.
203 % qq!', 'Are you sure you want to void this payment?')"!.
204 % qq! TITLE="Void this payment from the database!.
205 % ( $cust_pay->payby =~ /^(CARD|CHEK)$/
206 % ? ' (do not send anything to the payment gateway)'
213 % if ( $cust_pay->closed !~ /^Y/i
214 % && $conf->exists('deletepayments')
215 % && $curuser->access_right('Delete payment')
218 % $delete = qq! (<A HREF="javascript:areyousure('!.
219 % qq!${p}misc/delete-cust_pay.cgi?!. $cust_pay->paynum.
220 % qq!', 'Are you sure you want to delete this payment?')"!.
221 % qq! TITLE="Delete this payment from the database completely - not recommended"!.
226 % if ( $cust_pay->closed !~ /^Y/i
227 % && scalar(@cust_bill_pay)
228 % && $curuser->access_right('Unapply payment')
231 % $unapply = qq! (<A HREF="javascript:areyousure('!.
232 % qq!${p}misc/unapply-cust_pay.cgi?!. $cust_pay->paynum.
233 % qq!', 'Are you sure you want to unapply this payment?')"!.
234 % qq! TITLE="Keep this payment, but dissociate it from the invoices it is currently applied against"!.
238 % my $otaker = $cust_pay->otaker;
239 % $otaker = '<i>auto billing</i>' if $otaker eq 'fs_daily';
240 % $otaker = '<i>customer self-service</i>' if $otaker eq 'fs_selfservice';
243 % 'date' => $cust_pay->_date,
244 % 'desc' => $pre. "Payment$post by $otaker $info$desc".
245 % "$view$apply$refund$void$delete$unapply",
246 % 'payment' => $cust_pay->paid,
247 % 'target' => $target,
252 %foreach my $cust_pay_void ($cust_main->cust_pay_void) {
254 % my $payby = $cust_pay_void->payby;
255 % my $payinfo = $payby eq 'CARD'
256 % ? $cust_pay_void->paymask
257 % : $cust_pay_void->payinfo;
259 % $payby =~ s/^BILL$/Check #/ if $payinfo;
260 % $payby =~ s/^CHEK$/Electronic check /;
261 % $payby =~ s/^BILL$//;
262 % $payby =~ s/^(CARD|COMP)$/$1 /;
263 % my $info = $payby ? " ($payby$payinfo)" : '';
266 % if ( $cust_pay_void->closed !~ /^Y/i
267 % && $curuser->access_right('Unvoid')
270 % $unvoid = qq! (<A HREF="javascript:areyousure('!.
271 % qq!${p}misc/unvoid-cust_pay_void.cgi?!. $cust_pay_void->paynum.
272 % qq!', 'Are you sure you want to unvoid this payment?')"!.
273 % qq! TITLE="Unvoid this payment from the database!.
274 % ( $cust_pay_void->payby =~ /^(CARD|CHEK)$/
275 % ? ' (do not send anything to the payment gateway)'
282 % 'date' => $cust_pay_void->_date,
283 % 'desc' => "<DEL>Payment $info</DEL> <I>voided ".
284 % time2str("%D", $cust_pay_void->void_date).
285 % " by ". $cust_pay_void->otaker. '</i>'. $unvoid,
286 % 'void_payment' => $cust_pay_void->paid,
291 %#credits (some false laziness w/payments)
292 %foreach my $cust_credit ($cust_main->cust_credit) {
294 % my @cust_credit_bill = $cust_credit->cust_credit_bill;
295 % my @cust_credit_refund = $cust_credit->cust_credit_refund;
297 % my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' );
298 % if ( scalar(@cust_credit_bill) == 0
299 % && scalar(@cust_credit_refund) == 0 ) {
300 % #completely unapplied
301 % $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
302 % $post = '</FONT></B>';
303 % if ( $curuser->access_right('Apply credit') # ) {
304 % || $curuser->access_right('Post credit') ) { #remove after 1.7.3
305 % $apply = qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_credit_bill.cgi?!.
306 % $cust_credit->crednum.
307 % qq!', 392, 336, 'cust_credit_bill_popup' ), CAPTION, 'Apply credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!;
309 % } elsif ( scalar(@cust_credit_bill) == 1
310 % && scalar(@cust_credit_refund) == 0
311 % && $cust_credit->credited == 0 ) {
312 % #applied to one invoice, the usual situation
313 % $desc = ' applied to Invoice #'. $cust_credit_bill[0]->invnum;
314 % } elsif ( scalar(@cust_credit_bill) == 0
315 % && scalar(@cust_credit_refund) == 1
316 % && $cust_credit->credited == 0 ) {
317 % #applied to one refund
318 % $desc = ' refunded on '. time2str("%D", $cust_credit_refund[0]->_date);
322 % foreach my $app ( sort { $a->_date <=> $b->_date }
323 % ( @cust_credit_bill, @cust_credit_refund ) ) {
324 % if ( $app->isa('FS::cust_credit_bill') ) {
325 % $desc .= ' '.
327 % ' applied to Invoice #'. $app->invnum.
329 % #' on '. time2str("%D", $app->_date).
330 % } elsif ( $app->isa('FS::cust_credit_refund') ) {
331 % $desc .= ' '.
333 % ' refunded on '. time2str("%D", $app->_date).
336 % die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund";
339 % if ( $cust_credit->credited > 0 ) {
340 % $desc .= ' <B><FONT COLOR="#FF0000">$'.
341 % $cust_credit->credited. ' unapplied</FONT></B>';
342 % if ( $curuser->access_right('Apply credit') # ) {
343 % || $curuser->access_right('Post credit') ) { #remove after 1.7.3
344 % $desc .= qq! (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('${p}edit/cust_credit_bill.cgi?!.
345 % $cust_credit->crednum.
346 % qq!', 392, 336, 'cust_credit_bill_popup' ), CAPTION, 'Apply credit', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;">apply</A>)!;
353 % if ( $cust_credit->closed !~ /^Y/i
355 % #s'pose deleting a credit isn't bad like deleting a payment
356 % # and this needs to be generally available until we have credit voiding..
357 % #&& $conf->exists('deletecredits')
359 % && $curuser->access_right('Delete credit')
362 % $delete = qq! (<A HREF="javascript:areyousure('!.
363 % qq!${p}misc/delete-cust_credit.cgi?!. $cust_credit->crednum.
364 % qq!', 'Are you sure you want to delete this credit?')">!.
369 % if ( $cust_credit->closed !~ /^Y/i
370 % && scalar(@cust_credit_bill)
371 % && $curuser->access_right('Unapply credit')
374 % $unapply = qq! (<A HREF="javascript:areyousure('!.
375 % qq!${p}misc/unapply-cust_credit.cgi?!. $cust_credit->crednum.
376 % qq!', 'Are you sure you want to unapply this credit?')">!.
381 % 'date' => $cust_credit->_date,
382 % 'desc' => $pre. "Credit$post by ". $cust_credit->otaker.
383 % ( $cust_credit->reason
384 % ? ' ('. $cust_credit->reason. ')'
387 % "$desc$apply$delete$unapply",
388 % 'credit' => $cust_credit->amount,
394 %foreach my $cust_refund ($cust_main->cust_refund) {
396 % my $payby = $cust_refund->payby;
397 % my $payinfo = $payby eq 'CARD'
398 % ? $cust_refund->paymask
399 % : $cust_refund->payinfo;
401 % $payby =~ s/^BILL$/Check #/ if $payinfo;
402 % $payby =~ s/^CHEK$/Electronic check /;
403 % $payby =~ s/^(CARD|COMP)$/$1 /;
406 % if ( $cust_refund->closed !~ /^Y/i
407 % && $conf->exists('deleterefunds')
408 % && $curuser->access_right('Delete refund')
411 % $delete = qq! (<A HREF="javascript:areyousure('!.
412 % qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
413 % qq!', 'Are you sure you want to delete this refund?')"!.
414 % qq! TITLE="Delete this refund from the database completely - not recommended"!.
419 % 'date' => $cust_refund->_date,
420 % 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker. "<BR>".
422 % 'refund' => $cust_refund->refund,
430 <% include("/elements/table-grid.html") %>
431 % my $bgcolor1 = '#eeeeee';
432 % my $bgcolor2 = '#ffffff';
438 <TH CLASS="grid" BGCOLOR="#cccccc">Date</TH>
439 <TH CLASS="grid" BGCOLOR="#cccccc">Description</TH>
440 <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Charge</FONT></TH>
441 <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment</FONT></TH>
442 <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>In-house<BR>Credit</FONT></TH>
443 <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Refund</FONT></TH>
444 <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Balance</FONT></TH>
447 %#display payment history
449 %sub balance_forward_row {
450 % my( $b, $date ) = @_;
451 % my $conf = new FS::Conf;
452 % my $money_char = $conf->config('money_char') || '$';
453 % ( my $balance_forward = $money_char. $b ) =~ s/^\$\-/- \$/;
455 <TR ID="balance_forward_row">
456 <TD CLASS="grid" BGCOLOR="#dddddd">
457 <% time2str("%D",$date) %>
460 <TD CLASS="grid" BGCOLOR="#dddddd">
461 <I>Starting balance on <% time2str("%D",$date) %></I>
462 (<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>)
465 <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
466 <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
467 <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
468 <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
469 <TD CLASS="grid" BGCOLOR="#dddddd"><I><% $balance_forward %></I></TD>
476 %my $money_char = $conf->config('money_char') || '$';
478 %my $years = $conf->config('payment_history-years') || 2;
479 %my $older_than = time - $years * 31556736; #60*60*24*365.24
482 %my $old_history = 0;
485 %foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) {
487 % $lastdate = $item->{'date'};
490 % if ( $item->{'date'} < $older_than ) {
491 % $display = ' STYLE="display:none" ';
497 % if ( $hidden && ! $seen++ ) {
498 % balance_forward_row($balance, $item->{'date'});
503 % if ( $bgcolor eq $bgcolor1 ) {
504 % $bgcolor = $bgcolor2;
506 % $bgcolor = $bgcolor1;
509 % my $charge = exists($item->{'charge'})
510 % ? sprintf("$money_char\%.2f", $item->{'charge'})
513 % my $payment = exists($item->{'payment'})
514 % ? sprintf("- $money_char\%.2f", $item->{'payment'})
517 % $payment ||= sprintf( "<DEL>- $money_char\%.2f</DEL>",
518 % $item->{'void_payment'}
520 % if exists($item->{'void_payment'});
522 % my $credit = exists($item->{'credit'})
523 % ? sprintf("- $money_char\%.2f", $item->{'credit'})
526 % my $refund = exists($item->{'refund'})
527 % ? sprintf("$money_char\%.2f", $item->{'refund'})
530 % my $target = exists($item->{'target'}) ? $item->{'target'} : '';
532 % $balance += $item->{'charge'} if exists $item->{'charge'};
533 % $balance -= $item->{'payment'} if exists $item->{'payment'};
534 % $balance -= $item->{'credit'} if exists $item->{'credit'};
535 % $balance += $item->{'refund'} if exists $item->{'refund'};
536 % $balance = sprintf("%.2f", $balance);
537 % $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp
538 % ( my $showbalance = $money_char. $balance ) =~ s/^\$\-/- \$/;
543 <TR <% $display ? $display.' ID="old_history'.$old_history++.'"' : ''%>>
544 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
545 % unless ( !$target || $target{$target}++ ) {
547 <A NAME="<% $target %>">
550 <% time2str("%D",$item->{'date'}) %>
551 % if ( $target && $target{$target} == 1 ) {
558 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
559 <% $item->{'desc'} %>
561 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
564 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
567 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
570 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
573 <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
579 %if ( scalar(@history) && $hidden && ! $seen++ ) {
580 % balance_forward_row($balance, $lastdate);
585 <SCRIPT TYPE="text/javascript">
587 function show_history () {
588 //alert('showing history!');
590 var balance_forward_row = document.getElementById('balance_forward_row');
592 balance_forward_row.style.display = 'none';
593 for ( var i = 0; i < <% $old_history %>; i++ ) {
594 var oldRow = document.getElementById('old_history'+i);
595 oldRow.style.display = '';
604 my( $cust_main ) = @_;
605 my $custnum = $cust_main->custnum;
607 my $conf = new FS::Conf;
609 my $curuser = $FS::CurrentUser::CurrentUser;
611 my @payby = grep /\w/, $conf->config('payby');
612 #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP ))
613 @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP ))
615 my %payby = map { $_=>1 } @payby;
618 'Queued' => 'O', #Open
620 'Complete' => 'R', #Resolved