summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_bill.cgi2
-rwxr-xr-xhttemplate/view/cust_bill_void.html79
-rw-r--r--httemplate/view/cust_main/billing.html8
-rw-r--r--httemplate/view/cust_main/contacts.html11
-rw-r--r--httemplate/view/cust_main/custom_content/.birthdate.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.small_custview.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.svc_Common.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.svc_acct.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.svc_hardware.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/custom_content/.svc_phone.html.swpbin12288 -> 0 bytes
-rw-r--r--httemplate/view/cust_main/misc.html34
-rw-r--r--httemplate/view/cust_main/payment_history.html13
-rw-r--r--httemplate/view/cust_main/payment_history/invoice.html14
-rw-r--r--httemplate/view/cust_main/payment_history/payment.html2
-rw-r--r--httemplate/view/cust_main/payment_history/voided_invoice.html57
-rw-r--r--httemplate/view/cust_main/payment_history/voided_payment.html2
-rw-r--r--httemplate/view/elements/tr-svc_export_machine.html27
-rwxr-xr-xhttemplate/view/quotation.html2
-rw-r--r--httemplate/view/svc_acct/basics.html5
20 files changed, 245 insertions, 11 deletions
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
new file mode 100755
index 000000000..2c526747b
--- /dev/null
+++ b/httemplate/view/cust_bill_void.html
@@ -0,0 +1,79 @@
+<& /elements/header.html, mt('Voided Invoice'), menubar(
+ emt("View this customer (#[_1])",$display_custnum) => "${p}view/cust_main.cgi?$custnum",
+) &>
+
+<SCRIPT TYPE="text/javascript">
+function areyousure(href, message) {
+ if (confirm(message) == true)
+ window.location.href = href;
+}
+</SCRIPT>
+<% 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
+ )
+%>
+<BR><BR>
+
+% #voided PDFs?
+% #if ( $conf->exists('invoice_latex') ) {
+%#
+%# <A HREF="<% $p %>view/cust_bill-pdf.cgi?<% $link %>"><% mt('View typeset invoice PDF') |h %></A>
+%# <BR><BR>
+% #}
+
+%#something very big and obvious showing its voided...
+<DIV STYLE="color:#FF0000; font-size:1000%; font-weight:bold; z-index:100;
+ position: absolute; top: 300px; left: 130px;
+ zoom: 1; filter: alpha(opacity=25); opacity: 0.25;
+">VOID</DIV>
+
+% if ( $conf->exists('invoice_html') ) {
+ <% join('', $cust_bill_void->print_html(\%opt) ) %>
+% } else {
+ <PRE><% join('', $cust_bill_void->print_text(\%opt) ) %></PRE>
+% }
+
+<& /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' => { 'invnum' => $invnum },
+ #'extra_sql' => ' AND '. $curuser->agentnums_sql,
+});
+die "Voided invoice #$invnum not found!" unless $cust_bill_void;
+
+my $custnum = $cust_bill_void->custnum;
+my $display_custnum = $cust_bill_void->cust_main->display_custnum;
+
+#my $link = "invnum=$invnum";
+
+sub areyousure_link {
+ my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
+ '<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>';
+}
+
+</%init>
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 @@
<TD BGCOLOR="#ffffff"><B><% $balance %></B></TD>
</TR>
+% if ( $conf->exists('cust_main-select-prorate_day') ) {
+<TR>
+ <TD ALIGN="right"><% mt('Prorate day of month') |h %></TD>
+ <TD BGCOLOR="#ffffff"><% $cust_main->prorate_day %>
+ </TD>
+</TR>
+% }
+
% if ( $conf->exists('cust_main-select-billday')
% && ($cust_main->payby eq 'CARD' || $cust_main->payby eq 'CHEK') ) {
<TR>
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;
-<FONT CLASS="fsinnerbox-title"><% mt( $addr_label{$this} ) |h %></FONT>
+<FONT CLASS="fsinnerbox-title"><% mt( $addr_label{$this} ) |h %>
+% if ( $this eq 'ship' and
+% $cust_main->bill_locationnum == $cust_main->ship_locationnum )
+% {
+ (<% mt('same as billing') %>)
+% }
+</FONT>
<TABLE CLASS="fsinnerbox">
% if ( $this eq 'bill' ) {
diff --git a/httemplate/view/cust_main/custom_content/.birthdate.html.swp b/httemplate/view/cust_main/custom_content/.birthdate.html.swp
deleted file mode 100644
index 9571d22cf..000000000
--- a/httemplate/view/cust_main/custom_content/.birthdate.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.small_custview.html.swp b/httemplate/view/cust_main/custom_content/.small_custview.html.swp
deleted file mode 100644
index a39f52dde..000000000
--- a/httemplate/view/cust_main/custom_content/.small_custview.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp b/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp
deleted file mode 100644
index 0042012f7..000000000
--- a/httemplate/view/cust_main/custom_content/.spouse_birthdate.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.svc_Common.html.swp b/httemplate/view/cust_main/custom_content/.svc_Common.html.swp
deleted file mode 100644
index 15591b96d..000000000
--- a/httemplate/view/cust_main/custom_content/.svc_Common.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.svc_acct.html.swp b/httemplate/view/cust_main/custom_content/.svc_acct.html.swp
deleted file mode 100644
index e2db6d5d1..000000000
--- a/httemplate/view/cust_main/custom_content/.svc_acct.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp b/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp
deleted file mode 100644
index 1106f9ed5..000000000
--- a/httemplate/view/cust_main/custom_content/.svc_hardware.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/custom_content/.svc_phone.html.swp b/httemplate/view/cust_main/custom_content/.svc_phone.html.swp
deleted file mode 100644
index 79b8185e1..000000000
--- a/httemplate/view/cust_main/custom_content/.svc_phone.html.swp
+++ /dev/null
Binary files differ
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index a0ab403e8..263c266e7 100644
--- a/httemplate/view/cust_main/misc.html
+++ b/httemplate/view/cust_main/misc.html
@@ -102,6 +102,26 @@
<TD BGCOLOR="#ffffff"><% $cust_main->signupdate ? time2str($date_format, $cust_main->signupdate) : '' %></TD>
</TR>
+% my $id_country = $conf->config('national_id-country');
+% if ( $id_country ) {
+% if ( $id_country eq 'MY' ) {
+ <TR>
+% my($old, $nric) = ( '', '');
+% if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) {
+ <TD ALIGN="right"><% mt('NRIC') |h %></TD>
+% } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) {
+ <TD ALIGN="right"><% mt('Old IC/Passport') |h %></TD>
+% #} else {
+% # warn "unknown national_id format";
+%# <TD ALIGN="right"></TD>
+% }
+ <TD BGCOLOR="#ffffff"><% $cust_main->national_id |h %></TD>
+ </TR>
+% } 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,
@@ -130,6 +150,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',
+% )
+% : '';
+
+ <TR>
+ <TD ALIGN="right"><% mt('Anniversary Date') |h %></TD>
+ <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD>
+ </TR>
+
+% }
+
% if ( $conf->exists('cust_main-require_censustract') ) {
<TR>
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("<DEL>$money_char\%.2f</DEL>", $item->{'void_charge'})
+% : '';
%
% my $payment = exists($item->{'payment'})
% ? sprintf("-&nbsp;$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 ? '</A>' : '' %><% $delete %><% $under %>
+<% $link %><% $invoice %><% $link ? '</A>' : '' %><% "$void$delete$under" %>
<%init>
my( $cust_bill, %opt ) = @_;
@@ -26,6 +26,18 @@ my $link = $curuser->access_right('View invoices')
? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
: '';
+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/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
new file mode 100644
index 000000000..15393cbf5
--- /dev/null
+++ b/httemplate/view/cust_main/payment_history/voided_invoice.html
@@ -0,0 +1,57 @@
+<DEL><% $link %><% $invoice %><% $link ? '</A>' : '' %></DEL>
+<I><% 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 %></I>
+% }
+<% "$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;
+
+my $link = $curuser->access_right('View invoices')
+ ? qq!<A HREF="${p}view/cust_bill_void.html?$invnum">!
+ : '';
+
+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",
+ 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!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
+ emt('View invoice events').' )</A>';
+}
+$under = '<FONT SIZE="-1">'.$under.'</FONT>' if length($under);
+
+</%init>
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') );
</%init>
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;
+
+</%init>
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? <PRE><% join('', $quotation->print_text() ) %></PRE>
-</%doc>
-
<& /elements/footer.html &>
<%init>
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 &>
% }