projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
during scheduled package changes, keep setup and bill dates, #30223
[freeside.git]
/
FS
/
FS
/
Template_Mixin.pm
diff --git
a/FS/FS/Template_Mixin.pm
b/FS/FS/Template_Mixin.pm
index
fce1a3f
..
2479ef6
100644
(file)
--- a/
FS/FS/Template_Mixin.pm
+++ b/
FS/FS/Template_Mixin.pm
@@
-697,6
+697,10
@@
sub print_generic {
# XXX should be an FS::cust_bill method to set the defaults, instead
# of checking the type here
# XXX should be an FS::cust_bill method to set the defaults, instead
# of checking the type here
+ # info from customer's last invoice before this one, for some
+ # summary formats
+ $invoice_data{'last_bill'} = {};
+
my $last_bill = $self->previous_bill;
if ( $last_bill ) {
my $last_bill = $self->previous_bill;
if ( $last_bill ) {
@@
-757,9
+761,7
@@
sub print_generic {
# ($pr_total is used elsewhere but not as $previous_balance)
$invoice_data{'previous_balance'} = sprintf("%.2f", $pr_total);
# ($pr_total is used elsewhere but not as $previous_balance)
$invoice_data{'previous_balance'} = sprintf("%.2f", $pr_total);
- $invoice_data{'last_bill'} = {
- '_date' => $last_bill->_date, #unformatted
- };
+ $invoice_data{'last_bill'}{'_date'} = $last_bill->_date; #unformatted
my (@payments, @credits);
# for formats that itemize previous payments
foreach my $cust_pay ( qsearch('cust_pay', {
my (@payments, @credits);
# for formats that itemize previous payments
foreach my $cust_pay ( qsearch('cust_pay', {
@@
-801,11
+803,7
@@
sub print_generic {
$invoice_data{'previous_payments'} = [];
$invoice_data{'previous_credits'} = [];
}
$invoice_data{'previous_payments'} = [];
$invoice_data{'previous_credits'} = [];
}
-
- # info from customer's last invoice before this one, for some
- # summary formats
- $invoice_data{'last_bill'} = {};
-
+
if ( $conf->exists('invoice_usesummary', $agentnum) ) {
$invoice_data{'summarypage'} = $summarypage = 1;
}
if ( $conf->exists('invoice_usesummary', $agentnum) ) {
$invoice_data{'summarypage'} = $summarypage = 1;
}
@@
-1370,7
+1368,7
@@
sub print_generic {
# credits
my $credittotal = 0;
foreach my $credit (
# credits
my $credittotal = 0;
foreach my $credit (
- $self->_items_credits( 'template' => $template, 'trim_len' =>
5
0 )
+ $self->_items_credits( 'template' => $template, 'trim_len' =>
4
0 )
) {
my $total;
) {
my $total;
@@
-3009,7
+3007,7
@@
sub _items_cust_bill_pkg {
my $multisection = defined($category) || defined($locationnum);
my $discount_show_always = 0;
my $multisection = defined($category) || defined($locationnum);
my $discount_show_always = 0;
- my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') ||
5
0;
+ my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') ||
4
0;
my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style
my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style
@@
-3026,7
+3024,10
@@
sub _items_cust_bill_pkg {
}) || $cust_main;
$default_locationnum = $h_cust_main->ship_locationnum;
} elsif ( $self->prospectnum ) {
}) || $cust_main;
$default_locationnum = $h_cust_main->ship_locationnum;
} elsif ( $self->prospectnum ) {
- $default_locationnum = $self->prospect_main->cust_location->locationnum;
+ my $cust_location = qsearchs('cust_location',
+ { prospectnum => $self->prospectnum,
+ disabled => '' });
+ $default_locationnum = $cust_location->locationnum if $cust_location;
}
my @b = (); # accumulator for the line item hashes that we'll return
}
my @b = (); # accumulator for the line item hashes that we'll return