From c23753d010e11b83ed19e0f3347adc7161ce7de9 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 8 Aug 2013 14:35:00 -0700 Subject: column headings, #24170 --- httemplate/search/pay_batch.cgi | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'httemplate') diff --git a/httemplate/search/pay_batch.cgi b/httemplate/search/pay_batch.cgi index 620996abd..40df5aa56 100755 --- a/httemplate/search/pay_batch.cgi +++ b/httemplate/search/pay_batch.cgi @@ -14,12 +14,23 @@ 'Type', 'First Download', 'Last Upload', - '', # requests - '', # req amt - '', # payments - '', # pay amt + { label => 'Requested', colspan => 2 }, + '', + { label => 'Paid', colspan => 2 }, + '', 'Status', ], + 'header2' => [ '', + '', + '', + '', + '', + 'Items', + 'Amount', + 'Items', + 'Amount', + '', + ], 'align' => 'rcllrrrrc', 'fields' => [ 'batchnum', sub { @@ -49,7 +60,7 @@ }, sub { my $c = FS::cust_pay_batch->count('batchnum = '.$_[0]->batchnum); - $c ? "$c requested" : '' + $c || '' }, sub { my $st = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=" . shift->batchnum; @@ -62,7 +73,7 @@ }, sub { my $c = FS::cust_pay->count('batchnum = '.$_[0]->batchnum); - $c ? "$c paid" : '' + $c || ''; }, sub { my $st = "SELECT SUM(paid) from cust_pay WHERE batchnum=" . shift->batchnum; -- cgit v1.2.1 From 43c8e76ef8fa89a6a082ccc045d1101c44122539 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 8 Aug 2013 16:59:56 -0700 Subject: clear coordinate fields when editing addresses, #24210 --- httemplate/elements/location.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'httemplate') diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index 41a67a0cb..df5106cb0 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -244,6 +244,42 @@ Example: %# Placeholders + + + <%init> my %opt = @_; -- cgit v1.2.1 From f5158f30ad19d8bc2dbd637610ff0460b9a514e7 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Fri, 9 Aug 2013 10:37:01 -0400 Subject: #24429 Fixed suspending reasons when suspending customers --- httemplate/misc/suspend_cust.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/misc/suspend_cust.html b/httemplate/misc/suspend_cust.html index b41f36f8c..e0d17f30b 100644 --- a/httemplate/misc/suspend_cust.html +++ b/httemplate/misc/suspend_cust.html @@ -40,7 +40,7 @@ toggle(false); STYLE="margin-left:auto; margin-right:auto"> <& /elements/tr-select-reason.html, 'field' => 'reasonnum', - 'reason_class' => 'C', + 'reason_class' => 'S', 'cgi' => $cgi, 'control_button' => "document.getElementById('confirm_suspend_cust_button')", &> -- cgit v1.2.1 From 4109791a9b80df968edaf2e71da8ebcfb8882be3 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 8 Aug 2013 18:43:07 -0700 Subject: unearned revenue report: consider primary object dates, not application dates, #13289 --- httemplate/search/unearned_detail.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'httemplate') diff --git a/httemplate/search/unearned_detail.html b/httemplate/search/unearned_detail.html index 285fb50a7..b87a7477e 100644 --- a/httemplate/search/unearned_detail.html +++ b/httemplate/search/unearned_detail.html @@ -105,6 +105,10 @@ my $agentnums_sql = my @where = ( $agentnums_sql ); +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + push @where, "cust_main.agentnum = $1"; +} + my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi); if ( $cgi->param('status') =~ /^([a-z]+)$/ ) { @@ -191,12 +195,16 @@ push @select, "$unearned_sql AS unearned_revenue"; # last payment/credit date my %t = (pay => 'cust_bill_pay', credit => 'cust_credit_bill'); foreach my $x (qw(pay credit)) { - my $table = $t{$x}; - my $link = $table.'_pkg'; - my $pkey = dbdef->table($table)->primary_key; - my $last_date_sql = "SELECT MAX(_date) - FROM $table JOIN $link USING ($pkey) - WHERE $link.billpkgnum = cust_bill_pkg.billpkgnum + my $table = "cust_$x"; + my $link_bill = $t{$x}; + my $link_pkg = $link_bill.'_pkg'; + my %pkey = map { $_ => dbdef->table($_)->primary_key } + ( $table, $link_bill ); + + my $last_date_sql = "SELECT MAX($table._date) + FROM $table JOIN $link_bill USING ($pkey{$table}) + JOIN $link_pkg USING ($pkey{$link_bill}) + WHERE $link_pkg.billpkgnum = cust_bill_pkg.billpkgnum AND $table._date <= $unearned"; push @select, "($last_date_sql) AS last_$x"; } -- cgit v1.2.1 From 98ea745e4b55a38ad8b5ba3749c56327d641d65d Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 9 Aug 2013 13:36:43 -0700 Subject: preserve quantity when changing package type/location, #24259 --- httemplate/edit/process/change-cust_pkg.html | 2 +- httemplate/elements/tr-input-pkg-quantity.html | 15 +++++++++++++++ httemplate/misc/change_pkg.cgi | 6 +++++- httemplate/misc/order_pkg.html | 11 +---------- httemplate/view/cust_main/packages/location.html | 4 ++-- httemplate/view/cust_main/packages/package.html | 8 ++++---- httemplate/view/cust_main/packages/status.html | 4 ++-- 7 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 httemplate/elements/tr-input-pkg-quantity.html (limited to 'httemplate') diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html index 9d06d8e1a..0d571defd 100644 --- a/httemplate/edit/process/change-cust_pkg.html +++ b/httemplate/edit/process/change-cust_pkg.html @@ -27,7 +27,7 @@ my $cust_pkg = qsearchs({ die 'unknown pkgnum' unless $cust_pkg; my %change = map { $_ => scalar($cgi->param($_)) } - qw( locationnum pkgpart ); + qw( locationnum pkgpart quantity ); $change{'keep_dates'} = 1; diff --git a/httemplate/elements/tr-input-pkg-quantity.html b/httemplate/elements/tr-input-pkg-quantity.html new file mode 100644 index 000000000..7ade57399 --- /dev/null +++ b/httemplate/elements/tr-input-pkg-quantity.html @@ -0,0 +1,15 @@ +% if ( FS::Conf->new->exists('invoice-unitprice') or $curr_value > 1 ) { + + <% mt('Quantity') |h %> + + + + + +% } else { + +% } +<%init> +my %opt = @_; +my $curr_value = $cgi->param('quantity') || $opt{'curr_value'} || 1; + diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 7425fbfaf..923be71b1 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -22,6 +22,10 @@ 'cust_main' => $cust_main, &> + <& /elements/tr-input-pkg-quantity.html, + 'curr_value' => $cust_pkg->quantity + &> + <& /elements/tr-select-cust_location.html, 'cgi' => $cgi, 'cust_main' => $cust_main, @@ -94,7 +98,7 @@ my $title = "Change Package"; if ( $cust_pkg->change_to_pkgnum ) { my $change_to = FS::cust_pkg->by_key($cust_pkg->change_to_pkgnum); $cgi->param('delay', 1); - foreach(qw( start_date pkgpart locationnum )) { + foreach(qw( start_date pkgpart locationnum quantity )) { $cgi->param($_, $change_to->get($_)); } $title = "Edit Scheduled Package Change"; diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index a257e53e3..66c405ac1 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -37,16 +37,7 @@ &> % } -% if ( $conf->exists('invoice-unitprice') ) { - - <% mt('Quantity') |h %> - - - - -% } else { - -% } +<& /elements/tr-input-pkg-quantity.html, curr_value => $quantity &> <% mt('Start date') |h %> diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html index 01cbc0ffb..5ff2b1e1f 100644 --- a/httemplate/view/cust_main/packages/location.html +++ b/httemplate/view/cust_main/packages/location.html @@ -70,8 +70,8 @@ sub pkg_change_location_link { 'label' => emt('Change location'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 380, + 'width' => 960, + 'height' => 490, ); } diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 596a47391..7df0869a3 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -280,8 +280,8 @@ sub pkg_change_link { 'label' => emt('Change package'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 480, + 'width' => 960, + 'height' => 490, ); } @@ -295,8 +295,8 @@ sub pkg_change_location_link { 'label' => emt('Change location'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 380, + 'width' => 960, + 'height' => 490, ); } diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 6894a4e02..70b623c0f 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -645,8 +645,8 @@ sub pkg_change_later_link { 'label' => emt('Reschedule'), 'actionlabel' => emt('Edit scheduled change for'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 480, + 'width' => 960, + 'height' => 490, ) } -- cgit v1.2.1