Get invoice customer contact
Added functionality to get invoice customer contact as contact_xx tags
This commit is contained in:
parent
b45f5039ed
commit
e3bdc8aaaa
@ -270,7 +270,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
// On peut utiliser le nom de la societe du contact
|
// On peut utiliser le nom de la societe du contact
|
||||||
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
|
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
|
||||||
else $socobject = $object->client;
|
else {
|
||||||
|
$socobject = $object->client;
|
||||||
|
// if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
|
||||||
|
$contactobject = $object->contact;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -344,8 +348,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
|||||||
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
|
$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
|
||||||
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
|
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
|
||||||
$array_other=$this->get_substitutionarray_other($outputlangs);
|
$array_other=$this->get_substitutionarray_other($outputlangs);
|
||||||
|
// retrieve contact information for use in invoice as contact_xxx tags
|
||||||
|
$array_thirdparty_contact = array();
|
||||||
|
if ($usecontact)
|
||||||
|
$array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
|
||||||
|
|
||||||
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other);
|
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
|
||||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||||
// Call the ODTSubstitution hook
|
// Call the ODTSubstitution hook
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user