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").""; - print ''.$object->client->getNomUrl(1).''; + print ''.$object->thirdparty->getNomUrl(1).''; // Delivery address if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 1e5ace7353e..91972673201 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -99,10 +99,10 @@ if ($id > 0 || ! empty($ref)) print ''; // Customer - if ( is_null($object->client) ) + if ( is_null($object->thirdparty) ) $object->fetch_thirdparty(); print "".$langs->trans("Company").""; - print ''.$object->client->getNomUrl(1).''; + print ''.$object->thirdparty->getNomUrl(1).''; // Discounts print ''.$langs->trans('Discounts').''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ae7c18ac077..827f3976fc8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1420,15 +1420,15 @@ class Commande extends CommonOrder $prod=new Product($this->db); $prod->fetch($idproduct); - $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,$this->client,$mysoc,$tva_npr); - $localtax2_tx=get_localtax($tva_tx,2,$this->client,$mysoc,$tva_npr); + $localtax1_tx=get_localtax($tva_tx,1,$this->thirdparty,$mysoc,$tva_npr); + $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $this->client->price_level) - $price = $prod->multiprices[$this->client->price_level]; + if($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) + $price = $prod->multiprices[$this->thirdparty->price_level]; else $price = $prod->price; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 93d46c05997..da584f9197c 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -171,10 +171,10 @@ if ($id > 0 || ! empty($ref)) print ''; // Customer - if (is_null($object->client)) $object->fetch_thirdparty(); + if (is_null($object->thirdparty)) $object->fetch_thirdparty(); print "".$langs->trans("Company").""; - print ''.$object->client->getNomUrl(1).''; + print ''.$object->thirdparty->getNomUrl(1).''; // Delivery address if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4d216a80264..d89871674b7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1932,7 +1932,7 @@ class Facture extends CommonInvoice $this->date=dol_now(); $this->date_lim_reglement=$this->calculate_date_lim_reglement(); } - $num = $this->getNextNumRef($this->client); + $num = $this->getNextNumRef($this->thirdparty); } else { @@ -1971,7 +1971,7 @@ class Facture extends CommonInvoice if (! $error) { // Define third party as a customer - $result=$this->client->set_as_client(); + $result=$this->thirdparty->set_as_client(); // Si active on decremente le produit principal et ses composants a la validation de facture if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse > 0) @@ -3085,7 +3085,7 @@ class Facture extends CommonInvoice // If not a draft invoice and not temporary invoice if ($facref != 'PROV') { - $maxfacnumber = $this->getNextNumRef($this->client,'last'); + $maxfacnumber = $this->getNextNumRef($this->thirdparty,'last'); $ventilExportCompta = $this->getVentilExportCompta(); // If there is no invoice into the reset range and not already dispatched, we can delete if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index b07a8f8c2d4..c5a7cfcdab2 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -175,7 +175,7 @@ if ($id > 0 || ! empty($ref)) // Customer print "".$langs->trans("Company").""; - print ''.$object->client->getNomUrl(1,'compta').''; + print ''.$object->thirdparty->getNomUrl(1,'compta').''; print ""; dol_fiche_end(); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 9b381c1af04..275724d3012 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -281,7 +281,7 @@ if ($action == 'create') $object->fetch_thirdparty(); // Third party - print ''.$langs->trans("Customer").''.$object->client->getNomUrl(1,'customer').''; + print ''.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1,'customer').''; print ''; print $langs->trans("Comment"); print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 64813c56f1d..e2883081452 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -540,7 +540,7 @@ if (empty($reshook)) $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('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/compta/paiement.php b/htdocs/compta/paiement.php index 37b6ebdc3eb..fa1341dcbc6 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -449,14 +449,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - print ''; + print ''; dol_fiche_head(); print ''; // Third party - print '\n"; + print '\n"; // Date payment print ''; // Third party - print ""; + print ""; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { @@ -1824,7 +1824,7 @@ else if ($id > 0 || ! empty($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/fichinter/contact.php b/htdocs/fichinter/contact.php index b92c1442d14..b64a16f91ba 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -133,11 +133,11 @@ if ($id > 0 || ! empty($ref)) print ""; // Customer - if ( is_null($object->client) ) + if ( is_null($object->thirdparty) ) $object->fetch_thirdparty(); print ""; - print ''; + print ''; 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")."'.$object->client->getNomUrl(1).'
'.$object->thirdparty->getNomUrl(1).'
"; print ''; diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 38176068d72..aca31d4e7c2 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -111,7 +111,7 @@ if ($object->id) print ''; // Societe - print "".$langs->trans("Company")."".$object->client->getNomUrl(1).""; + print "".$langs->trans("Company")."".$object->thirdparty->getNomUrl(1).""; print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").''; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0e11079f476..e209dd741d6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -975,7 +975,7 @@ class FactureFournisseur extends CommonInvoice } else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { - $num = $this->getNextNumRef($this->client); + $num = $this->getNextNumRef($this->thirdparty); } else { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 59bc805a120..31c2d0aba00 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1184,12 +1184,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','alpha'),'email'); + $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver','alpha'),'email'); $sendtoid = GETPOST('receiver','alpha'); } } @@ -2451,7 +2451,7 @@ elseif (! empty($object->id)) 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/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 64f459886ae..b7e22e9e42f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -976,12 +976,12 @@ if (empty($reshook)) // Recipient was provided from combo list if ($_POST['receiver'] == '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($_POST['receiver'],'email'); + $sendto = $object->thirdparty->contact_get_property($_POST['receiver'],'email'); $sendtoid = $_POST['receiver']; } } @@ -1120,7 +1120,7 @@ if (empty($reshook)) $outputlangs = $langs; $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); @@ -2423,7 +2423,7 @@ else 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/livraison/card.php b/htdocs/livraison/card.php index 8a815c31edb..9ae66ee685e 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -255,7 +255,7 @@ if ($action == 'builddoc') // En get ou en post $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('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); @@ -413,7 +413,7 @@ if ($action == 'create') // Seems to no be used $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); @@ -755,7 +755,7 @@ else $outputlangs = $langs; $newlang=''; if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (empty($newlang)) $newlang=$object->client->default_lang; + if (empty($newlang)) $newlang=$object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ef126a85b52..4632c7ebb5c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -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); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 5f9fc3eacd6..f5675db86f3 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -221,16 +221,16 @@ class SupplierProposal 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 { @@ -1662,7 +1662,7 @@ class SupplierProposal 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 @@ -1764,7 +1764,7 @@ class SupplierProposal extends CommonObject $values = array( "'".$this->db->idate($now)."'", $product->fk_product, - $this->client->id, + $this->thirdparty->id, "'".$product->ref_fourn."'", $price, $qty, diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 4e9f3affa50..a3799c0eb29 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -87,10 +87,10 @@ if ($id > 0 || ! empty($ref)) print ''; // Customer - if ( is_null($object->client) ) + if ( is_null($object->thirdparty) ) $object->fetch_thirdparty(); print "".$langs->trans("Supplier").""; - print ''.$object->client->getNomUrl(1).''; + print ''.$object->thirdparty->getNomUrl(1).''; print ''.$langs->trans('SupplierProposalDate').''; print dol_print_date($object->date_livraison,'daytext');