diff options
author | ivan <ivan> | 2005-10-21 15:21:37 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-21 15:21:37 +0000 |
commit | cccd0b7cd38a88c131e19981be38434f87abe194 (patch) | |
tree | ddd0960706fcefdf495fe23178f0479b954093ee /httemplate/edit/cust_main | |
parent | a4fcab2fecfce70e38c7f150e5a870a0f60d1136 (diff) |
add CASH and WEST payment types (payments only, not cust_main.payby)
Diffstat (limited to 'httemplate/edit/cust_main')
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 17b1b0cc9..caac3a956 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -4,6 +4,11 @@ my( $cust_main ) = @_; my $conf = new FS::Conf; my $payby_default = $conf->config('payby-default'); +my @payby = $conf->config('payby'); +#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless grep /\w/, @payby; + if ( $payby_default eq 'HIDE' ) { $cust_main->payby('BILL') unless $cust_main->payby; @@ -294,15 +299,60 @@ if ( $payby_default eq 'HIDE' ) { '</TABLE>', + 'CASH' => + + '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'. + + qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!. + qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'CASH' ? $cust_main->paid : '' ). qq!"></TD></TR>!. + + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + + '</TABLE>', + + 'WEST' => + + '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'. + + qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!. + qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'WEST' ? $cust_main->paid : '' ). qq!"></TD></TR>!. + + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + '<TR><TD> </TD></TR>'. + + '</TABLE>', + ); - tie my %options, 'Tie::IxHash', + + my %allopt = ( 'CARD' => 'Credit card', 'CHEK' => 'Electronic check', 'LECB' => 'Phone bill billing', 'BILL' => 'Billing', + 'CASH' => 'Cash', # initial payment, then billing', + 'WEST' => 'Western Union', # initial payment, then billing', 'COMP' => 'Complimentary', - ; + ); + if ( $cust_main->custnum ) { #don't offer CASH and WEST initial payment types + # when editing customer + delete $allopt{$_} for qw(CASH WEST); + } + + tie my %options, 'Tie::IxHash', + map { $_ => $allopt{$_} } + grep { exists $allopt{$_} } + @payby; + my %payby2option = ( ( map { $_ => $_ } keys %options ), 'DCRD' => 'CARD', |