Skip to content

Commit

Permalink
Companies, make text1 and text2 fields available in XML
Browse files Browse the repository at this point in the history
Affects: Sales Invoice and Despatch Note
  • Loading branch information
steveblamey committed Nov 6, 2020
1 parent cb1cced commit d3f844d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/classes/standard/printController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,8 @@ public function getCompanyDetails()
$details['website'] = 'Web Site: ' . $company->website;
$details['vat_number'] = 'VAT Number: ' . $company->vatnumber;
$details['company_number'] = 'Company Number: ' . $company->companynumber;
$details['co_additonal_text1'] = $company->text1;
$details['co_additonal_text2'] = $company->text2;

return $details;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,8 @@ public function printDespatchNote($status = 'generate')
$extra['company_details']['tel'] = 'Tel : ' . $this->getContactDetails('T');
$extra['company_details']['fax'] = 'Fax : ' . $this->getContactDetails('F');
$extra['company_details']['email'] = 'email: ' . $this->getContactDetails('E');
$extra['company_details']['co_additonal_text1'] = $this->getCompanyDetails()['co_additonal_text1'];
$extra['company_details']['co_additonal_text1'] = $this->getCompanyDetails()['co_additonal_text2'];

// get the despatch location
$extra['despatch_location'] = implode(',', $order->despatch_from->rules_list('from_location'));
Expand Down Expand Up @@ -981,6 +983,9 @@ public function printDespatchNote($status = 'generate')
$delivery_address += $this->formatAddress($customer->getDeliveryAddress($order->del_address_id));
$extra['delivery_address'] = $delivery_address;

$extra['additional_text1'] = $customer->customerdetail->companydetail->text1;
$extra['additional_text2'] = $customer->customerdetail->companydetail->text2;

// generate the xml and add it to the options array
$options['xmlSource'] = $this->generate_xml(array(
'model' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,9 @@ public function printInvoice($status = 'generate')
$extra['tax_description'] = $invoice->customerdetail->companydetail->tax_description;
$extra['vatnumber'] = $invoice->customerdetail->companydetail->vatnumber;

$extra['additional_text1'] = $invoice->customerdetail->companydetail->text1;
$extra['additional_text2'] = $invoice->customerdetail->companydetail->text2;

// get Sales Invoice Notes for default customer or first in customer
$note = DataObjectFactory::Factory('PartyNote');
$party_id = $invoice->customerdetail->companydetail->party_id;
Expand Down

0 comments on commit d3f844d

Please sign in to comment.