From 324209d9ea24ca2f6a6f387088263933c06e39df Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 14 Aug 2015 16:32:21 -0700 Subject: fix links from package report to services that use view/svc_Common, #37621 --- httemplate/view/cust_svc.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_svc.cgi b/httemplate/view/cust_svc.cgi index 8ccfce3ff..aaf367882 100644 --- a/httemplate/view/cust_svc.cgi +++ b/httemplate/view/cust_svc.cgi @@ -1,4 +1,4 @@ -<% $cgi->redirect(popurl(1)."$svcdb.cgi?". $svcnum ) %> +<% $cgi->redirect($url) %> <%init> #needed here? we're just redirecting. i guess it could reveal the svcdb of a @@ -18,6 +18,12 @@ my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); die "Unknown svcpart" unless $part_svc; my $svcdb = $part_svc->svcdb; +my $url = svc_url( + 'm' => $m, + 'action' => 'view', + 'svcdb' => $svcdb, + 'query' => $svcnum, + ); -- cgit v1.2.1 From 46bbbb1a78fd822805226abea832b6206273c091 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Fri, 28 Aug 2015 00:56:49 -0500 Subject: RT#37064: Add action link to manually refund a payment --- httemplate/view/cust_main/payment_history.html | 1 + httemplate/view/cust_main/payment_history/payment.html | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index e3599bc06..1525e9314 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -228,6 +228,7 @@ my %opt = ( ( 'View invoices', 'Void invoices', 'Unvoid invoices', 'Apply payment', 'Refund credit card payment', 'Refund Echeck payment', + 'Post refund', 'Post check refund', 'Post cash refund ', 'Refund payment', 'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments', 'Delete payment', 'Unapply payment', 'Apply credit', 'Delete credit', 'Unapply credit', 'Void credit', 'Unvoid credit', diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index bf88a6607..0ed2f8003 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -154,18 +154,19 @@ if ( $apply && $opt{'pkg-balances'} && $cust_pay->pkgnum ) { my $refund = ''; my $refund_days = $opt{'card_refund-days'} || 120; -my $refund_right = ''; -$refund_right = 'Refund credit card payment' if $cust_pay->payby eq 'CARD'; -$refund_right = 'Refund Echeck payment' if $cust_pay->payby eq 'CHEK'; +my @refund_right = grep { $opt{$_} } $FS::CurrentUser::CurrentUser->refund_rights($cust_pay->payby); if ( $cust_pay->closed !~ /^Y/i - && $cust_pay->payby =~ /^(CARD|CHEK)$/ + && $cust_pay->payby =~ /^(CARD|CHEK|BILL)$/ && time-$cust_pay->_date < $refund_days*86400 && $cust_pay->unrefunded > 0 - && $opt{$refund_right} + && scalar(@refund_right) ) { + my $refundtitle = ($cust_pay->payby =~ /^(CARD|CHEK)$/) + ? emt('Send a refund for this payment to the payment gateway') + : emt('Record a refund for this payment'); $refund = qq! (' . emt('refund') . ')'; } -- cgit v1.2.1 From 62bfe13409a16e04599f52edb3ce00ee3031a0f9 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 16 Sep 2015 01:59:07 -0500 Subject: RT#36813: Monthly Recurring Total [change_to_pkgnum handling] --- httemplate/view/cust_main/billing.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index c031ce929..f7ea68a65 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -44,11 +44,13 @@ % 'hashref' => { 'custnum' => $cust_main->custnum, }, % 'extra_sql' => 'AND ( cancel IS NULL OR cancel = 0 ) % AND freq = '. dbh->quote($freq), +% 'order_by' => 'ORDER BY pkgnum', # to ensure old pkgs come before change_to_pkg % }) or next; % % my $freq_pretty = $cust_pkg[0]->part_pkg->freq_pretty; % % my $amount = 0; +% my $skip_pkg = {}; % foreach my $cust_pkg (@cust_pkg) { % my $part_pkg = $cust_pkg->part_pkg; % next if $cust_pkg->susp @@ -57,6 +59,15 @@ % || $cust_pkg->option('no_suspend_bill') % ); % +% #pkg change handling +% next if $skip_pkg->{$cust_pkg->pkgnum}; +% if ($cust_pkg->change_to_pkgnum) { +% #if change is on or before next bill date, use new pkg +% next if $cust_pkg->expire <= $cust_pkg->bill; +% #if change is after next bill date, use old (this) pkg +% $skip_pkg->{$cust_pkg->change_to_pkgnum} = 1; +% } +% % my $pkg_amount = 0; % % #add recurring amounts for this package and its billing add-ons -- cgit v1.2.1 From 0cf5ea1f85245f80e595f853b86aee03e3438042 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Sat, 19 Sep 2015 19:36:55 -0500 Subject: RT#36813: Monthly Recurring Total [fixed order by] --- httemplate/view/cust_main/billing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index f7ea68a65..0c9f74a7c 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -44,7 +44,7 @@ % 'hashref' => { 'custnum' => $cust_main->custnum, }, % 'extra_sql' => 'AND ( cancel IS NULL OR cancel = 0 ) % AND freq = '. dbh->quote($freq), -% 'order_by' => 'ORDER BY pkgnum', # to ensure old pkgs come before change_to_pkg +% 'order_by' => 'ORDER BY COALESCE(start_date,0), pkgnum', # to ensure old pkgs come before change_to_pkg % }) or next; % % my $freq_pretty = $cust_pkg[0]->part_pkg->freq_pretty; -- cgit v1.2.1 From 15a4e1674694b76ecc2af87de479aabe370ac03d Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Tue, 22 Sep 2015 01:08:04 -0500 Subject: RT#37908: Convert existing email-sending code to use common interface [removals and switches to FS::Log] --- httemplate/view/cust_main/payment_history.html | 2 +- httemplate/view/cust_main/payment_history/credit.html | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 1525e9314..c85559543 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -231,7 +231,7 @@ my %opt = ( 'Post refund', 'Post check refund', 'Post cash refund ', 'Refund payment', 'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments', 'Delete payment', 'Unapply payment', - 'Apply credit', 'Delete credit', 'Unapply credit', 'Void credit', 'Unvoid credit', + 'Apply credit', 'Unapply credit', 'Void credit', 'Unvoid credit', 'Delete refund', 'Billing event reports', 'View customer billing events', ) diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index 3eed833d3..db2e5e582 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -1,4 +1,4 @@ -<% $credit. ' '. $reason. $desc. $change_pkg. $apply. $delete. $unapply. $void %> +<% $credit. ' '. $reason. $desc. $change_pkg. $apply . $unapply. $void %> <%init> my( $cust_credit, %opt ) = @_; @@ -138,15 +138,6 @@ $void = ' ('. if $cust_credit->closed !~ /^Y/i && $opt{'Void credit'}; -my $delete = ''; -$delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->crednum, - emt('Are you sure you want to delete this credit?'), - '', - emt('delete') - ) - if $cust_credit->closed !~ /^Y/i - && $opt{'Delete credit'}; - my $unapply = ''; $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum, emt('Are you sure you want to unapply this credit?'), -- cgit v1.2.1 From 727d620374a9798dd2fe630d57e707fe16a63e49 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 28 Sep 2015 20:21:12 -0700 Subject: remove payment deletion, RT#37908 --- httemplate/view/cust_main/payment_history.html | 2 +- httemplate/view/cust_main/payment_history/payment.html | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index c85559543..d81fe9935 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -230,7 +230,7 @@ my %opt = ( 'Apply payment', 'Refund credit card payment', 'Refund Echeck payment', 'Post refund', 'Post check refund', 'Post cash refund ', 'Refund payment', 'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments', - 'Delete payment', 'Unapply payment', + 'Unapply payment', 'Apply credit', 'Unapply credit', 'Void credit', 'Unvoid credit', 'Delete refund', 'Billing event reports', 'View customer billing events', diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index 0ed2f8003..fd336b86c 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -1,5 +1,5 @@ <% $payment. ' '. $info. $desc. - $view. $change_pkg. $apply. $refund. $void. $delete. $unapply + $view. $change_pkg. $apply. $refund. $void. $unapply %> <%init> @@ -185,16 +185,6 @@ $void = areyousure_link("${p}misc/void-cust_pay.cgi?".$cust_pay->paynum, || ( $cust_pay->payby !~ /^(CARD|CHEK)$/ && $opt{'Void payments'} ) ); -my $delete = ''; -$delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum, - emt('Are you sure you want to delete this payment?'), - emt('Delete this payment from the database completely - not recommended'), - emt('delete') - ) - if $cust_pay->closed !~ /^Y/i - && $opt{'deletepayments'} - && $opt{'Delete payment'}; - my $unapply = ''; $unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum, emt('Are you sure you want to unapply this payment?'), -- cgit v1.2.1 From 5e6bfa1548ac370d2cf316e0db44785d83baa453 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 5 Oct 2015 19:09:33 -0700 Subject: ticket_system-appointment-custom_field, RT#34237 --- httemplate/view/cust_main/appointments.html | 36 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/appointments.html b/httemplate/view/cust_main/appointments.html index c907b25bb..9bf5be1d5 100644 --- a/httemplate/view/cust_main/appointments.html +++ b/httemplate/view/cust_main/appointments.html @@ -19,7 +19,9 @@ - <% mt('Type') |h %> +% if ( $custom_field ) { + <% mt('Type') |h %> +% } <% mt('Date') |h %> <% mt('Status') |h %> <% mt('Owner') |h %> @@ -41,10 +43,12 @@ % if $starts > 86400; - - - ><% 'custom field magic type' %> - + +% if ( $custom_field ) { + + ><% $ticket->{"CF.{$custom_field}"} |h %> + +% } ><% $starts_pretty %> @@ -78,20 +82,22 @@ return '' unless $conf->config('ticket_system'); #my $object = $opt{'object'}; #$object = $object->cust_svc if $object->isa('FS::svc_Common'); -my( @tickets ) = $object->tickets; #XXX but actually appointments... filter by presense of the necessary CF? RT::Appointment instead of RT::Ticket ? +my @tickets = $object->appointments; -my ($openlabel, $open_link, $res_link, $thing); -$openlabel = join('/', FS::TicketSystem->statuses ); +my $custom_field = $conf->config('ticket_system-appointment-custom_field'); + +# my ($openlabel, $open_link, $res_link, $thing); +# $openlabel = join('/', FS::TicketSystem->statuses ); # not the nicest way to do this--FS::has_tickets_Common? #if ( $object->isa('FS::cust_main') ) { - $thing = 'customer'; - $open_link = FS::TicketSystem->href_customer_tickets($object->custnum); - - $res_link = FS::TicketSystem->href_customer_tickets( - $object->custnum, - { 'statuses' => [ 'resolved' ] } - ); +# $thing = 'customer'; +# $open_link = FS::TicketSystem->href_customer_tickets($object->custnum); +# +# $res_link = FS::TicketSystem->href_customer_tickets( +# $object->custnum, +# { 'statuses' => [ 'resolved' ] } +# ); #} elsif ( $object->isa('FS::cust_svc') ) { # # return '' unless $object->pkgnum; -- cgit v1.2.1