X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fquotation.pm;h=44b72f4923d4f3b93fa90ac77212e1bc6a502f8d;hb=03c12b4dabfcaabc218f39ee13557edebc13931d;hp=5710b383e927f0b08451afd4cd162b7bee973600;hpb=85c78d955fbc2fd6c3991156b387d37c185b9f64;p=freeside.git diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index 5710b383e..44b72f492 100644 --- a/FS/FS/quotation.pm +++ b/FS/FS/quotation.pm @@ -167,6 +167,53 @@ sub _total { } +sub email { + my $self = shift; + my $opt = shift || {}; + if ($opt and !ref($opt)) { + die ref($self). '->email called with positional parameters'; + } + + my $conf = $self->conf; + + my $from = delete $opt->{from}; + + # this is where we set the From: address + $from ||= $conf->config('quotation_from', $self->cust_or_prospect->agentnum ) + || $conf->config('invoice_from', $self->cust_or_prospect->agentnum ); + + $self->SUPER::email( { + 'from' => $from, + %$opt, + }); + +} + +sub email_subject { + my $self = shift; + + my $subject = + $self->conf->config('quotation_subject') #, $self->cust_main->agentnum) + || 'Quotation'; + + #my $cust_main = $self->cust_main; + #my $name = $cust_main->name; + #my $name_short = $cust_main->name_short; + #my $invoice_number = $self->invnum; + #my $invoice_date = $self->_date_pretty; + + eval qq("$subject"); +} + +=item cust_or_prosect + +=cut + +sub cust_or_prospect { + my $self = shift; + $self->custnum ? $self->cust_main : $self->prospect_main; +} + =item cust_or_prospect_label_link P HTML links to either the customer or prospect.