diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-10 23:15:03 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-10 23:15:03 -0700 |
commit | b7a2175dd9b386441f4ab66869d73083e5e8beb1 (patch) | |
tree | 3d96ed11d9ec68a9becd2e5b38548974a7a98e0e /httemplate | |
parent | e497261817ee2cf3acb5ee3dda3c5906f1c13a4f (diff) |
multi-currency, RT#21565
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 17 | ||||
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 28 | ||||
-rw-r--r-- | httemplate/view/cust_main/billing.html | 7 |
3 files changed, 52 insertions, 0 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 5a66f0a60..da5f0f27f 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -615,6 +615,23 @@ function toggle(obj) { <INPUT TYPE="hidden" NAME="cdr_termination_percentage" VALUE="<% $cust_main->cdr_termination_percentage %>"> % } +%my @currencies = $conf->config('currencies'); +%if ( scalar(@currencies) ) { +% unshift @currencies, ''; #default +% my %currency_labels = map { $_ => "$_: ". code2currency($_) } @currencies; +% $currency_labels{''} = +% 'Default: '. code2currency( $conf->config('currency') || 'USD' ); + + <& /elements/tr-select.html, + 'label' => emt('Invoicing currency'), + 'field' => 'currency', + 'options' => \@currencies, + 'labels' => \%currency_labels, + 'curr_value' => $cust_main->currency, + &> +% } + + %my @available_locales = $conf->config('available-locales'); %if ( scalar(@available_locales) ) { % push @available_locales, '' diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 183051170..b2ff45b09 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -10,6 +10,7 @@ emt('Description'), @post_desc_header, @peritem_desc, + @currency_desc, emt('Invoice'), emt('Date'), emt('Paid'), @@ -32,6 +33,7 @@ #strikethrough or "N/A ($amount)" or something these when # they're not applicable to pkg_tax search @peritem_sub, + @currency_sub, 'invnum', sub { time2str('%b %d %Y', shift->_date ) }, sub { sprintf($money_char.'%.2f', shift->get('pay_amount')) }, @@ -44,6 +46,7 @@ '', @post_desc_null, @peritem, + @currency, 'invnum', '_date', #'pay_amount', @@ -55,6 +58,7 @@ '', @post_desc_null, @peritem_null, + @currency_null, $ilink, $ilink, $pay_link, @@ -68,6 +72,7 @@ 'rl'. $post_desc_align. $peritem_align. + $currency_align. 'rcrr'. FS::UI::Web::cust_aligns(), 'color' => [ @@ -76,6 +81,7 @@ '', @post_desc_null, @peritem_null, + @currency_null, '', '', '', @@ -88,6 +94,7 @@ '', @post_desc_null, @peritem_null, + @currency_null, '', '', '', @@ -196,6 +203,23 @@ my @total_desc = ( $money_char.'%.2f total' ); # sprintf strings my @peritem = ( 'setup', 'recur' ); my @peritem_desc = ( 'Setup charge', 'Recurring charge' ); +my @currency_desc = (); +my @currency_sub = (); +my @currency = (); +if ( $conf->config('currencies') ) { + @currency_desc = ( 'Setup billed', 'Recurring billed' ); + @currency_sub = ( + map { + my $what = $_; + sub { my $currency = $_[0]->get($what.'_billed_currency'); + $currency. ' '. currency_symbol($currency, SYM_HTML). + $_[0]->get($what.'_billed_amount'); + }; + } qw( setup recur ) + ); + @currency = ( 'setup_billed_amount', 'recur_billed_amount' ); #for sorting +} + my @pkgnum_header = (); my @pkgnum = (); my @pkgnum_null; @@ -672,6 +696,10 @@ my @peritem_sub = map { my @peritem_null = map { '' } @peritem; # placeholders my $peritem_align = 'r' x scalar(@peritem); +@currency_desc = map {emt($_)} @currency_desc; +my @currency_null = map { '' } @currency; # placeholders +my $currency_align = 'r' x scalar(@currency); + my $ilink = [ "${p}view/cust_bill.cgi?", 'invnum' ]; my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index b863a734b..e286305f4 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -304,6 +304,13 @@ </TR> % } +% if ( $cust_main->currency ) { + <TR> + <TD ALIGN="right"><% mt('Invoicing currency') |h %></TD> + <TD BGCOLOR="#ffffff"><% $cust_main->currency. ': '. code2currency($cust_main->currency) %></TD> + </TR> +% } + % if ( $cust_main->locale ) { % my %locale_info = FS::Locales->locale_info($cust_main->locale); <TR> |