Permalink
Browse files

Make sure we have offer number set in all cases

  • Loading branch information...
flack committed Jul 5, 2018
1 parent daa5fbe commit 42f419b77a10b18572469fbb60ed1910bc7b49ff
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/org/openpsa/sales/handler/offer.php
@@ -61,7 +61,6 @@ private function prepare_offer()
$offer = new org_openpsa_sales_salesproject_offer_dba;
$offer->designation = '';
$offer->introduction = $this->_l10n->get('offer intro');
$offer->offer_number = $this->salesproject->code;
$offer->salesproject = $this->salesproject->id;
$offer->notice = $billingdata->remarks;
return $offer;
@@ -91,6 +90,8 @@ public function _handler_delete($handler_id, array $args, array &$data)
public function _handler_edit($handler_id, array $args, array &$data)
{
$this->offer = new org_openpsa_sales_salesproject_offer_dba($args[0]);
$this->salesproject = $this->offer->get_parent();
$this->salesproject->require_do('midgard:update');
return $this->run_form();
}
@@ -107,7 +108,7 @@ private function run_form()
$response = $wf->run();
if ($wf->get_state() == 'save') {
try {
$output_filename = $this->_l10n->get('offer_filename_prefix') . '-' . $this->offer->offer_number . '.pdf';
$output_filename = $this->_l10n->get('offer_filename_prefix') . '-' . $this->salesproject->code . '.pdf';
$this->client->render($output_filename);
midcom::get()->uimessages->add($this->_l10n->get('pdf created'), $this->_l10n->get('please verify the file'));
}

0 comments on commit 42f419b

Please sign in to comment.