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:
parent
1af71edc1d
commit
eb40118ed2
@ -987,17 +987,16 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Adresse de livraison
|
// Delivery address
|
||||||
print '<tr><td nowrap="nowrap">'.$langs->trans('DeliveryAddress').'</td><td>';
|
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
$numaddress = $html->select_adresse_livraison($soc->adresse_livraison_id, $_GET['socid'],'adresse_livraison_id',1);
|
|
||||||
|
|
||||||
if ($numaddress==0)
|
|
||||||
{
|
{
|
||||||
|
// 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 ' <a href="../comm/adresse_livraison.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddAddress").'</a>';
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Conditions de reglement
|
// Conditions de reglement
|
||||||
print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
print '<tr><td nowrap="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||||
$html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1);
|
$html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id',-1,1);
|
||||||
@ -1396,24 +1395,27 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Delivery address
|
// Delivery address
|
||||||
print '<tr><td height="10">';
|
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
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);
|
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
|
// Terms of payment
|
||||||
print '<tr><td height="10">';
|
print '<tr><td height="10">';
|
||||||
|
|||||||
@ -260,26 +260,28 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Delivery address
|
||||||
// Adresse de livraison
|
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
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);
|
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
|
// Conditions et modes de règlement
|
||||||
print '<tr><td height="10">';
|
print '<tr><td height="10">';
|
||||||
|
|||||||
@ -278,24 +278,27 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Delivery address
|
// Delivery address
|
||||||
print '<tr><td height="10">';
|
if ($conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
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);
|
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
|
// Terms of payment
|
||||||
print '<tr><td height="10">';
|
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";
|
print '<td colspan="3">'.dol_print_date($object->date,"day")."</td></tr>\n";
|
||||||
|
|
||||||
// Delivery address
|
// Delivery address
|
||||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
print '<td colspan="3">';
|
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
|
||||||
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 '<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)
|
// Warehouse (id forced)
|
||||||
if ($conf->stock->enabled && $_GET["entrepot_id"])
|
if ($conf->stock->enabled && $_GET["entrepot_id"])
|
||||||
@ -532,6 +536,7 @@ else
|
|||||||
if ($expedition->id > 0)
|
if ($expedition->id > 0)
|
||||||
{
|
{
|
||||||
$typeobject = $expedition->origin;
|
$typeobject = $expedition->origin;
|
||||||
|
$origin = $expedition->origin;
|
||||||
$expedition->fetch_object();
|
$expedition->fetch_object();
|
||||||
|
|
||||||
if (strlen($expedition->tracking_number))
|
if (strlen($expedition->tracking_number))
|
||||||
@ -617,24 +622,23 @@ else
|
|||||||
|
|
||||||
// Linked documents
|
// Linked documents
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ($conf->commande->enabled)
|
if ($origin == 'commande')
|
||||||
{
|
{
|
||||||
$order=new Commande($db);
|
$order=new Commande($db);
|
||||||
$order->fetch($expedition->$typeobject->id);
|
$order->fetch($expedition->$origin->id);
|
||||||
print $langs->trans("RefOrder").'</td>';
|
print $langs->trans("RefOrder").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $order->getNomUrl(1,'commande');
|
print $order->getNomUrl(1,'commande');
|
||||||
print "</td>\n";
|
|
||||||
}
|
}
|
||||||
else
|
if ($origin == 'propal')
|
||||||
{
|
{
|
||||||
$propal=new Propal($db);
|
$propal=new Propal($db);
|
||||||
$propal->fetch($livraison->origin_id);
|
$propal->fetch($expedition->$origin->id);
|
||||||
print $langs->trans("RefProposal").'</td>';
|
print $langs->trans("RefProposal").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $propal->getNomUrl(1,'expedition');
|
print $propal->getNomUrl(1,'expedition');
|
||||||
print "</td>\n";
|
|
||||||
}
|
}
|
||||||
|
print "</td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Ref customer
|
// Ref customer
|
||||||
@ -648,13 +652,17 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Delivery address
|
// Delivery address
|
||||||
print '<tr><td>'.$langs->trans('DeliveryAddress').'</td>';
|
if (($origin == 'commande' && $conf->global->COMMANDE_ADD_DELIVERY_ADDRESS)
|
||||||
print '<td colspan="3">';
|
|| ($origin == 'propal' && $conf->global->PROPAL_ADD_DELIVERY_ADDRESS))
|
||||||
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 '<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
|
// Weight
|
||||||
print '<tr><td>'.$langs->trans("TotalWeight").'</td>';
|
print '<tr><td>'.$langs->trans("TotalWeight").'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user