summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_pkg.cgi
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-06-08 01:30:52 -0700
committerIvan Kohler <ivan@freeside.biz>2013-06-08 01:30:52 -0700
commite96a2a6fd3a8885b0fb035ecc55bdf50dbe5a4aa (patch)
tree1be65eac435d9445d71a2c63e33fefe94db96349 /httemplate/edit/part_pkg.cgi
parent0f21021fea8f99d28b4507c3cffa55cbdd6f110d (diff)
multi-currency, RT#21565
Diffstat (limited to 'httemplate/edit/part_pkg.cgi')
-rwxr-xr-xhttemplate/edit/part_pkg.cgi43
1 files changed, 42 insertions, 1 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index fadde354e..ef9bc2299 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -51,6 +51,12 @@
'setup_show_zero' => 'Show zero setup',
'recur_fee' => 'Recurring fee',
'recur_show_zero' => 'Show zero recurring',
+ ( map { ( "setup_fee_$_" => "Setup fee $_",
+ "recur_fee_$_" => "Recurring fee $_",
+ );
+ }
+ $conf->config('currencies')
+ ),
'discountnum' => 'Offer discounts for longer terms',
'bill_dst_pkgpart' => 'Include line item(s) from package',
'svc_dst_pkgpart' => 'Include services of package',
@@ -118,6 +124,14 @@
value => 'Y',
disabled => sub { $setup_show_zero_disabled },
},
+ ( map { +{ field => "setup_fee_$_",
+ type => 'text',
+ prefix=> currency_symbol($_, SYM_HTML),
+ size => 8,
+ }
+ }
+ sort $conf->config('currencies')
+ ),
{ field => 'freq',
type => 'part_pkg_freq',
onchange => 'freq_changed',
@@ -127,12 +141,19 @@
disabled => sub { $recur_disabled },
onchange => 'recur_changed',
},
-
{ field => 'recur_show_zero',
type => 'checkbox',
value => 'Y',
disabled => sub { $recur_show_zero_disabled },
},
+ ( map { +{ field => "recur_fee_$_",
+ type => 'text',
+ prefix=> currency_symbol($_, SYM_HTML),
+ size => 8,
+ }
+ }
+ sort $conf->config('currencies')
+ ),
#price plan
#setup fee
@@ -460,6 +481,14 @@ my $error_callback = sub {
$object->set($_ => scalar($cgi->param($_)) )
foreach (qw( setup_fee recur_fee disable_line_item_date_ranges ));
+ foreach my $currency ( $conf->config('currencies') ) {
+ my %part_pkg_currency = $object->part_pkg_currency_options($currency);
+ foreach (qw( setup_fee recur_fee )) {
+ my $param = $_.'_'.$currency;
+ $object->set( $param, $cgi->param($param) );
+ }
+ }
+
$pkgpart = $object->pkgpart;
&$splice_locale_fields(
@@ -535,6 +564,12 @@ my $edit_callback = sub {
$object->set($_ => $object->option($_, 1))
foreach (qw( setup_fee recur_fee disable_line_item_date_ranges ));
+ foreach my $currency ( $conf->config('currencies') ) {
+ my %part_pkg_currency = $object->part_pkg_currency_options($currency);
+ $object->set( $_.'_'.$currency, $part_pkg_currency{$_} )
+ foreach keys %part_pkg_currency;
+ }
+
$pkgpart = $object->pkgpart;
&$splice_locale_fields(
@@ -599,6 +634,12 @@ my $clone_callback = sub {
$object->set($_ => $options{$_})
foreach (qw( setup_fee recur_fee disable_line_item_date_ranges ));
+ foreach my $currency ( $conf->config('currencies') ) {
+ my %part_pkg_currency = $object->part_pkg_currency_options($currency);
+ $object->set( $_.'_'.$currency, $part_pkg_currency{$_} )
+ foreach keys %part_pkg_currency;
+ }
+
$recur_disabled = $object->freq ? 0 : 1;
&$splice_locale_fields(