From c1cabbc4cea2e0cfd9e1db668100b97069140cf5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 26 Jul 2012 14:02:36 -0700 Subject: add anniversary date, RT#18631 --- httemplate/view/cust_main/misc.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index a0ab403e8..dc6da53f1 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -130,6 +130,20 @@ % } +% if ( $conf->exists('cust_main-enable_anniversary_date') ) { +% my $dt = $cust_main->anniversary_date ne '' +% ? DateTime->from_epoch( 'epoch' => $cust_main->anniversary_date, +% 'time_zone' =>'floating', +% ) +% : ''; + + + <% mt('Anniversary Date') |h %> + <% $dt ? $dt->strftime($date_format) : '' %> + + +% } + % if ( $conf->exists('cust_main-require_censustract') ) { -- cgit v1.2.1 From f24c4bebce257bfcc61ba07fd3d16c5c0d730071 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 31 Jul 2012 23:02:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill_void.html | 56 ++++++++++++++++++++++ httemplate/view/cust_main/payment_history.html | 13 ++++- .../view/cust_main/payment_history/invoice.html | 14 +++++- .../cust_main/payment_history/voided_invoice.html | 52 ++++++++++++++++++++ 4 files changed, 133 insertions(+), 2 deletions(-) create mode 100755 httemplate/view/cust_bill_void.html create mode 100644 httemplate/view/cust_main/payment_history/voided_invoice.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html new file mode 100755 index 000000000..c7c5da146 --- /dev/null +++ b/httemplate/view/cust_bill_void.html @@ -0,0 +1,56 @@ +<& /elements/header.html, mt('Voided Invoice'), menubar( + emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", +) &> + +%#XXX something very big and obvious showing its voided... + +% #voided PDFs? +% #if ( $conf->exists('invoice_latex') ) { +%# +%# <% mt('View typeset invoice PDF') |h %> +%#

