mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Add hidden option COMMANDE_ADD_DELIVERY_ADDRESS to continue to have the delivery addresse asked in the old way.
For using the new way, just add a contact of type "delivery" on the contacts tab of order.
This commit is contained in:
@@ -987,17 +987,16 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
// Adresse de livraison
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans('DeliveryAddress').'</td><td>';
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socid'],'adresse_livraison_id',1);
|
||||
|
||||
if ($numaddress==0)
|
||||
// Delivery address
|
||||
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
{
|
||||
// Link to edit: $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?action=create','',$soc->id,'adresse_livraison_id','commande','');
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans('DeliveryAddress').'</td><td>';
|
||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socid'],'adresse_livraison_id',1);
|
||||
print ' <a href="../comm/adresse_livraison.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddAddress").'</a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Conditions de reglement
|
||||
print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
$html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1);
|
||||
@@ -1396,24 +1395,27 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Terms of payment
|
||||
print '<tr><td height="10">';
|
||||
|
||||
@@ -260,26 +260,28 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Adresse de livraison
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if (1 == 2 && $_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
// Delivery address
|
||||
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if (1 == 2 && $_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Conditions et modes de r<>glement
|
||||
print '<tr><td height="10">';
|
||||
|
||||
@@ -278,24 +278,27 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DeliveryAddress');
|
||||
print '</td>';
|
||||
|
||||
if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_adress&socid='.$commande->socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
if ($_GET['action'] == 'editdelivery_adress')
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Terms of payment
|
||||
print '<tr><td height="10">';
|
||||
|
||||
@@ -284,13 +284,17 @@ if ($_GET["action"] == 'create')
|
||||
print '<td colspan="3">'.dol_print_date($object->date,"day")."</td></tr>\n";
|
||||
|
||||
// Delivery address
|
||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (!empty($object->fk_delivery_address))
|
||||
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$_GET['socid'],'none','commande',$object->id);
|
||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (!empty($object->fk_delivery_address))
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$_GET['socid'],'none','commande',$object->id);
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Warehouse (id forced)
|
||||
if ($conf->stock->enabled && $_GET["entrepot_id"])
|
||||
@@ -532,6 +536,7 @@ else
|
||||
if ($expedition->id > 0)
|
||||
{
|
||||
$typeobject = $expedition->origin;
|
||||
$origin = $expedition->origin;
|
||||
$expedition->fetch_object();
|
||||
|
||||
if (strlen($expedition->tracking_number))
|
||||
@@ -617,24 +622,23 @@ else
|
||||
|
||||
// Linked documents
|
||||
print '<tr><td>';
|
||||
if ($conf->commande->enabled)
|
||||
if ($origin == 'commande')
|
||||
{
|
||||
$order=new Commande($db);
|
||||
$order->fetch($expedition->$typeobject->id);
|
||||
$order->fetch($expedition->$origin->id);
|
||||
print $langs->trans("RefOrder").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $order->getNomUrl(1,'commande');
|
||||
print "</td>\n";
|
||||
}
|
||||
else
|
||||
if ($origin == 'propal')
|
||||
{
|
||||
$propal=new Propal($db);
|
||||
$propal->fetch($livraison->origin_id);
|
||||
$propal->fetch($expedition->$origin->id);
|
||||
print $langs->trans("RefProposal").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $propal->getNomUrl(1,'expedition');
|
||||
print "</td>\n";
|
||||
}
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Ref customer
|
||||
@@ -648,13 +652,17 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Delivery address
|
||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (!empty($expedition->fk_delivery_address))
|
||||
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$expedition->id,$expedition->fk_delivery_address,$expedition->deliveryaddress->socid,'none','shipment',$expedition->id);
|
||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
||||
print '<td colspan="3">';
|
||||
if (!empty($expedition->fk_delivery_address))
|
||||
{
|
||||
$html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$expedition->id,$expedition->fk_delivery_address,$expedition->deliveryaddress->socid,'none','shipment',$expedition->id);
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Weight
|
||||
print '<tr><td>'.$langs->trans("TotalWeight").'</td>';
|
||||
|
||||
Reference in New Issue
Block a user