Fix: When module shipment is on, a contact of order is also contact of

shipment
This commit is contained in:
Laurent Destailleur 2016-02-24 11:17:47 +01:00
parent 09951888a5
commit 449d44419d
3 changed files with 17 additions and 18 deletions

View File

@ -1124,14 +1124,6 @@ else
print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';
// Statut
/*print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatut(4);
print '</td>';
print '</tr>'."\n";
*/
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) {
print '<tr><td>' . $langs->trans( "Categories" ) . '</td>';
@ -1151,13 +1143,6 @@ else
$object->load_ref_elements();
if (! empty($conf->commande->enabled))
{
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
print '</td></tr>';
}
if (! empty($conf->propal->enabled))
{
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
@ -1165,6 +1150,18 @@ else
print '</td></tr>';
}
if (! empty($conf->commande->enabled) || ! empty($conf->expedition->enabled))
{
print '<tr><td>';
if (! empty($conf->expedition->enabled)) { print $langs->trans("ContactForOrdersOrShipments"); }
else print $langs->trans("ContactForOrders");
print '</td><td colspan="3">';
$none=$langs->trans("NoContactForAnyOrder");
if (! empty($conf->expedition->enabled)) { $none=$langs->trans("NoContactForAnyOrderOrShipments"); }
print $object->ref_commande?$object->ref_commande:$none;
print '</td></tr>';
}
if (! empty($conf->contrat->enabled))
{
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';

View File

@ -664,10 +664,10 @@ class Contact extends CommonObject
/**
* Charge le nombre d'elements auquel est lie ce contact
* Load number of elements the contact is used as a link for
* ref_facturation
* ref_contrat
* ref_commande
* ref_commande (for order and/or shipments)
* ref_propale
*
* @return int <0 if KO, >=0 if OK
@ -701,7 +701,7 @@ class Contact extends CommonObject
}
else
{
$this->error=$this->db->error()." - ".$sql;
$this->error=$this->db->lasterror();
return -1;
}
}

View File

@ -317,10 +317,12 @@ ShowContact=Show contact
ContactsAllShort=All (No filter)
ContactType=Contact type
ContactForOrders=Order's contact
ContactForOrdersOrShipments=Order's or shipment's contact
ContactForProposals=Proposal's contact
ContactForContracts=Contract's contact
ContactForInvoices=Invoice's contact
NoContactForAnyOrder=This contact is not a contact for any order
NoContactForAnyOrderOrShipment=This contact is not a contact for any order or shipment
NoContactForAnyProposal=This contact is not a contact for any commercial proposal
NoContactForAnyContract=This contact is not a contact for any contract
NoContactForAnyInvoice=This contact is not a contact for any invoice