-
-
-END
-
-my $custnum;
-if ( $link eq 'invnum' ) {
+
- my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } )
- or die "unknown invnum $linknum";
- print "Invoice #$linknum". ntable("#cccccc",2).
- 'Date | '.
- time2str("%D", $cust_bill->_date). ' |
'.
- 'Items | ';
- foreach ( $cust_bill->cust_bill_pkg ) { #false laziness with FS::cust_bill
- if ( $_->pkgnum ) {
-
- my($cust_pkg)=qsearchs('cust_pkg', { 'pkgnum', $_->pkgnum } );
- my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->pkgpart});
- my($pkg)=$part_pkg->pkg;
-
- if ( $_->setup != 0 ) {
- print "$pkg Setup "; # $money_char. sprintf("%10.2f",$_->setup);
- print join(' ',
- map { " ". $_->[0]. ": ". $_->[1] } $cust_pkg->labels
- ). ' ';
- }
-
- if ( $_->recur != 0 ) {
- print
- "$pkg (" . time2str("%x",$_->sdate) . " - " .
- time2str("%x",$_->edate) . ") ";
- #$money_char. sprintf("%10.2f",$_->recur)
- print join(' ',
- map { '--->'. $_->[0]. ": ". $_->[1] } $cust_pkg->labels
- ). ' ';
- }
-
- } else { #pkgnum Tax
- print "Tax " # $money_char. sprintf("%10.2f",$_->setup)
- if $_->setup != 0;
- }
-
- }
- print ' |
';
+<% mt('Payment') |h %>
+<% ntable("#cccccc", 2) %>
+
+% if ( $FS::CurrentUser::CurrentUser->access_right('Backdate payment') ) {
+
+ <% mt('Date') |h %> |
+
+
+
+ |
+
+
+
+% }
+% else {
+
+ <% mt('Date') |h %> |
+
+ <% time2str($date_format.' %r',$_date) %>
+ |
+
+% }
+
+
+ <% mt('Amount') |h %> |
+ <% $money_char %> |
+ <% mt('by') |h %> <% mt(FS::payby->payname($payby)) |h %> |
+
+
+ <& /elements/tr-select-discount_term.html,
+ 'custnum' => $custnum,
+ 'amount_id' => 'paid',
+ &>
+
+% if ( $payby eq 'BILL' ) {
+
+ <% mt('Check #') |h %> |
+ |
+
+% }
+% elsif ( $payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) {
+
+ <% mt('Bank') |h %> |
+ |
+
+
+ <% mt('Check #') |h %> |
+ |
+
+
+ <% mt('Teller #') |h %> |
+ |
+
+
+ <% mt('Depositor') |h %> |
+ |
+
+
+ <% mt('Account #') |h %> |
+ |
+
+% }
+
+
+% if ( $link eq 'custnum' || $link eq 'popup' ) {
+
+ <% mt('Auto-apply to invoices') |h %> |
+
+
+ |
+
+% } elsif ( $link eq 'invnum' ) {
+
+ <% mt('Apply to') |h %> |
+ Invoice #<% $linknum %> only |
+
+
+% }
+
+
+% if ( $conf->exists('pkg-balances') ) {
+ <& /elements/tr-select-cust_pkg-balances.html,
+ 'custnum' => $custnum,
+ 'cgi' => $cgi
+ &>
+% } else {
+
+% }
- $custnum = $cust_bill->custnum;
+
-} elsif ( $link eq 'custnum' ) {
- $custnum = $linknum;
-}
+
+
-print "
Customer #$custnum". ntable('#e8e8e8');
-my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
- or die "unknown custnum $custnum";
-
-print ''. ntable("#cccccc",2).
- ' |
Billing | '.
- $cust_main->getfield('last'). ', '. $cust_main->first. ' ';
-print $cust_main->company. ' ' if $cust_main->company;
-print $cust_main->address1. ' ';
-print $cust_main->address2. ' ' if $cust_main->address2;
-print $cust_main->city. ', '. $cust_main->state. ' '. $cust_main->zip. ' ';
-print $cust_main->country. ' ' if $cust_main->country
- && $cust_main->country ne $countrydefault;
-
-print ' | '.
- '
';
-
-if ( defined $cust_main->dbdef_table->column('ship_last') ) {
-
- print ''. ntable("#cccccc",2).
- ' | Service | '.
- $cust_main->getfield('ship_last'). ', '. $cust_main->ship_first. ' ';
- print $cust_main->ship_company. ' ' if $cust_main->ship_company;
- print $cust_main->ship_address1. ' ';
- print $cust_main->ship_address2. ' ' if $cust_main->ship_address2;
- print $cust_main->ship_city. ', '. $cust_main->ship_state. ' '. $cust_main->ship_zip. ' ';
- print $cust_main->ship_country. ' '
- if $cust_main->ship_country && $cust_main->ship_country ne $countrydefault;
-
- print ' | '.
- '
';
-}
+