$template ||= $self->_agent_template
if $self->can('_agent_template');
+ #the new way
+ $self->set('mode', $params{mode})
+ if $params{mode};
+
my $pkey = $self->primary_key;
my $tmp_template = $self->table. '.'. $self->$pkey. '.XXXXXXXX';
# start setting up summary subtotals
my @summary_subtotals;
my $method = $conf->config('summary_subtotals_method');
- if ( $method and $method ne $conf->config($tc.'sections_method') ) {
+ if ( ( ref($self) ne 'FS::quotation' ) and $method and $method ne $conf->config($tc.'sections_method') ) {
# then re-section them by the correct method
my %section_method = ( by_category => 1 );
if ( $conf->config('summary_subtotals_method') eq 'location' ) {
=cut
use CAM::PDF;
+use IO::Socket::SSL;
use LWP::UserAgent;
use HTTP::Request::Common qw( POST );
use JSON::XS;
my $file = $self->print_pdf(%opt, 'no_addresses' => 1);
my $pages = CAM::PDF->new($file)->numPages;
- my $ua = LWP::UserAgent->new( 'ssl_opts' => { 'verify_hostname'=>0 });
+ my $ua = LWP::UserAgent->new(
+ 'ssl_opts' => {
+ verify_hostname => 0,
+ SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
+ }
+ );
my $response = $ua->request( POST $url, [
'support-key' => scalar($conf->config('support-key')),
'file' => encode_base64($file),
# for location labels: use default location on the invoice date
my $default_locationnum;
- if ( $self->custnum ) {
+ if ( $conf->exists('invoice-all_pkg_addresses') ) {
+ $default_locationnum = 0; # treat them all as non-default
+ } elsif ( $self->custnum ) {
my $h_cust_main;
my @h_search = FS::h_cust_main->sql_h_search($self->_date);
$h_cust_main = qsearchs({
my @details = $cust_bill_pkg->details;
# and I guess they're never bundled either?
- if ( $cust_bill_pkg->setup != 0 ) {
+ if (( $cust_bill_pkg->setup != 0 ) || ( $cust_bill_pkg->setup_show_zero )) {
my $description = $desc;
$description .= ' Setup'
if $cust_bill_pkg->recur != 0
),
};
}
- if ( $cust_bill_pkg->recur != 0 ) {
+ if (( $cust_bill_pkg->recur != 0 ) || ( $cust_bill_pkg->recur_show_zero )) {
#push @b, {
$r = {
'pkgnum' => $cust_bill_pkg->pkgpart, #so it displays in Ref
# append the word 'Setup' to the setup line if there's going to be
# a recur line for the same package (i.e. not a one-time charge)
+ # XXX localization
my $description = $desc;
$description .= ' Setup'
if $cust_bill_pkg->recur != 0
# always pass the svc_label through to the template, even if
# not displaying it as an ext_description
my @svc_labels = map &{$escape_function}($_),
- $cust_pkg->h_labels_short($self->_date, undef, 'I');
-
+ $cust_pkg->h_labels_short($self->_date,
+ undef,
+ 'I',
+ $self->conf->{locale},
+ );
$svc_label = $svc_labels[0];
unless ( $cust_pkg->part_pkg->hide_svc_detail
push @dates, undef if !$prev;
my @svc_labels = map &{$escape_function}($_),
- $cust_pkg->h_labels_short(@dates, 'I');
+ $cust_pkg->h_labels_short(@dates,
+ 'I',
+ $self->conf->{locale});
$svc_label = $svc_labels[0];
# show service labels, unless...