county state zip country daytime night fax
ship_first ship_last ship_company ship_address1 ship_address2 ship_city
ship_state ship_zip ship_country ship_daytime ship_night ship_fax
- payby payinfo payname
+ payby payinfo payname paystart_month paystart_year payissue payip
);
use subs qw(_provision);
'MasterCard' => 'MasterCard',
'Discover' => 'Discover card',
'American Express' => 'American Express card',
+ 'Switch' => 'Switch',
+ 'Solo' => 'Solo',
},
};
'payname' => $payname,
'paybatch' => $paybatch,
'paycvv' => $paycvv,
- map { $_ => $p->{$_} } qw( address1 address2 city state zip )
+ map { $_ => $p->{$_} } qw( paystart_month paystart_year payissue payip
+ address1 address2 city state zip )
);
return { 'error' => $error } if $error;
if ( $p->{'save'} ) {
my $new = new FS::cust_main { $cust_main->hash };
$new->set( $_ => $p->{$_} )
- foreach qw( payname address1 address2 city state zip payinfo );
+ foreach qw( payname paystart_month paystart_year payissue payip
+ address1 address2 city state zip payinfo );
$new->set( 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01' );
$new->set( 'payby' => $p->{'auto'} ? 'CARD' : 'DCRD' );
my $error = $new->replace($cust_main);
return { 'error' => '',
'invnum' => $invnum,
'invoice_text' => join('', $cust_bill->print_text ),
+ 'invoice_html' => $cust_bill->print_html,
};
}
+sub invoice_logo {
+ my $p = shift;
+
+ #sessioning for this? how do we get the session id to the backend invoice
+ # template so it can add it to the link, blah
+
+ my $templatename = $p->{'templatename'};
+
+ #false laziness-ish w/view/cust_bill-logo.cgi
+
+ my $conf = new FS::Conf;
+ if ( $templatename =~ /^([^\.\/]*)$/ && $conf->exists("logo_$1.png") ) {
+ $templatename = "_$1";
+ } else {
+ $templatename = '';
+ }
+
+ my $filename = "logo$templatename.png";
+
+ return { 'error' => '',
+ 'logo' => $conf->config_binary($filename),
+ 'content_type' => 'image/png', #should allow gif, jpg too
+ };
+}
+
+
sub list_invoices {
my $p = shift;
my $session = _cache->get($p->{'session_id'})