+% #} + +% if ( $conf->exists('invoice_html') ) { + <% join('', $cust_bill_void->print_html(\%opt) ) %> +% } else { +
<% join('', $cust_bill_void->print_text(\%opt) ) %>
+% } + +<& /elements/footer.html &> +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('View invoices'); + +my $invnum; +my($query) = $cgi->keywords; +if ( $query =~ /^(\d+)$/ ) { + $invnum = $1; +} else { + $invnum = $cgi->param('invnum'); +} + +my $conf = new FS::Conf; + +my %opt = ( + 'unsquelch_cdr' => $conf->exists('voip-cdr_email'), +); + +my $cust_bill_void = qsearchs({ + 'select' => 'cust_bill_void.*', + 'table' => 'cust_bill_void', + #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'quotationnum' => $quotationnum }, + #'extra_sql' => ' AND '. $curuser->agentnums_sql, +}); +die "Quotation #$quotationnum not found!" unless $quotation; + +my $custnum = $cust_bill->custnum; +my $display_custnum = $cust_bill->cust_main->display_custnum; + +#my $link = "invnum=$invnum"; + + diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 9e08c0c5d..166addbf4 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -277,7 +277,9 @@ % ? sprintf("$money_char\%.2f", $item->{'charge'}) % : exists($item->{'charge_nobal'}) % ? sprintf("$money_char\%.2f", $item->{'charge_nobal'}) -% : ''; +% : exists($item->{'void_charge'}) +% ? sprintf("$money_char\%.2f", $item->{'void_charge'}) +% : ''; % % my $payment = exists($item->{'payment'}) % ? sprintf("- $money_char\%.2f", $item->{'payment'}) @@ -428,6 +430,15 @@ foreach my $cust_bill ($cust_main->cust_bill) { $num_cust_bill++; } +#voided invoices +foreach my $cust_bill_void ($cust_main->cust_bill_void) { + push @history, { + 'date' => $cust_bill_void->_date, + 'desc' => include('payment_history/voided_invoice.html', $cust_bill_void, %opt ), + 'void_charge' => $cust_bill_void->charged, + }; +} + #statements foreach my $cust_statement ($cust_main->cust_statement) { push @history, { diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html index 3028f0f69..96a9f5456 100644 --- a/httemplate/view/cust_main/payment_history/invoice.html +++ b/httemplate/view/cust_main/payment_history/invoice.html @@ -1,4 +1,4 @@ -<% $link %><% $invoice %><% $link ? '' : '' %><% $delete %><% $under %> +<% $link %><% $invoice %><% $link ? '' : '' %><% "$void$delete$under" %> <%init> my( $cust_bill, %opt ) = @_; @@ -26,6 +26,18 @@ my $link = $curuser->access_right('View invoices') ? qq!! : ''; +my $void = ''; +if ( $cust_bill->closed !~ /^Y/i && $curuser->access_right('Void invoices') ) { + $void = + ' ('. include('/elements/popup_link.html', + 'label' => emt('void'), + 'action' => "${p}misc/void-cust_bill.html?;invnum=". + $cust_bill->invnum, + 'actionlabel' => emt('Void Invoice'), + ). + ')'; +} + my $delete = ''; $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", emt('Are you sure you want to delete this invoice?'), diff --git a/httemplate/view/cust_main/payment_history/voided_invoice.html b/httemplate/view/cust_main/payment_history/voided_invoice.html new file mode 100644 index 000000000..422edb2f6 --- /dev/null +++ b/httemplate/view/cust_main/payment_history/voided_invoice.html @@ -0,0 +1,52 @@ +<% $link %><% $invoice %><% $link ? '' : '' %> +<% mt("voided [_1]", time2str($date_format, $cust_bill_void->void_date) ) |h %> +% my $void_user = $cust_bill_void->void_access_user; +% if ($void_user) { + by <% $void_user->username %> +% } +<% "$unvoid$delete$under" %> +<%init> + +my( $cust_bill_void, %opt ) = @_; + +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill_void->display_invnum, $cust_bill_void->charged); + +my $under = ''; + +my $invnum = $cust_bill_void->invnum; + +#XXX use cust_bill.cgi or? +my $link = $curuser->access_right('View invoices') + ? qq!! + : ''; + +my $unvoid = ''; #XXX unvoid + +my $delete = ''; +$delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", + emt('Are you sure you want to delete this invoice?'), + emt('Delete this invoice from the database completely'), + emt('delete') + ) + if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ); + +my $events = ''; +#1.9 +if ( $cust_bill_void->num_cust_event + && ( $curuser->access_right('Billing event reports') + || $curuser->access_right('View customer billing events') + ) + ) { + $under .= + qq!
( !. + emt('View invoice events').' )'; +} +$under = ''.$under.'' if length($under); + + -- cgit v1.2.1 From 55675d6cdd93f00b7c0ac93403e8c4d66567a729 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 13:16:42 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill_void.html | 13 +++++++++---- .../view/cust_main/payment_history/voided_invoice.html | 3 +-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html index c7c5da146..148c0ed7e 100755 --- a/httemplate/view/cust_bill_void.html +++ b/httemplate/view/cust_bill_void.html @@ -11,6 +11,11 @@ %#

% #} +
VOID
+ % if ( $conf->exists('invoice_html') ) { <% join('', $cust_bill_void->print_html(\%opt) ) %> % } else { @@ -43,13 +48,13 @@ my $cust_bill_void = qsearchs({ 'select' => 'cust_bill_void.*', 'table' => 'cust_bill_void', #'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', - 'hashref' => { 'quotationnum' => $quotationnum }, + 'hashref' => { 'invnum' => $invnum }, #'extra_sql' => ' AND '. $curuser->agentnums_sql, }); -die "Quotation #$quotationnum not found!" unless $quotation; +die "Voided invoice #$invnum not found!" unless $cust_bill_void; -my $custnum = $cust_bill->custnum; -my $display_custnum = $cust_bill->cust_main->display_custnum; +my $custnum = $cust_bill_void->custnum; +my $display_custnum = $cust_bill_void->cust_main->display_custnum; #my $link = "invnum=$invnum"; diff --git a/httemplate/view/cust_main/payment_history/voided_invoice.html b/httemplate/view/cust_main/payment_history/voided_invoice.html index 422edb2f6..7bf206352 100644 --- a/httemplate/view/cust_main/payment_history/voided_invoice.html +++ b/httemplate/view/cust_main/payment_history/voided_invoice.html @@ -21,9 +21,8 @@ my $under = ''; my $invnum = $cust_bill_void->invnum; -#XXX use cust_bill.cgi or? my $link = $curuser->access_right('View invoices') - ? qq!! + ? qq!! : ''; my $unvoid = ''; #XXX unvoid -- cgit v1.2.1 From bec3b6c2bf97d66b992866d7ee7295f1f05452e6 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 14:01:14 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_main/payment_history/payment.html | 2 +- httemplate/view/cust_main/payment_history/voided_invoice.html | 8 +++++++- httemplate/view/cust_main/payment_history/voided_payment.html | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index d7322a2d6..ff269bfaf 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -181,7 +181,7 @@ $void = areyousure_link("${p}misc/void-cust_pay.cgi?".$cust_pay->paynum, && $curuser->access_right('Echeck void') ) || ( $cust_pay->payby !~ /^(CARD|CHEK)$/ - && $curuser->access_right('Regular void') + && $curuser->access_right('Void payments') ) ) ); diff --git a/httemplate/view/cust_main/payment_history/voided_invoice.html b/httemplate/view/cust_main/payment_history/voided_invoice.html index 7bf206352..15393cbf5 100644 --- a/httemplate/view/cust_main/payment_history/voided_invoice.html +++ b/httemplate/view/cust_main/payment_history/voided_invoice.html @@ -25,7 +25,13 @@ my $link = $curuser->access_right('View invoices') ? qq!! : ''; -my $unvoid = ''; #XXX unvoid +my $unvoid = ''; +$unvoid = areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_bill_void->invnum, + emt('Are you sure you want to unvoid this invoice?'), + emt('Unvoid this invoice'), + emt('unvoid') + ) + if $cust_bill_void->closed !~ /^Y/ && $curuser->access_right('Unvoid invoices'); my $delete = ''; $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum", diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 2f038be41..88b5e0a84 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -31,6 +31,6 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->p emt('Unvoid this payment from the database') . $unvoidmsg, emt('unvoid') ) - if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid') ); + if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid payments') ); -- cgit v1.2.1 From 4d6c465f4b32a49f8bce091f6cb5abb209123ec2 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 1 Aug 2012 14:04:50 -0700 Subject: invoice voiding, RT#18677 --- httemplate/view/cust_bill.cgi | 2 -- httemplate/view/cust_bill_void.html | 20 +++++++++++++++++++- httemplate/view/quotation.html | 2 -- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index a8b4ac15c..95ce60b1d 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -166,8 +166,6 @@ die "Invoice #$invnum not found!" unless $cust_bill; my $custnum = $cust_bill->custnum; my $display_custnum = $cust_bill->cust_main->display_custnum; -#my $printed = $cust_bill->printed; - my $link = "invnum=$invnum"; $link .= ';template='. uri_escape($template) if $template; $link .= ';notice_name='. $notice_name if $notice_name; diff --git a/httemplate/view/cust_bill_void.html b/httemplate/view/cust_bill_void.html index 148c0ed7e..2c526747b 100755 --- a/httemplate/view/cust_bill_void.html +++ b/httemplate/view/cust_bill_void.html @@ -2,7 +2,19 @@ emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum", ) &> -%#XXX something very big and obvious showing its voided... + +<% areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_bill_void->invnum, + emt('Are you sure you want to unvoid this invoice?'), + emt('Unvoid this invoice'), #tooltip + emt('Unvoid this invoice') #link + ) +%> +

% #voided PDFs? % #if ( $conf->exists('invoice_latex') ) { @@ -11,6 +23,7 @@ %#

% #} +%#something very big and obvious showing its voided...
'.$label.''; +} + diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html index 461b5dfb6..a88acf82b 100755 --- a/httemplate/view/quotation.html +++ b/httemplate/view/quotation.html @@ -44,8 +44,6 @@ XXX resending quotations % } % #plaintext quotations?
<% join('', $quotation->print_text() ) %>
- - <& /elements/footer.html &> <%init> -- cgit v1.2.1 From e881063d6e46d991003cf8fae96d8d36780fedcd Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 2 Aug 2012 19:39:20 -0700 Subject: per-customer prorate day, RT#17891 --- httemplate/view/cust_main/billing.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index b2a0efdef..5c46803d2 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -23,6 +23,14 @@ <% $balance %> +% if ( $conf->exists('cust_main-select-prorate_day') ) { + + <% mt('Prorate day of month') |h %> + <% $cust_main->prorate_day %> + + +% } + % if ( $conf->exists('cust_main-select-billday') % && ($cust_main->payby eq 'CARD' || $cust_main->payby eq 'CHEK') ) { -- cgit v1.2.1 From 5a204201503f8e0db6087db6e53b84297cbc739a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 10 Aug 2012 13:54:14 -0700 Subject: add national id # handling for my, RT#18543 --- httemplate/view/cust_main/misc.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index dc6da53f1..9713b2469 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -102,6 +102,26 @@ <% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %> +% my $id_country = $conf->config('national_id-country'); +% if ( $id_country ) { +% if ( $id_country eq 'MY' ) { + +% my($old, $nric) = ( '', ''); +% if ( $cust_main->national_id =~ /^\w\d{9}$/ ) { + <% mt('Old IC/Passport') |h %> +% } elsif ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { + <% mt('NRIC') |h %> +% } else { +% warn "unknown national_id format"; + +% } + <% $cust_main->national_id |h %> + +% } else { +% warn "unknown national_id-country $id_country"; +% } +% } + % if ( $conf->exists('cust_main-enable_birthdate') ) { % my $dt = $cust_main->birthdate ne '' % ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, -- cgit v1.2.1 From f674b7c9b094749fcef770d1ae03640b69b1ec83 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 28 Aug 2012 02:05:55 -0700 Subject: remove validation from national_id old format per customer, RT#18543 --- httemplate/view/cust_main/misc.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 9713b2469..263c266e7 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -107,13 +107,13 @@ % if ( $id_country eq 'MY' ) { % my($old, $nric) = ( '', ''); -% if ( $cust_main->national_id =~ /^\w\d{9}$/ ) { - <% mt('Old IC/Passport') |h %> -% } elsif ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { +% if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) { <% mt('NRIC') |h %> -% } else { -% warn "unknown national_id format"; - +% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) { + <% mt('Old IC/Passport') |h %> +% #} else { +% # warn "unknown national_id format"; +%# % } <% $cust_main->national_id |h %> -- cgit v1.2.1 From 56e92333570e8b1bb6afb7374e9624b76946c749 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 3 Sep 2012 15:39:51 -0700 Subject: display service address when it's the same as billing, #18949 / #940 --- httemplate/view/cust_main/contacts.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html index 9c6069182..d65af669a 100644 --- a/httemplate/view/cust_main/contacts.html +++ b/httemplate/view/cust_main/contacts.html @@ -1,13 +1,18 @@ % my %addr_label = ('bill' => 'Billing address', 'ship' => 'Service address'); %# Locations (possibly break this out) -% my @which = ('bill'); -% push @which, 'ship' if $cust_main->has_ship_address; +% my @which = ('bill', 'ship'); % while (@which) { % my $this = shift @which; % my $method = $this.'_location'; % my $location = $cust_main->$method; -<% mt( $addr_label{$this} ) |h %> +<% mt( $addr_label{$this} ) |h %> +% if ( $this eq 'ship' and +% $cust_main->bill_locationnum == $cust_main->ship_locationnum ) +% { + (<% mt('same as billing') %>) +% } + % if ( $this eq 'bill' ) { -- cgit v1.2.1 From 36a1e9c1661fb552d368f2f675dcb0793d733748 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 23 Sep 2012 18:07:47 -0700 Subject: export host selection per service, RT#17914 --- .../view/elements/tr-svc_export_machine.html | 27 ++++++++++++++++++++++ httemplate/view/svc_acct/basics.html | 5 ++++ 2 files changed, 32 insertions(+) create mode 100644 httemplate/view/elements/tr-svc_export_machine.html (limited to 'httemplate/view') diff --git a/httemplate/view/elements/tr-svc_export_machine.html b/httemplate/view/elements/tr-svc_export_machine.html new file mode 100644 index 000000000..1ba8d74a1 --- /dev/null +++ b/httemplate/view/elements/tr-svc_export_machine.html @@ -0,0 +1,27 @@ +% foreach my $part_export (@part_export) { +% my $label = ( $part_export->exportname +% ? $part_export->exportname +% : $part_export->label +% ). +% ' hostname'; +% +% my $svc_export_machine = qsearchs('svc_export_machine', { +% 'svcnum' => $opt{svc}->svcnum, +% 'exportnum' => $part_export->exportnum, +% }); + + <& tr.html, + 'label' => $label, + 'value' => $svc_export_machine + ? $svc_export_machine->part_export_machine->machine + : '', + &> +% } +<%init> + +my %opt = @_; + +my @part_export = grep { $_->machine eq '_SVC_MACHINE' } + $opt{part_svc}->part_export; + + diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html index bcd84696e..1cdf77615 100644 --- a/httemplate/view/svc_acct/basics.html +++ b/httemplate/view/svc_acct/basics.html @@ -56,6 +56,11 @@ &> % } +<& /view/elements/tr-svc_export_machine.html, + 'svc' => $svc_acct, + 'part_svc' => $part_svc, +&> + % if ($svc_acct->uid ne '') { <& /view/elements/tr.html, label=>mt('UID'), value=>$svc_acct->uid &> % } -- cgit v1.2.1