Fix: bad commit
This commit is contained in:
parent
aab62c81b3
commit
edfb703a85
@ -166,7 +166,7 @@ if ($_REQUEST['action'] == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes'
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -244,7 +244,10 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
|
|||||||
$lines = $srcobject->lines;
|
$lines = $srcobject->lines;
|
||||||
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
|
||||||
|
|
||||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
$fk_parent_line=0;
|
||||||
|
$num=sizeof($lines);
|
||||||
|
|
||||||
|
for ($i=0;$i<$num;$i++)
|
||||||
{
|
{
|
||||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||||
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
|
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
|
||||||
@ -258,6 +261,11 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
|
|||||||
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
|
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
|
||||||
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
|
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
|
||||||
|
|
||||||
|
// Reset fk_parent_line for no child products and special product
|
||||||
|
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
|
||||||
|
$fk_parent_line = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $object->addline(
|
$result = $object->addline(
|
||||||
$object_id,
|
$object_id,
|
||||||
$desc,
|
$desc,
|
||||||
@ -276,7 +284,8 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
|
|||||||
$dateend,
|
$dateend,
|
||||||
$product_type,
|
$product_type,
|
||||||
$lines[$i]->rang,
|
$lines[$i]->rang,
|
||||||
$lines[$i]->special_code
|
$lines[$i]->special_code,
|
||||||
|
$fk_parent_line
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -284,6 +293,21 @@ if ($_POST['action'] == 'add' && $user->rights->commande->creer)
|
|||||||
$error++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Defined the new fk_parent_line
|
||||||
|
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||||
|
$fk_parent_line = $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
if (! empty($object->hooks))
|
||||||
|
{
|
||||||
|
foreach($object->hooks as $module)
|
||||||
|
{
|
||||||
|
$res = $module->createfrom($srcobject,$object_id,$object->element);
|
||||||
|
if ($res < 0) $error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -579,7 +603,10 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
$pu_ttc,
|
$pu_ttc,
|
||||||
$date_start,
|
$date_start,
|
||||||
$date_end,
|
$date_end,
|
||||||
$type
|
$type,
|
||||||
|
-1,
|
||||||
|
'',
|
||||||
|
$_POST['fk_parent_line']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -594,7 +621,7 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
|
||||||
unset($_POST['qty']);
|
unset($_POST['qty']);
|
||||||
unset($_POST['type']);
|
unset($_POST['type']);
|
||||||
@ -686,7 +713,8 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
|||||||
$info_bits,
|
$info_bits,
|
||||||
$date_start,
|
$date_start,
|
||||||
$date_end,
|
$date_end,
|
||||||
$type
|
$type,
|
||||||
|
$_POST['fk_parent_line']
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
@ -701,7 +729,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -735,7 +763,7 @@ if ($_REQUEST['action'] == 'confirm_validate' && $_REQUEST['confirm'] == 'yes' &
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -774,7 +802,7 @@ if ($_GET['action'] == 'modif' && $user->rights->commande->creer)
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,7 +827,7 @@ if ($_GET['action'] == 'up' && $user->rights->commande->creer)
|
|||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
|
||||||
Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$comid.'#'.$_GET['rowid']);
|
Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$comid.'#'.$_GET['rowid']);
|
||||||
exit;
|
exit;
|
||||||
@ -821,7 +849,7 @@ if ($_GET['action'] == 'down' && $user->rights->commande->creer)
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
|
|
||||||
Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$comid.'#'.$_GET['rowid']);
|
Header ('Location: '.$_SERVER["PHP_SELF"].'?id='.$comid.'#'.$_GET['rowid']);
|
||||||
exit;
|
exit;
|
||||||
@ -853,7 +881,7 @@ if ($_REQUEST['action'] == 'builddoc') // In get or post
|
|||||||
$outputlangs = new Translate("",$conf);
|
$outputlangs = new Translate("",$conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
$result=commande_pdf_create($db, $object, $object->modelpdf, $outputlangs);
|
$result=commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'));
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db,$result);
|
dol_print_error($db,$result);
|
||||||
@ -1286,7 +1314,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
|
// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
|
||||||
$objectsrc->remise_absolue=$remise_absolue;
|
$objectsrc->remise_absolue=$remise_absolue;
|
||||||
$objectsrc->remise_percent=$remise_percent;
|
$objectsrc->remise_percent=$remise_percent;
|
||||||
$objectsrc->update_price();
|
$objectsrc->update_price(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n<!-- ".$classname." info -->";
|
print "\n<!-- ".$classname." info -->";
|
||||||
@ -1366,7 +1394,6 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
$objectsrc->printOriginTitleList();
|
|
||||||
$objectsrc->printOriginLinesList($object);
|
$objectsrc->printOriginLinesList($object);
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -1789,13 +1816,8 @@ else
|
|||||||
|
|
||||||
print '<table id="tablelines" class="noborder" width="100%">';
|
print '<table id="tablelines" class="noborder" width="100%">';
|
||||||
|
|
||||||
if (!empty($object->lines))
|
// Show object lines
|
||||||
{
|
if (! empty($object->lines)) $object->printObjectLines(1,$mysoc,$soc);
|
||||||
$object->print_title_list();
|
|
||||||
$object->printLinesList(1,$mysoc,$soc);
|
|
||||||
}
|
|
||||||
|
|
||||||
$numlines=sizeof($object->lines);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Form to add new line
|
* Form to add new line
|
||||||
@ -1806,13 +1828,13 @@ else
|
|||||||
{
|
{
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$object->showAddFreeProductForm(1,$mysoc,$soc);
|
$object->formAddFreeProduct(1,$mysoc,$soc);
|
||||||
|
|
||||||
// Add predefined products/services
|
// Add predefined products/services
|
||||||
if ($conf->product->enabled || $conf->service->enabled)
|
if ($conf->product->enabled || $conf->service->enabled)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$object->showAddPredefinedProductForm(1,$mysoc,$soc);
|
$object->formAddPredefinedProduct(1,$mysoc,$soc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook of thirdparty module
|
// Hook of thirdparty module
|
||||||
@ -1973,7 +1995,7 @@ else
|
|||||||
$genallowed=$user->rights->commande->creer;
|
$genallowed=$user->rights->commande->creer;
|
||||||
$delallowed=$user->rights->commande->supprimer;
|
$delallowed=$user->rights->commande->supprimer;
|
||||||
|
|
||||||
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang);
|
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$object->hooks);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Linked object block
|
* Linked object block
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user