'date' => time2str('%b %o, %Y', $self->_date),
'today' => time2str('%b %o, %Y', $today),
'agent' => _latex_escape($cust_main->agent->agent),
+ 'agent_custid' => _latex_escape($cust_main->agent_custid),
'payname' => _latex_escape($cust_main->payname),
'company' => _latex_escape($cust_main->company),
'address1' => _latex_escape($cust_main->address1),
'address2' => _latex_escape($cust_main->address2),
'city' => _latex_escape($cust_main->city),
'state' => _latex_escape($cust_main->state),
+ #'quantity' => 1,
'zip' => _latex_escape($cust_main->zip),
'footer' => join("\n", $conf->config_orbase('invoice_latexfooter', $template) ),
'smallfooter' => join("\n", $conf->config_orbase('invoice_latexsmallfooter', $template) ),
#'notes' => join("\n", $conf->config('invoice_latexnotes') ),
'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc",
'balance' => $balance_due,
+ 'ship_enable' => $conf->exists('invoice-ship_address'),
+ 'unitprices' => $conf->exists('invoice-unitprice'),
);
+ my $prefix = $cust_main->has_ship_address ? 'ship_' : '';
+ foreach ( qw( contact company address1 address2 city state zip country fax) ){
+ my $method = $prefix.$_;
+ $invoice_data{"ship_$_"} = _latex_escape($cust_main->$method);
+ }
+
my $countrydefault = $conf->config('countrydefault') || 'US';
if ( $cust_main->country eq $countrydefault ) {
$invoice_data{'country'} = '';
map _latex_escape($_), @{$line_item->{'ext_description'}}
);
}
- $invoice_data{'amount'} = $line_item->{'amount'};
+ $invoice_data{'amount'} = $line_item->{'amount'};
+ $invoice_data{'unit_amount'} = $line_item->{'unit_amount'};
+ $invoice_data{'quantity'} = $line_item->{'quantity'};
$invoice_data{'product_code'} = $line_item->{'pkgpart'} || 'N/A';
push @filled_in,
map { my $b=$_; $b =~ s/\$(\w+)/$invoice_data{$1}/eg; $b } @line_item;
@{$detail->{'ext_description'}} = @{$line_item->{'ext_description'}};
}
$detail->{'amount'} = $line_item->{'amount'};
+ $detail->{'unit_amount'} = $line_item->{'unit_amount'};
$detail->{'product_code'} = $line_item->{'pkgpart'} || 'N/A';
push @detail_items, $detail;
'date' => time2str('%b %o, %Y', $self->_date),
'today' => time2str('%b %o, %Y', $today),
'agent' => encode_entities($cust_main->agent->agent),
+ 'agent_custid' => encode_entities($cust_main->agent_custid),
'payname' => encode_entities($cust_main->payname),
'company' => encode_entities($cust_main->company),
'address1' => encode_entities($cust_main->address1),
|| 'Payable upon receipt',
'cid' => $cid,
'template' => $template,
+ 'ship_enable' => $conf->exists('invoice-ship_address'),
+ 'unitprices' => $conf->exists('invoice-unitprice'),
# 'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc",
);
+ my $prefix = $cust_main->has_ship_address ? 'ship_' : '';
+ foreach ( qw( contact company address1 address2 city state zip country fax) ){
+ my $method = $prefix.$_;
+ $invoice_data{"ship_$_"} = encode_entities($cust_main->$method);
+ }
+
if (
defined( $conf->config_orbase('invoice_htmlreturnaddress', $template) )
&& length( $conf->config_orbase('invoice_htmlreturnaddress', $template) )
#pkgpart => $part_pkg->pkgpart,
pkgnum => $cust_bill_pkg->pkgnum,
amount => sprintf("%.2f", $cust_bill_pkg->setup),
+ unit_amount => sprintf("%.2f", $cust_bill_pkg->unitsetup),
+ quantity => $cust_bill_pkg->quantity,
ext_description => \@d,
};
}
#pkgpart => $part_pkg->pkgpart,
pkgnum => $cust_bill_pkg->pkgnum,
amount => sprintf("%.2f", $cust_bill_pkg->recur),
+ unit_amount => sprintf("%.2f", $cust_bill_pkg->unitrecur),
+ quantity => $cust_bill_pkg->quantity,
ext_description => \@d,
-
};
}