clean indent
This commit is contained in:
parent
5006001753
commit
b2b057e9b5
@ -790,48 +790,40 @@ if ($object->id > 0)
|
||||
if ($conf->supplier_proposal->enabled && $user->rights->supplier_proposal->creer)
|
||||
{
|
||||
$langs->load("supplier_proposal");
|
||||
if ($object->status == 1)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
}
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddSupplierProposal").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$langs->load("orders");
|
||||
if ($object->status == 1)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddOrder").'</a>';
|
||||
}
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddOrder").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddOrder").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$langs->load("bills");
|
||||
if ($object->status == 1)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
|
||||
}
|
||||
if ($object->status == 1) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
if (! empty($orders2invoice) && $orders2invoice > 0)
|
||||
{
|
||||
if ($object->status == 1) // Company is open
|
||||
if ($object->status == 1)
|
||||
{
|
||||
// Company is open
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -1272,7 +1272,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||
|
||||
$result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||
// This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||
$result = $this->addline(
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
|
||||
@ -2361,10 +2361,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
return $numref;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$obj->error;
|
||||
//dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return false;
|
||||
{
|
||||
$this->error=$obj->error;
|
||||
//dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -647,95 +647,96 @@ if (empty($reshook))
|
||||
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
if (preg_match('/\*/', $vat_rate))
|
||||
$info_bits |= 0x01;
|
||||
if (preg_match('/\*/', $vat_rate)) {
|
||||
$info_bits |= 0x01;
|
||||
}
|
||||
|
||||
// Define vat_rate
|
||||
$vat_rate = str_replace('*', '', $vat_rate);
|
||||
$localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty);
|
||||
$localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty);
|
||||
// Define vat_rate
|
||||
$vat_rate = str_replace('*', '', $vat_rate);
|
||||
$localtax1_rate = get_localtax($vat_rate, 1, $mysoc, $object->thirdparty);
|
||||
$localtax2_rate = get_localtax($vat_rate, 2, $mysoc, $object->thirdparty);
|
||||
|
||||
if (GETPOST('price_ht') != '')
|
||||
if (GETPOST('price_ht') != '')
|
||||
{
|
||||
$price_base_type = 'HT';
|
||||
$ht = price2num(GETPOST('price_ht'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$vatratecleaned = $vat_rate;
|
||||
if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)"
|
||||
{
|
||||
$price_base_type = 'HT';
|
||||
$ht = price2num(GETPOST('price_ht'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$vatratecleaned = $vat_rate;
|
||||
if (preg_match('/^(.*)\s*\((.*)\)$/', $vat_rate, $reg)) // If vat is "xx (yy)"
|
||||
{
|
||||
$vatratecleaned = trim($reg[1]);
|
||||
$vatratecode = $reg[2];
|
||||
}
|
||||
|
||||
$ttc = price2num(GETPOST('price_ttc'));
|
||||
$ht = $ttc / (1 + ($vatratecleaned / 100));
|
||||
$price_base_type = 'HT';
|
||||
$vatratecleaned = trim($reg[1]);
|
||||
$vatratecode = $reg[2];
|
||||
}
|
||||
|
||||
$pu_ht_devise = GETPOST('multicurrency_subprice');
|
||||
$ttc = price2num(GETPOST('price_ttc'));
|
||||
$ht = $ttc / (1 + ($vatratecleaned / 100));
|
||||
$price_base_type = 'HT';
|
||||
}
|
||||
|
||||
// Extrafields Lines
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
unset($_POST["options_" . $key]);
|
||||
}
|
||||
$pu_ht_devise = GETPOST('multicurrency_subprice');
|
||||
|
||||
// Extrafields Lines
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
unset($_POST["options_" . $key]);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->updateline(
|
||||
$lineid,
|
||||
$_POST['product_desc'],
|
||||
$ht,
|
||||
$_POST['qty'],
|
||||
$_POST['remise_percent'],
|
||||
$vat_rate,
|
||||
$localtax1_rate,
|
||||
$localtax2_rate,
|
||||
$price_base_type,
|
||||
0,
|
||||
isset($_POST["type"])?$_POST["type"]:$line->product_type,
|
||||
false,
|
||||
$date_start,
|
||||
$date_end,
|
||||
$array_options,
|
||||
$_POST['units'],
|
||||
$pu_ht_devise,
|
||||
GETPOST('fourn_ref', 'alpha')
|
||||
);
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['type']);
|
||||
unset($_POST['idprodfournprice']);
|
||||
unset($_POST['remmise_percent']);
|
||||
unset($_POST['dp_desc']);
|
||||
unset($_POST['np_desc']);
|
||||
unset($_POST['pu']);
|
||||
unset($_POST['fourn_ref']);
|
||||
unset($_POST['tva_tx']);
|
||||
unset($_POST['date_start']);
|
||||
unset($_POST['date_end']);
|
||||
unset($_POST['units']);
|
||||
unset($localtax1_tx);
|
||||
unset($localtax2_tx);
|
||||
$result = $object->updateline(
|
||||
$lineid,
|
||||
$_POST['product_desc'],
|
||||
$ht,
|
||||
$_POST['qty'],
|
||||
$_POST['remise_percent'],
|
||||
$vat_rate,
|
||||
$localtax1_rate,
|
||||
$localtax2_rate,
|
||||
$price_base_type,
|
||||
0,
|
||||
isset($_POST["type"])?$_POST["type"]:$line->product_type,
|
||||
false,
|
||||
$date_start,
|
||||
$date_end,
|
||||
$array_options,
|
||||
$_POST['units'],
|
||||
$pu_ht_devise,
|
||||
GETPOST('fourn_ref', 'alpha')
|
||||
);
|
||||
unset($_POST['qty']);
|
||||
unset($_POST['type']);
|
||||
unset($_POST['idprodfournprice']);
|
||||
unset($_POST['remmise_percent']);
|
||||
unset($_POST['dp_desc']);
|
||||
unset($_POST['np_desc']);
|
||||
unset($_POST['pu']);
|
||||
unset($_POST['fourn_ref']);
|
||||
unset($_POST['tva_tx']);
|
||||
unset($_POST['date_start']);
|
||||
unset($_POST['date_end']);
|
||||
unset($_POST['units']);
|
||||
unset($localtax1_tx);
|
||||
unset($localtax2_tx);
|
||||
|
||||
unset($_POST['date_starthour']);
|
||||
unset($_POST['date_startmin']);
|
||||
unset($_POST['date_startsec']);
|
||||
unset($_POST['date_startday']);
|
||||
unset($_POST['date_startmonth']);
|
||||
unset($_POST['date_startyear']);
|
||||
unset($_POST['date_endhour']);
|
||||
unset($_POST['date_endmin']);
|
||||
unset($_POST['date_endsec']);
|
||||
unset($_POST['date_endday']);
|
||||
unset($_POST['date_endmonth']);
|
||||
unset($_POST['date_endyear']);
|
||||
unset($_POST['date_starthour']);
|
||||
unset($_POST['date_startmin']);
|
||||
unset($_POST['date_startsec']);
|
||||
unset($_POST['date_startday']);
|
||||
unset($_POST['date_startmonth']);
|
||||
unset($_POST['date_startyear']);
|
||||
unset($_POST['date_endhour']);
|
||||
unset($_POST['date_endmin']);
|
||||
unset($_POST['date_endsec']);
|
||||
unset($_POST['date_endday']);
|
||||
unset($_POST['date_endmonth']);
|
||||
unset($_POST['date_endyear']);
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
@ -753,12 +754,12 @@ if (empty($reshook))
|
||||
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) dol_print_error($db, $result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db, $object->error);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove a product line
|
||||
@ -2500,13 +2501,13 @@ elseif (! empty($object->id))
|
||||
// Create bill
|
||||
//if (! empty($conf->facture->enabled))
|
||||
//{
|
||||
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
|
||||
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
|
||||
|
||||
@ -157,20 +157,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -407,20 +407,21 @@ if ($id > 0 || ! empty($ref)) {
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
@ -462,8 +463,8 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td>' . $author->getNomUrl(1, '', 0, 0, 0) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
@ -126,20 +126,21 @@ if ($object->id > 0)
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -122,20 +122,21 @@ if (! empty($conf->projet->enabled))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -103,20 +103,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -436,7 +436,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
|
||||
$sql .= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut';
|
||||
|
||||
@ -23,11 +23,9 @@ if (empty($conf) || ! is_object($conf))
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
@ -37,28 +35,29 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
$langs->load("orders");
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$total=0;
|
||||
$ilink=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("SupplierOrder"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/commande/card.php?id='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowOrder"), "order").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
if ($user->rights->fournisseur->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
@ -74,6 +73,5 @@ if (count($linkedObjectBlock) > 1)
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.fr>
|
||||
@ -9,7 +9,7 @@
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -308,18 +308,20 @@ if (empty($reshook))
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09'))
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
}
|
||||
if (! empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1017,97 +1019,97 @@ if (empty($reshook))
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
|
||||
if (GETPOST('price_ht') != '')
|
||||
{
|
||||
$up = price2num(GETPOST('price_ht'));
|
||||
$price_base_type = 'HT';
|
||||
}
|
||||
else
|
||||
{
|
||||
$up = price2num(GETPOST('price_ttc'));
|
||||
$price_base_type = 'TTC';
|
||||
}
|
||||
if (GETPOST('price_ht') != '')
|
||||
{
|
||||
$up = price2num(GETPOST('price_ht'));
|
||||
$price_base_type = 'HT';
|
||||
}
|
||||
else
|
||||
{
|
||||
$up = price2num(GETPOST('price_ttc'));
|
||||
$price_base_type = 'TTC';
|
||||
}
|
||||
|
||||
if (GETPOST('productid') > 0)
|
||||
if (GETPOST('productid') > 0)
|
||||
{
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
if (! empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY))
|
||||
{
|
||||
$productsupplier = new ProductFournisseur($db);
|
||||
if (! empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY))
|
||||
if (GETPOST('productid') > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), GETPOST('productid'), 'none', GETPOST('socid', 'int')) < 0 )
|
||||
{
|
||||
if (GETPOST('productid') > 0 && $productsupplier->get_buyprice(0, price2num($_POST['qty']), GETPOST('productid'), 'none', GETPOST('socid', 'int')) < 0 )
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
$prod = new Product($db);
|
||||
$prod->fetch(GETPOST('productid'));
|
||||
$label = $prod->description;
|
||||
if (trim($_POST['product_desc']) != trim($label)) $label=$_POST['product_desc'];
|
||||
|
||||
$type = $prod->type;
|
||||
}
|
||||
else
|
||||
{
|
||||
$label = $_POST['product_desc'];
|
||||
$type = $_POST["type"]?$_POST["type"]:0;
|
||||
}
|
||||
|
||||
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
if (preg_match('/\*/', $tva_tx))
|
||||
$info_bits |= 0x01;
|
||||
|
||||
// Define vat_rate
|
||||
$tva_tx = str_replace('*', '', $tva_tx);
|
||||
$localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||
$localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
|
||||
|
||||
$remise_percent=GETPOST('remise_percent');
|
||||
$pu_ht_devise = GETPOST('multicurrency_subprice');
|
||||
|
||||
// Extrafields Lines
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
unset($_POST["options_" . $key]);
|
||||
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
$result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise, GETPOST('fourn_ref', 'alpha'));
|
||||
if ($result >= 0)
|
||||
{
|
||||
unset($_POST['label']);
|
||||
unset($_POST['fourn_ref']);
|
||||
unset($_POST['date_starthour']);
|
||||
unset($_POST['date_startmin']);
|
||||
unset($_POST['date_startsec']);
|
||||
unset($_POST['date_startday']);
|
||||
unset($_POST['date_startmonth']);
|
||||
unset($_POST['date_startyear']);
|
||||
unset($_POST['date_endhour']);
|
||||
unset($_POST['date_endmin']);
|
||||
unset($_POST['date_endsec']);
|
||||
unset($_POST['date_endday']);
|
||||
unset($_POST['date_endmonth']);
|
||||
unset($_POST['date_endyear']);
|
||||
$prod = new Product($db);
|
||||
$prod->fetch(GETPOST('productid'));
|
||||
$label = $prod->description;
|
||||
if (trim($_POST['product_desc']) != trim($label)) $label=$_POST['product_desc'];
|
||||
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$type = $prod->type;
|
||||
}
|
||||
else
|
||||
{
|
||||
$label = $_POST['product_desc'];
|
||||
$type = $_POST["type"]?$_POST["type"]:0;
|
||||
}
|
||||
|
||||
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
if (preg_match('/\*/', $tva_tx))
|
||||
$info_bits |= 0x01;
|
||||
|
||||
// Define vat_rate
|
||||
$tva_tx = str_replace('*', '', $tva_tx);
|
||||
$localtax1_tx= get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
|
||||
$localtax2_tx= get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
|
||||
|
||||
$remise_percent=GETPOST('remise_percent');
|
||||
$pu_ht_devise = GETPOST('multicurrency_subprice');
|
||||
|
||||
// Extrafields Lines
|
||||
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
unset($_POST["options_" . $key]);
|
||||
}
|
||||
}
|
||||
|
||||
$result=$object->updateline(GETPOST('lineid'), $label, $up, $tva_tx, $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('productid'), $price_base_type, $info_bits, $type, $remise_percent, 0, $date_start, $date_end, $array_options, $_POST['units'], $pu_ht_devise, GETPOST('fourn_ref', 'alpha'));
|
||||
if ($result >= 0)
|
||||
{
|
||||
unset($_POST['label']);
|
||||
unset($_POST['fourn_ref']);
|
||||
unset($_POST['date_starthour']);
|
||||
unset($_POST['date_startmin']);
|
||||
unset($_POST['date_startsec']);
|
||||
unset($_POST['date_startday']);
|
||||
unset($_POST['date_startmonth']);
|
||||
unset($_POST['date_startyear']);
|
||||
unset($_POST['date_endhour']);
|
||||
unset($_POST['date_endmin']);
|
||||
unset($_POST['date_endsec']);
|
||||
unset($_POST['date_endday']);
|
||||
unset($_POST['date_endmonth']);
|
||||
unset($_POST['date_endyear']);
|
||||
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
|
||||
@ -1654,52 +1656,52 @@ if ($action == 'create')
|
||||
$element = 'projet';
|
||||
}
|
||||
|
||||
// For compatibility
|
||||
if ($element == 'order') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
$element = 'comm/propal'; $subelement = 'propal';
|
||||
}
|
||||
if ($element == 'contract') {
|
||||
$element = $subelement = 'contrat';
|
||||
}
|
||||
if ($element == 'order_supplier') {
|
||||
$element = 'fourn'; $subelement = 'fournisseur.commande';
|
||||
}
|
||||
// For compatibility
|
||||
if ($element == 'order') {
|
||||
$element = $subelement = 'commande';
|
||||
}
|
||||
if ($element == 'propal') {
|
||||
$element = 'comm/propal'; $subelement = 'propal';
|
||||
}
|
||||
if ($element == 'contract') {
|
||||
$element = $subelement = 'contrat';
|
||||
}
|
||||
if ($element == 'order_supplier') {
|
||||
$element = 'fourn'; $subelement = 'fournisseur.commande';
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php';
|
||||
$classname = ucfirst($subelement);
|
||||
if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur';
|
||||
$objectsrc = new $classname($db);
|
||||
$objectsrc->fetch($originid);
|
||||
$objectsrc->fetch_thirdparty();
|
||||
require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php';
|
||||
$classname = ucfirst($subelement);
|
||||
if ($classname == 'Fournisseur.commande') $classname='CommandeFournisseur';
|
||||
$objectsrc = new $classname($db);
|
||||
$objectsrc->fetch($originid);
|
||||
$objectsrc->fetch_thirdparty();
|
||||
|
||||
$projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:'');
|
||||
//$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:'');
|
||||
$projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:'');
|
||||
//$ref_client = (!empty($objectsrc->ref_client)?$object->ref_client:'');
|
||||
|
||||
$soc = $objectsrc->thirdparty;
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_supplier_id)?$soc->cond_reglement_supplier_id:0)); // TODO maybe add default value option
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_supplier_id)?$soc->mode_reglement_supplier_id:0));
|
||||
$fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0));
|
||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_supplier_percent)?$soc->remise_supplier_percent:0));
|
||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
||||
$soc = $objectsrc->thirdparty;
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(!empty($soc->cond_reglement_supplier_id)?$soc->cond_reglement_supplier_id:0)); // TODO maybe add default value option
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(!empty($soc->mode_reglement_supplier_id)?$soc->mode_reglement_supplier_id:0));
|
||||
$fk_account = (! empty($objectsrc->fk_account)?$objectsrc->fk_account:(! empty($soc->fk_account)?$soc->fk_account:0));
|
||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_supplier_percent)?$soc->remise_supplier_percent:0));
|
||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'';
|
||||
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
|
||||
if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
|
||||
}
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
|
||||
if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
|
||||
}
|
||||
|
||||
$datetmp=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
$dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp);
|
||||
$datetmp=dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
|
||||
$datedue=($datetmp==''?-1:$datetmp);
|
||||
$datetmp=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
$dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp);
|
||||
$datetmp=dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']);
|
||||
$datedue=($datetmp==''?-1:$datetmp);
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2047,7 +2049,7 @@ if ($action == 'create')
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td>';
|
||||
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||
// print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Private note
|
||||
@ -2376,19 +2378,20 @@ else
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -614,12 +614,12 @@ if ($resql)
|
||||
FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
||||
FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||
);
|
||||
/*
|
||||
/*
|
||||
if (! empty($conf->global->INVOICE_USE_SITUATION))
|
||||
{
|
||||
$listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation");
|
||||
}
|
||||
*/
|
||||
*/
|
||||
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
|
||||
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
|
||||
print '</td>';
|
||||
@ -1105,32 +1105,31 @@ if ($resql)
|
||||
|
||||
// Show total line
|
||||
if (isset($totalarray['totalhtfield'])
|
||||
|| isset($totalarray['totalvatfield'])
|
||||
|| isset($totalarray['totallocaltax1field'])
|
||||
|| isset($totalarray['totallocaltax2field'])
|
||||
|| isset($totalarray['totalttcfield'])
|
||||
|| isset($totalarray['totalamfield'])
|
||||
|| isset($totalarray['totalrtpfield'])
|
||||
)
|
||||
{
|
||||
|| isset($totalarray['totalvatfield'])
|
||||
|| isset($totalarray['totallocaltax1field'])
|
||||
|| isset($totalarray['totallocaltax2field'])
|
||||
|| isset($totalarray['totalttcfield'])
|
||||
|| isset($totalarray['totalamfield'])
|
||||
|| isset($totalarray['totalrtpfield'])
|
||||
) {
|
||||
print '<tr class="liste_total">';
|
||||
$i=0;
|
||||
while ($i < $totalarray['nbfield'])
|
||||
{
|
||||
$i++;
|
||||
if ($i == 1)
|
||||
{
|
||||
$i++;
|
||||
if ($i == 1)
|
||||
{
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -102,20 +102,21 @@ if ($object->id > 0)
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
// $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -755,7 +755,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,11 +25,9 @@ if (empty($conf) || ! is_object($conf))
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
@ -46,30 +44,31 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
||||
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("SupplierInvoice"); ?></td>
|
||||
<td><a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objectlink->id ?>"><?php echo img_object($langs->trans("ShowBill"), "bill").' '.$objectlink->ref; ?></a></td>
|
||||
<td class="left"><?php echo $objectlink->ref_supplier; ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
if ($user->rights->fournisseur->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3) // If not abandonned
|
||||
{
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></td>
|
||||
if ($user->rights->fournisseur->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3)
|
||||
{
|
||||
// If not abandonned
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
@ -85,6 +84,5 @@ if (count($linkedObjectBlock) > 1)
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -77,7 +77,7 @@ if ($socid > 0)
|
||||
$sql.= " u.login, u.rowid as userid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
|
||||
$sql.= " AND f.entity IN (".getEntity("facture_fourn").")"; // Reconaissance de l'entité attribuée à cette facture pour Multicompany
|
||||
$sql.= " AND f.entity IN (".getEntity("facture_fourn").")"; // Reconaissance de l'entité attribuée à cette facture pour Multicompany
|
||||
$sql.= " AND f.fk_user_valid = u.rowid";
|
||||
$sql.= " ORDER BY f.datef DESC";
|
||||
|
||||
|
||||
@ -359,7 +359,7 @@ llxHeader();
|
||||
// Add logic to shoow/hide buttons
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#delconst").hide();
|
||||
@ -381,7 +381,7 @@ jQuery(document).ready(function() {
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@ -1744,7 +1744,8 @@ class Holiday extends CommonObject
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Si faux donc return array
|
||||
{
|
||||
// Si faux donc return array
|
||||
// List for Dolibarr users
|
||||
if ($type)
|
||||
{
|
||||
@ -1757,49 +1758,47 @@ class Holiday extends CommonObject
|
||||
$sql.= " WHERE (ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity.")";
|
||||
$sql.= " OR u.admin = 1";
|
||||
}
|
||||
else
|
||||
} else {
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
|
||||
$sql.= " AND u.statut > 0";
|
||||
if ($filters) $sql.=$filters;
|
||||
$sql.= " AND u.statut > 0";
|
||||
if ($filters) $sql.=$filters;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
// Si pas d'erreur SQL
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$tab_result = $this->holiday;
|
||||
$num = $this->db->num_rows($resql);
|
||||
// Si pas d'erreur SQL
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$tab_result = $this->holiday;
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
// Boucles du listage des utilisateurs
|
||||
while($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
// Boucles du listage des utilisateurs
|
||||
while($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$tab_result[$i]['rowid'] = $obj->rowid; // rowid of user
|
||||
$tab_result[$i]['name'] = $obj->lastname; // deprecated
|
||||
$tab_result[$i]['lastname'] = $obj->lastname;
|
||||
$tab_result[$i]['firstname'] = $obj->firstname;
|
||||
$tab_result[$i]['gender'] = $obj->gender;
|
||||
$tab_result[$i]['status'] = $obj->statut;
|
||||
$tab_result[$i]['employee'] = $obj->employee;
|
||||
$tab_result[$i]['photo'] = $obj->photo;
|
||||
$tab_result[$i]['fk_user'] = $obj->fk_user; // rowid of manager
|
||||
//$tab_result[$i]['type'] = $obj->type;
|
||||
//$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
|
||||
$tab_result[$i]['rowid'] = $obj->rowid; // rowid of user
|
||||
$tab_result[$i]['name'] = $obj->lastname; // deprecated
|
||||
$tab_result[$i]['lastname'] = $obj->lastname;
|
||||
$tab_result[$i]['firstname'] = $obj->firstname;
|
||||
$tab_result[$i]['gender'] = $obj->gender;
|
||||
$tab_result[$i]['status'] = $obj->statut;
|
||||
$tab_result[$i]['employee'] = $obj->employee;
|
||||
$tab_result[$i]['photo'] = $obj->photo;
|
||||
$tab_result[$i]['fk_user'] = $obj->fk_user; // rowid of manager
|
||||
//$tab_result[$i]['type'] = $obj->type;
|
||||
//$tab_result[$i]['nb_holiday'] = $obj->nb_holiday;
|
||||
|
||||
$i++;
|
||||
}
|
||||
// Retoune le tableau des utilisateurs
|
||||
return $tab_result;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Erreur SQL
|
||||
$this->errors[]="Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
$i++;
|
||||
}
|
||||
// Retoune le tableau des utilisateurs
|
||||
return $tab_result;
|
||||
} else {
|
||||
// Erreur SQL
|
||||
$this->errors[]="Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -213,7 +213,7 @@ if ($object->id)
|
||||
|
||||
print '</tbody>';
|
||||
print '</table>'."\n";
|
||||
/*
|
||||
/*
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
|
||||
@ -119,75 +119,75 @@ print '</tr>';
|
||||
|
||||
if ($num == 0)
|
||||
{
|
||||
print '<tr><td colspan="10" class="opacitymedium">'.$langs->trans('None').'</td></tr>';
|
||||
print '<tr><td colspan="10" class="opacitymedium">'.$langs->trans('None').'</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$user = new User($db);
|
||||
$user->fetch($obj->fk_user);
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$user = new User($db);
|
||||
$user->fetch($obj->fk_user);
|
||||
|
||||
$date_start = $db->jdate($obj->date_debut, true);
|
||||
$date_end = $db->jdate($obj->date_fin, true);
|
||||
$date_start = $db->jdate($obj->date_debut, true);
|
||||
$date_end = $db->jdate($obj->date_fin, true);
|
||||
|
||||
$tmpstart = dol_getdate($date_start);
|
||||
$tmpend = dol_getdate($date_end);
|
||||
$tmpstart = dol_getdate($date_start);
|
||||
$tmpend = dol_getdate($date_end);
|
||||
|
||||
$starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
|
||||
$endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
|
||||
$starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
|
||||
$endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
|
||||
|
||||
$halfdayinmonth = $obj->halfday;
|
||||
$starthalfdayinmonth = $starthalfday;
|
||||
$endhalfdayinmonth = $endhalfday;
|
||||
$halfdayinmonth = $obj->halfday;
|
||||
$starthalfdayinmonth = $starthalfday;
|
||||
$endhalfdayinmonth = $endhalfday;
|
||||
|
||||
//0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
|
||||
//0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
|
||||
|
||||
// Set date_start_gmt and date_end_gmt that are date to show for the selected month
|
||||
$date_start_inmonth = $db->jdate($obj->date_debut, true);
|
||||
$date_end_inmonth = $db->jdate($obj->date_fin, true);
|
||||
if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month)
|
||||
{
|
||||
$date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
|
||||
$starthalfdayinmonth = 'morning';
|
||||
if ($halfdayinmonth == 2) $halfdayinmonth=1;
|
||||
if ($halfdayinmonth == -1) $halfdayinmonth=0;
|
||||
}
|
||||
if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month)
|
||||
{
|
||||
$date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
|
||||
$endhalfdayinmonth = 'afternoon';
|
||||
if ($halfdayinmonth == 2) $halfdayinmonth=-1;
|
||||
if ($halfdayinmonth == 1) $halfdayinmonth=0;
|
||||
}
|
||||
// Set date_start_gmt and date_end_gmt that are date to show for the selected month
|
||||
$date_start_inmonth = $db->jdate($obj->date_debut, true);
|
||||
$date_end_inmonth = $db->jdate($obj->date_fin, true);
|
||||
if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month)
|
||||
{
|
||||
$date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
|
||||
$starthalfdayinmonth = 'morning';
|
||||
if ($halfdayinmonth == 2) $halfdayinmonth=1;
|
||||
if ($halfdayinmonth == -1) $halfdayinmonth=0;
|
||||
}
|
||||
if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month)
|
||||
{
|
||||
$date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
|
||||
$endhalfdayinmonth = 'afternoon';
|
||||
if ($halfdayinmonth == 2) $halfdayinmonth=-1;
|
||||
if ($halfdayinmonth == 1) $halfdayinmonth=0;
|
||||
}
|
||||
|
||||
// Leave request
|
||||
$holidaystatic->id=$obj->rowid;
|
||||
$holidaystatic->ref=$obj->rowid;
|
||||
// Leave request
|
||||
$holidaystatic->id=$obj->rowid;
|
||||
$holidaystatic->ref=$obj->rowid;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $holidaystatic->getNomUrl(1, 1);
|
||||
print '</td>';
|
||||
print '<td>' . $user->getFullName($langs) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_debut), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_fin), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">' . num_open_day($date_start, $date_end, 0, 1, $obj->halfday) . '</td>';
|
||||
print '<td class="center">' . dol_print_date($date_start_inmonth, 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . dol_print_date($date_end_inmonth, 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">' . num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth) . '</td>';
|
||||
print '<td class="maxwidth300">' . dol_escape_htmltag(dolGetFirstLineOfText($obj->description)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $holidaystatic->getNomUrl(1, 1);
|
||||
print '</td>';
|
||||
print '<td>' . $user->getFullName($langs) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_debut), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . dol_print_date($db->jdate($obj->date_fin), 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">' . num_open_day($date_start, $date_end, 0, 1, $obj->halfday) . '</td>';
|
||||
print '<td class="center">' . dol_print_date($date_start_inmonth, 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="center">' . dol_print_date($date_end_inmonth, 'day');
|
||||
print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">' . num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth) . '</td>';
|
||||
print '<td class="maxwidth300">' . dol_escape_htmltag(dolGetFirstLineOfText($obj->description)) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -265,12 +265,12 @@ class Establishment extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete record
|
||||
*
|
||||
* @param int $id Id of record to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
/**
|
||||
* Delete record
|
||||
*
|
||||
* @param int $id Id of record to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
@ -1962,15 +1962,16 @@ function show_elem($fieldssource, $pos, $key, $var, $nostyle = '')
|
||||
|
||||
$height='24px';
|
||||
|
||||
if ($key == 'none') {//stop multiple duplicate ids with no number
|
||||
if ($key == 'none') {
|
||||
//stop multiple duplicate ids with no number
|
||||
print "\n\n<!-- Box_no-key start-->\n";
|
||||
print '<div class="box boximport" style="padding:0;">' . "\n";
|
||||
print '<table summary="boxtable_no-key" width="100%" class="nobordernopadding">' . "\n";
|
||||
} else {
|
||||
print "\n\n<!-- Box ".$pos." start -->\n";
|
||||
print "\n\n<!-- Box ".$pos." start -->\n";
|
||||
print '<div class="box boximport" style="padding: 0;" id="boxto_' . $pos . '">' . "\n";
|
||||
|
||||
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
||||
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
||||
}
|
||||
|
||||
if ($pos && $pos > count($fieldssource)) // No fields
|
||||
|
||||
@ -118,19 +118,21 @@ if (! empty($force_install_message))
|
||||
<tr>
|
||||
<td class="label"><label for="main_dir"><b><?php print $langs->trans("WebPagesDirectory"); ?></b></label></td>
|
||||
<?php
|
||||
if (empty($dolibarr_main_url_root)) {
|
||||
$dolibarr_main_document_root = detect_dolibarr_main_document_root();
|
||||
}
|
||||
?>
|
||||
if (empty($dolibarr_main_url_root)) {
|
||||
$dolibarr_main_document_root = detect_dolibarr_main_document_root();
|
||||
}
|
||||
?>
|
||||
<td class="label">
|
||||
<input type="text"
|
||||
class="minwidth300"
|
||||
id="main_dir"
|
||||
name="main_dir"
|
||||
value="<?php print $dolibarr_main_document_root ?>"
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php
|
||||
if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
}
|
||||
?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php
|
||||
@ -159,9 +161,9 @@ if (! empty($force_install_message))
|
||||
id="main_data_dir"
|
||||
name="main_data_dir"
|
||||
value="<?php print $dolibarr_main_data_root ?>"
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php
|
||||
@ -191,9 +193,10 @@ if (! empty($force_install_message))
|
||||
id="main_url"
|
||||
name="main_url"
|
||||
value="<?php print $dolibarr_main_url_root; ?> "
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if (!empty($force_install_noedit)) {
|
||||
print ' disabled';
|
||||
}
|
||||
?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php print $langs->trans("Examples").":<br>"; ?>
|
||||
@ -214,19 +217,15 @@ if (! empty($force_install_message))
|
||||
<input type="checkbox"
|
||||
id="main_force_https"
|
||||
name="main_force_https"
|
||||
<?php if (!empty($force_install_mainforcehttps)) {
|
||||
print ' checked';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_mainforcehttps !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if (!empty($force_install_mainforcehttps)) { print ' checked'; } ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_mainforcehttps !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("CheckToForceHttps"); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -245,9 +244,7 @@ if (! empty($force_install_message))
|
||||
id="db_name"
|
||||
name="db_name"
|
||||
value="<?php echo (!empty($dolibarr_main_db_name)) ? $dolibarr_main_db_name : ($force_install_database ? $force_install_database : 'dolibarr'); ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_database !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_database !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("DatabaseName"); ?></td>
|
||||
@ -324,9 +321,7 @@ if (! empty($force_install_message))
|
||||
?>
|
||||
<select id="db_type"
|
||||
name="db_type"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_type !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_type !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
<?php print $option; ?>
|
||||
</select>
|
||||
@ -343,9 +338,7 @@ if (! empty($force_install_message))
|
||||
id="db_host"
|
||||
name="db_host"
|
||||
value="<?php print (!empty($force_install_dbserver) ? $force_install_dbserver : (!empty($dolibarr_main_db_host) ? $dolibarr_main_db_host : 'localhost')); ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_dbserver !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("ServerAddressDescription"); ?>
|
||||
@ -360,9 +353,7 @@ if (! empty($force_install_message))
|
||||
name="db_port"
|
||||
id="db_port"
|
||||
value="<?php print (!empty($force_install_port)) ? $force_install_port : $dolibarr_main_db_port; ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_port !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_port !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("ServerPortDescription"); ?>
|
||||
@ -377,9 +368,7 @@ if (! empty($force_install_message))
|
||||
id="db_prefix"
|
||||
name="db_prefix"
|
||||
value="<?php echo(!empty($force_install_prefix) ? $force_install_prefix : (!empty($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : 'llx_')); ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_prefix !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_prefix !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("DatabasePrefixDescription"); ?></td>
|
||||
@ -391,12 +380,8 @@ if (! empty($force_install_message))
|
||||
<input type="checkbox"
|
||||
id="db_create_database"
|
||||
name="db_create_database"
|
||||
<?php if ($force_install_createdatabase) {
|
||||
print ' checked';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_createdatabase !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_createdatabase) { print ' checked'; } ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_createdatabase !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("CheckToCreateDatabase"); ?>
|
||||
@ -410,9 +395,7 @@ if (! empty($force_install_message))
|
||||
id="db_user"
|
||||
name="db_user"
|
||||
value="<?php print (!empty($force_install_databaselogin)) ? $force_install_databaselogin : $dolibarr_main_db_user; ?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databaselogin !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("AdminLogin"); ?></td>
|
||||
@ -424,17 +407,16 @@ if (! empty($force_install_message))
|
||||
<input type="password"
|
||||
id="db_pass" autocomplete="off"
|
||||
name="db_pass"
|
||||
value="<?php
|
||||
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
|
||||
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
|
||||
if (!empty($dolibarr_main_prod)) {
|
||||
$autofill = '';
|
||||
}
|
||||
print dol_escape_htmltag($autofill);
|
||||
?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databasepass !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
value="
|
||||
<?php
|
||||
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
|
||||
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
|
||||
if (!empty($dolibarr_main_prod)) {
|
||||
$autofill = '';
|
||||
}
|
||||
print dol_escape_htmltag($autofill);
|
||||
?>"
|
||||
<?php if ($force_install_noedit == 2 && $force_install_databasepass !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("AdminPassword"); ?></td>
|
||||
@ -446,12 +428,8 @@ if (! empty($force_install_message))
|
||||
<input type="checkbox"
|
||||
id="db_create_user"
|
||||
name="db_create_user"
|
||||
<?php if (!empty($force_install_createuser)) {
|
||||
print ' checked';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_createuser !== null) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if (!empty($force_install_createuser)) { print ' checked'; } ?>
|
||||
<?php if ($force_install_noedit == 2 && $force_install_createuser !== null) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("CheckToCreateUser"); ?>
|
||||
@ -478,9 +456,7 @@ if (! empty($force_install_message))
|
||||
name="db_user_root"
|
||||
class="needroot"
|
||||
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
|
||||
<?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootlogin)) {
|
||||
print ' disabled';
|
||||
} ?>
|
||||
<?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootlogin)) { print ' disabled'; } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("DatabaseRootLoginDescription"); ?>
|
||||
@ -516,9 +492,7 @@ if (! empty($force_install_message))
|
||||
} // Do not autofill password for remote access
|
||||
print dol_escape_htmltag($autofill);
|
||||
?>"
|
||||
<?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootpass)) {
|
||||
print ' disabled'; // May be removed by javascript
|
||||
} ?>
|
||||
<?php if ($force_install_noedit > 0 && ! empty($force_install_databaserootpass)) { print ' disabled'; // May be removed by javascript } ?>
|
||||
>
|
||||
</td>
|
||||
<td class="comment"><?php echo $langs->trans("KeepEmptyIfNoPassword"); ?>
|
||||
|
||||
@ -379,7 +379,7 @@ class MailmanSpip
|
||||
return count($lists);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$this->error="ADHERENT_MAILMAN_URL not defined";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -68,9 +68,9 @@ if (!empty($enddatemonth))
|
||||
|
||||
// Security check
|
||||
if ($user->rights->margins->read->all) {
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
} else {
|
||||
$agentid = $user->id;
|
||||
$agentid = $user->id;
|
||||
}
|
||||
$result=restrictedArea($user, 'margins');
|
||||
|
||||
|
||||
@ -360,7 +360,7 @@ if ($result)
|
||||
print "<td class=\"right\">".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>";
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -103,13 +103,13 @@ dol_fiche_head($head, 'productMargins', $titre, 0, $picto);
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($id > 0) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td class="maxwidthonsmartpone" colspan="4">';
|
||||
print $form->select_produits($id, 'id', '', 20, 0, 1, 2, '', 1, array(), 0, 'All');
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
print '<td class="maxwidthonsmartpone" colspan="4">';
|
||||
print $form->select_produits($id, 'id', '', 20, 0, 1, 2, '', 1, array(), 0, 'All');
|
||||
print '</td></tr>';
|
||||
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.datef";
|
||||
}
|
||||
else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ChooseProduct/Service').'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user