diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-01-18 18:13:16 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-01-18 18:13:16 -0800 |
commit | 03c12b4dabfcaabc218f39ee13557edebc13931d (patch) | |
tree | 0d915cf9e2bbf278a48500b5d125206ab78477a2 /FS/FS/quotation.pm | |
parent | 0b6bd6405107c1abf8f2c5e2bc1b569870a02309 (diff) |
email quotations, RT#22232, RT#20688
Diffstat (limited to 'FS/FS/quotation.pm')
-rw-r--r-- | FS/FS/quotation.pm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/FS/FS/quotation.pm b/FS/FS/quotation.pm index 5710b38..44b72f4 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. |