2
0
forked from Wavyzz/dolibarr

NEW Removed deprecated CommonObject::client property. Please use CommonObject::thirdparty instead

This commit is contained in:
Marcos García de La Fuente
2016-04-17 15:24:22 +02:00
parent 54dd1763fe
commit e2c86d3fd8
32 changed files with 87 additions and 95 deletions

View File

@@ -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

View File

@@ -177,7 +177,7 @@ if ($object->id > 0)
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
// Delivery address
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))

View File

@@ -99,10 +99,10 @@ if ($id > 0 || ! empty($ref))
print '</tr>';
// Customer
if ( is_null($object->client) )
if ( is_null($object->thirdparty) )
$object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
// Discounts
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="3">';

View File

@@ -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;

View File

@@ -171,10 +171,10 @@ if ($id > 0 || ! empty($ref))
print '</tr>';
// Customer
if (is_null($object->client)) $object->fetch_thirdparty();
if (is_null($object->thirdparty)) $object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
// Delivery address
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))

View File

@@ -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;

View File

@@ -175,7 +175,7 @@ if ($id > 0 || ! empty($ref))
// Customer
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1,'compta').'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1,'compta').'</td></tr>';
print "</table>";
dol_fiche_end();

View File

@@ -281,7 +281,7 @@ if ($action == 'create')
$object->fetch_thirdparty();
// Third party
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$object->client->getNomUrl(1,'customer').'</td>';
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1,'customer').'</td>';
print '<td>';
print $langs->trans("Comment");
print '</td></tr>';

View File

@@ -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);

View File

@@ -449,14 +449,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<input type="hidden" name="facid" value="'.$facture->id.'">';
print '<input type="hidden" name="socid" value="'.$facture->socid.'">';
print '<input type="hidden" name="type" id="invoice_type" value="'.$facture->type.'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($facture->client->name).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($facture->thirdparty->name).'">';
dol_fiche_head();
print '<table class="border" width="100%">';
// Third party
print '<tr><td><span class="fieldrequired">'.$langs->trans('Company').'</span></td><td colspan="2">'.$facture->client->getNomUrl(4)."</td></tr>\n";
print '<tr><td><span class="fieldrequired">'.$langs->trans('Company').'</span></td><td colspan="2">'.$facture->thirdparty->getNomUrl(4)."</td></tr>\n";
// Date payment
print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>';

View File

@@ -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;
}

View File

@@ -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 . "\"

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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);

View File

@@ -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))
{

View File

@@ -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);

View File

@@ -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 '</td></tr>';
// Third party
print "<tr><td>".$langs->trans("Company").'</td><td colspan="3">'.$object->client->getNomUrl(1)."</td></tr>";
print "<tr><td>".$langs->trans("Company").'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1)."</td></tr>";
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))
{

View File

@@ -133,11 +133,11 @@ if ($id > 0 || ! empty($ref))
print "</td></tr>";
// Customer
if ( is_null($object->client) )
if ( is_null($object->thirdparty) )
$object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print "</table>";
print '</div>';

View File

@@ -111,7 +111,7 @@ if ($object->id)
print '</td></tr>';
// Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
print "<tr><td>".$langs->trans("Company")."</td><td>".$object->thirdparty->getNomUrl(1)."</td></tr>";
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';

View File

@@ -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
{

View File

@@ -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))
{

View File

@@ -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))
{

View File

@@ -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);

View File

@@ -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);

View File

@@ -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,

View File

@@ -87,10 +87,10 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Customer
if ( is_null($object->client) )
if ( is_null($object->thirdparty) )
$object->fetch_thirdparty();
print "<tr><td>".$langs->trans("Supplier")."</td>";
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans('SupplierProposalDate').'</td><td colspan="3">';
print dol_print_date($object->date_livraison,'daytext');