Revert "Fix wrong address used into PDF model of supplier payment"
This reverts commit 22d92c0540.
This commit is contained in:
parent
15ed7584b8
commit
0b893c11fd
@ -1134,30 +1134,4 @@ class Paiement extends CommonObject
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load the third party of object, from id into this->thirdparty
|
|
||||||
*
|
|
||||||
* @param int $force_thirdparty_id Force thirdparty id
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
|
||||||
function fetch_thirdparty($force_thirdparty_id=0)
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
|
||||||
|
|
||||||
if (empty($force_thirdparty_id))
|
|
||||||
{
|
|
||||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first invoice to get him
|
|
||||||
if (!empty($billsarray))
|
|
||||||
{
|
|
||||||
$supplier_invoice = new FactureFournisseur($this->db);
|
|
||||||
if ($supplier_invoice->fetch($billsarray[0]) > 0)
|
|
||||||
{
|
|
||||||
$force_thirdparty_id = $supplier_invoice->fk_soc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -725,12 +725,12 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
|
||||||
$thirdparty = $object->contact;
|
$thirdparty = $object->contact;
|
||||||
} else {
|
} else {
|
||||||
$thirdparty = $object->thirdparty;
|
$thirdparty = $mysoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||||
|
|
||||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$thirdparty,((!empty($object->contact))?$object->contact:null),$usecontact,'target',$object);
|
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target',$object);
|
||||||
|
|
||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=90;
|
$widthrecbox=90;
|
||||||
|
|||||||
@ -738,30 +738,4 @@ class PaiementFourn extends Paiement
|
|||||||
|
|
||||||
return $way;
|
return $way;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load the third party of object, from id into this->thirdparty
|
|
||||||
*
|
|
||||||
* @param int $force_thirdparty_id Force thirdparty id
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
|
||||||
function fetch_thirdparty($force_thirdparty_id=0)
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
|
||||||
|
|
||||||
if (empty($force_thirdparty_id))
|
|
||||||
{
|
|
||||||
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first supplier invoice to get him
|
|
||||||
if (!empty($billsarray))
|
|
||||||
{
|
|
||||||
$supplier_invoice = new FactureFournisseur($this->db);
|
|
||||||
if ($supplier_invoice->fetch($billsarray[0]) > 0)
|
|
||||||
{
|
|
||||||
$force_thirdparty_id = $supplier_invoice->fk_soc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::fetch_thirdparty($force_thirdparty_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user