Works on possibility to change customer when cloning (enable in customer orders)

New: can send extra input in ajax dialog
This commit is contained in:
Regis Houssin 2011-04-25 08:25:14 +00:00
parent 2b5d169575
commit 94d64bd9e8
2 changed files with 13 additions and 3 deletions

View File

@ -739,8 +739,18 @@ class Commande extends CommonObject
// Change socid if needed
if (! empty($socid) && $socid != $object->socid)
{
$object->socid = $socid;
// TODO clear delivery address, project linked, change product price if multi-prices
$socstatic = new Societe($this->db);
if ($socstatic->fetch($socid)>0)
{
$object->socid = $socid;
$object->cond_reglement_id = $soc->cond_reglement_id;
$object->mode_reglement_id = $soc->mode_reglement_id;
$object->fk_project = '';
$object->fk_delivery_address = '';
}
// TODO Change product price if multi-prices
}
$object->id=0;

View File

@ -1498,7 +1498,7 @@ else
$formquestion=array(
//'text' => $langs->trans("ConfirmClone"),
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
//array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $html->select_company(GETPOST('socid'),'socid','(s.client=1 OR s.client=3)'))
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $html->select_company(GETPOST('socid'),'socid','(s.client=1 OR s.client=3)'))
);
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);