summaryrefslogtreecommitdiff
path: root/FS/FS/quotation.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-01-18 18:13:16 -0800
committerIvan Kohler <ivan@freeside.biz>2015-01-18 18:13:16 -0800
commit03c12b4dabfcaabc218f39ee13557edebc13931d (patch)
tree0d915cf9e2bbf278a48500b5d125206ab78477a2 /FS/FS/quotation.pm
parent0b6bd6405107c1abf8f2c5e2bc1b569870a02309 (diff)
email quotations, RT#22232, RT#20688
Diffstat (limited to 'FS/FS/quotation.pm')
-rw-r--r--FS/FS/quotation.pm47
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.