diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a83600072d4..99f5058ad3f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -247,16 +247,16 @@ class Propal extends CommonObject $productdesc = $prod->description; - $tva_tx = get_default_tva($mysoc,$this->client,$prod->id); - $tva_npr = get_default_npr($mysoc,$this->client,$prod->id); + $tva_tx = get_default_tva($mysoc,$this->thirdparty,$prod->id); + $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; - $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->client,$tva_npr); - $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->client,$tva_npr); + $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->thirdparty,$tva_npr); + $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->thirdparty,$tva_npr); // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $this->client->price_level) + if($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { - $price = $prod->multiprices[$this->client->price_level]; + $price = $prod->multiprices[$this->thirdparty->price_level]; } else { @@ -1975,7 +1975,7 @@ class Propal extends CommonObject if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->client->default_lang); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } //$ret=$object->fetch($id); // Reload to get new records diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 544c5ab27e3..33504a1d27b 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -177,7 +177,7 @@ if ($object->id > 0) // Customer print "
| '.$langs->trans('Company').' | '.$facture->client->getNomUrl(4)." | ||
| '.$langs->trans('Company').' | '.$facture->thirdparty->getNomUrl(4)." | ||
| '.$langs->trans('Date').' | '; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7de64135245..7cc889a67e9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -130,12 +130,6 @@ abstract class CommonObject * @see fetch_thirdparty() */ public $thirdparty; - /** - * @deprecated - * @var Societe A related customer - * @see thirdparty - */ - public $client; /** * @var User A related user @@ -1016,12 +1010,10 @@ abstract class CommonObject if ($idtofetch) { $thirdparty = new Societe($this->db); $result = $thirdparty->fetch($idtofetch); - $this->client = $thirdparty; // deprecated $this->thirdparty = $thirdparty; // Use first price level if level not defined for third party if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level)) { - $this->client->price_level = 1; // deprecated $this->thirdparty->price_level = 1; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7d8ac5f1750..9be021b975e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1358,7 +1358,7 @@ function dol_meta_create($object) if (is_dir($dir)) { $nblignes = count($object->lines); - $client = $object->client->name . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town; + $client = $object->thirdparty->name . " " . $object->thirdparty->address . " " . $object->thirdparty->zip . " " . $object->thirdparty->town; $meta = "REFERENCE=\"" . $object->ref . "\" DATE=\"" . dol_print_date($object->date,'') . "\" NB_ITEMS=\"" . $nblignes . "\" diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 84dec7b817e..9e26b31b0ce 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -289,11 +289,11 @@ class doc_generic_order_odt extends ModelePDFCommandes { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->client; + else $socobject = $object->thirdparty; } else { - $socobject=$object->client; + $socobject=$object->thirdparty; } // Make substitution diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 25ae8c7f015..f8097249a5b 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -556,12 +556,12 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R'); - if ($object->client->code_client) + if ($object->thirdparty->code_client) { $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); } if ($showaddress) @@ -576,7 +576,7 @@ class pdf_strato extends ModelePDFContract $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender $posy=42; @@ -614,19 +614,19 @@ class pdf_strato extends ModelePDFContract $result=$object->fetch_contact($arrayidcontact[0]); } - $this->recipient = $object->client; + $this->recipient = $object->thirdparty; //Recipient name // On peut utiliser le nom de la societe du contact if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { $thirdparty = $object->contact; } else { - $thirdparty = $object->client; + $thirdparty = $object->thirdparty; } $this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target', $object); + $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact)?$object->contact:''), $usecontact, 'target', $object); // Show recipient $widthrecbox=100; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index c2fcf108c10..2693a4f013a 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -289,11 +289,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->client; + else $socobject = $object->thirdparty; } else { - $socobject=$object->client; + $socobject=$object->thirdparty; } // Make substitution diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 2cd392a0bd6..a8baaab2282 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -291,14 +291,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else { - $socobject = $object->client; + $socobject = $object->thirdparty; // 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 { - $socobject=$object->client; + $socobject=$object->thirdparty; } // Fetch info for linked propal diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index ae96756b9f0..ddbea30e833 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -1061,7 +1061,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender $posy=42; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 2d30037878d..225ff02e629 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1113,7 +1113,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender $posy=42; @@ -1158,12 +1158,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { $thirdparty = $object->contact; } else { - $thirdparty = $object->client; + $thirdparty = $object->thirdparty; } $carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target',$object); + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target',$object); // Show recipient $widthrecbox=100; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index d1386d646a5..212685ba519 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -320,11 +320,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal { // On peut utiliser le nom de la societe du contact if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->client; + else $socobject = $object->thirdparty; } else { - $socobject=$object->client; + $socobject=$object->thirdparty; } // Make substitution diff --git a/htdocs/don/card.php b/htdocs/don/card.php index cd8a2e174f8..fab2560f816 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -264,7 +264,7 @@ if ($action == 'builddoc') $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8f461a2a0c0..4547a94566a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -501,7 +501,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -1562,7 +1562,7 @@ else if ($id || $ref) $outputlangs = $langs; $newlang=''; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha'); - if (empty($newlang)) $newlang=$object->client->default_lang; + if (empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -1850,7 +1850,7 @@ else if ($id || $ref) if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 2677d06ec7b..5de764922e1 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -530,7 +530,7 @@ if ($id > 0 || ! empty($ref)) $outputlangs = $langs; $newlang=''; if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (empty($newlang)) $newlang=$commande->client->default_lang; + if (empty($newlang)) $newlang=$commande->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 74f50f26a5b..c3f2d28959e 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -123,7 +123,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -152,7 +152,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -410,7 +410,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -515,7 +515,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -612,7 +612,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -647,7 +647,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -668,7 +668,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -688,7 +688,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','alpha')) $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -750,12 +750,12 @@ if (empty($reshook)) // Recipient was provided from combo list if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party { - $sendto = $object->client->email; + $sendto = $object->thirdparty->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property(GETPOST('receiver'),'email'); + $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver'),'email'); $sendtoid = GETPOST('receiver','alpha'); } } @@ -1277,7 +1277,7 @@ else if ($id > 0 || ! empty($ref)) print ' | ||
| ".$langs->trans("Company").' | '.$object->client->getNomUrl(1)." | ||
| ".$langs->trans("Company").' | '.$object->thirdparty->getNomUrl(1)." | ||
| ".$langs->trans("Company")." | "; - print ''.$object->client->getNomUrl(1).' | '.$object->thirdparty->getNomUrl(1).' | '; print "|