Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
b3f2b39c77
@ -51,8 +51,8 @@ $action = GETPOST('action', 'alpha');
|
||||
$list = array (
|
||||
'ACCOUNTING_LENGTH_GACCOUNT',
|
||||
'ACCOUNTING_LENGTH_AACCOUNT' ,
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
||||
'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||
// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
||||
// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||
);
|
||||
|
||||
|
||||
@ -65,28 +65,28 @@ $accounting_mode = defined('ACCOUNTING_MODE') ? ACCOUNTING_MODE : 'RECETTES-DEPE
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
|
||||
$accounting_modes = array (
|
||||
'RECETTES-DEPENSES',
|
||||
'CREANCES-DETTES'
|
||||
'CREANCES-DETTES'
|
||||
);
|
||||
|
||||
|
||||
$accounting_mode = GETPOST('accounting_mode', 'alpha');
|
||||
|
||||
|
||||
if (in_array($accounting_mode, $accounting_modes)) {
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
}
|
||||
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
|
||||
foreach ($list as $constname)
|
||||
foreach ($list as $constname)
|
||||
{
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
@ -267,10 +267,10 @@ if (! empty($user->admin))
|
||||
|
||||
|
||||
// Param a user $user->rights->accountancy->chartofaccount can access
|
||||
foreach ($list as $key)
|
||||
foreach ($list as $key)
|
||||
{
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||
|
||||
// Param
|
||||
@ -280,7 +280,7 @@ foreach ($list as $key)
|
||||
print '<td align="right">';
|
||||
print '<input type="text" class="maxwidth100" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -111,16 +111,16 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
if ($action == 'update') {
|
||||
if (! empty($btn_changetype)) {
|
||||
$error = 0;
|
||||
|
||||
|
||||
$accounting_product_modes = array (
|
||||
'ACCOUNTANCY_SELL',
|
||||
'ACCOUNTANCY_BUY'
|
||||
'ACCOUNTANCY_BUY'
|
||||
);
|
||||
|
||||
|
||||
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
||||
|
||||
|
||||
if (in_array($accounting_product_mode, $accounting_product_modes)) {
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
@ -128,26 +128,26 @@ if ($action == 'update') {
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! empty($btn_changeaccount)) {
|
||||
//$msg = '<div><span class="accountingprocessing">' . $langs->trans("Processing") . '...</span></div>';
|
||||
if (! empty($chk_prod)) {
|
||||
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
|
||||
//$msg .= '<div><span class="accountingprocessing">' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '</span></div>';
|
||||
|
||||
|
||||
$cpt = 0; $ok = 0; $ko = 0;
|
||||
foreach ( $chk_prod as $productid ) {
|
||||
|
||||
|
||||
$accounting_account_id = GETPOST('codeventil_' . $productid);
|
||||
|
||||
|
||||
$result = $accounting->fetch($accounting_account_id, null, 1);
|
||||
if ($result < 0) {
|
||||
// setEventMessages(null, $accounting->errors, 'errors');
|
||||
$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
} else {
|
||||
|
||||
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "product";
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
$sql .= " SET accountancy_code_buy = " . $accounting->account_number;
|
||||
@ -156,7 +156,7 @@ if ($action == 'update') {
|
||||
$sql .= " SET accountancy_code_sell = " . $accounting->account_number;
|
||||
}
|
||||
$sql .= " WHERE rowid = " . $productid;
|
||||
|
||||
|
||||
dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$ok++;
|
||||
@ -166,7 +166,7 @@ if ($action == 'update') {
|
||||
//$msg .= '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '<br/> <pre>' . $sql . '</pre></font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cpt ++;
|
||||
}
|
||||
} else {
|
||||
@ -258,11 +258,11 @@ $sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@ -271,7 +271,7 @@ if ($result)
|
||||
if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc);
|
||||
if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account);
|
||||
if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid);
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -280,14 +280,14 @@ if ($result)
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
|
||||
print '<br>';
|
||||
|
||||
|
||||
print $langs->trans("InitAccountancyDesc") . '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Select mode
|
||||
|
||||
// Select mode
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('Options') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
@ -298,20 +298,20 @@ if ($result)
|
||||
print '<tr ' . $bc[true] . '><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"' . ($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '') . '> ' . $langs->trans('OptionModeProductBuy') . '</td>';
|
||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="' . $langs->trans('Refresh') . '" name="changetype"></div>';
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
// Filter on categories
|
||||
$moreforfilter='';
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
|
||||
$texte=$langs->trans("ListOfProductsServices");
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
|
||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
@ -334,7 +334,7 @@ if ($result)
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
@ -350,9 +350,9 @@ if ($result)
|
||||
$clickpitco=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"');
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$product_static = new Product($db);
|
||||
|
||||
|
||||
$var = true;
|
||||
$i=0;
|
||||
while ($i < min($num,$limit))
|
||||
@ -367,7 +367,7 @@ if ($result)
|
||||
$product_static->description = $obj->description;
|
||||
$product_static->status = $obj->tosell;
|
||||
$product_static->status_buy = $obj->tobuy;
|
||||
|
||||
|
||||
if ($obj->product_type == 0) {
|
||||
$compta_prodsell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
$compta_prodsell_id = $aarowid_prodsell;
|
||||
@ -375,7 +375,7 @@ if ($result)
|
||||
$compta_prodsell = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
$compta_prodsell_id = $aarowid_servsell;
|
||||
}
|
||||
|
||||
|
||||
if ($obj->product_type == 0) {
|
||||
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
$compta_prodbuy_id = $aarowid_prodbuy;
|
||||
@ -383,41 +383,41 @@ if ($result)
|
||||
$compta_prodbuy = (! empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
$compta_prodbuy_id = $aarowid_servbuy;
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
print '<td>';
|
||||
print $product_static->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">'.$obj->label.'</td>';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC))
|
||||
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC))
|
||||
{
|
||||
// TODO ADJUST DESCRIPTION SIZE
|
||||
// print '<td align="left">' . $obj->description . '</td>';
|
||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||
$trunclengh = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 64;
|
||||
$trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
|
||||
}
|
||||
|
||||
|
||||
print '<td align="center">'.$product_static->getLibStatut(3, 0).'</td>';
|
||||
|
||||
|
||||
print '<td align="center">'.$product_static->getLibStatut(3, 1).'</td>';
|
||||
|
||||
|
||||
// Current accounting account
|
||||
print '<td align="left">';
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
print length_accountg($obj->accountancy_code_buy);
|
||||
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print length_accountg($obj->accountancy_code_sell);
|
||||
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Dedicated account
|
||||
$defaultvalue='';
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
@ -440,7 +440,7 @@ if ($result)
|
||||
print $form->select_account($defaultvalue, 'codeventil_' . $product_static->id, 1, array(), 1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// Checkbox select
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="checkforselect" name="chk_prod[]" value="' . $obj->rowid . '"/></td>';
|
||||
@ -448,7 +448,7 @@ if ($result)
|
||||
$i ++;
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@ -461,7 +461,7 @@ if ($result)
|
||||
/* console.log( index + ": " + $( this ).text() ); */
|
||||
if ($(this).is(\':checked\')) atleastoneselected++;
|
||||
});
|
||||
|
||||
|
||||
if (atleastoneselected) jQuery("#changeaccount").removeAttr(\'disabled\');
|
||||
else jQuery("#changeaccount").attr(\'disabled\',\'disabled\');
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'butAction\');
|
||||
@ -474,12 +474,12 @@ if ($result)
|
||||
init_savebutton();
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<br><div align="center"><input type="submit" class="butAction" id="changeaccount" name="changeaccount" value="' . $langs->trans("Save") . '"></div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($result);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
|
||||
@ -121,7 +121,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$db->rollback();
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
$account_parent = ''; // Protection to avoid to mass apply it a second time
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ if ($result) {
|
||||
if ($search_tvaintra)
|
||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@ -249,7 +249,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print $langs->trans("DescVentilDoneCustomer") . '<br>';
|
||||
|
||||
@ -317,7 +317,7 @@ if ($result) {
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
if ($product_static->id)
|
||||
@ -327,7 +327,7 @@ if ($result) {
|
||||
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
@ -355,7 +355,7 @@ if ($result) {
|
||||
if ($nbtotalofrecords > $limit) {
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->lasterror();
|
||||
|
||||
@ -144,10 +144,10 @@ if ($massaction == 'ventil') {
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||
$sql .= " WHERE rowid = " . $monId;
|
||||
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
|
||||
|
||||
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg.= '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
|
||||
@ -157,7 +157,7 @@ if ($massaction == 'ventil') {
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cpt++;
|
||||
}
|
||||
$msg.='</div>';
|
||||
@ -375,10 +375,10 @@ if ($result) {
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="right">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
@ -404,7 +404,7 @@ if ($result) {
|
||||
print '<td align="center">';
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@ -94,13 +94,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
|
||||
$sql1 .= " SET erd.fk_code_ventilation=" . GETPOST('account_parent');
|
||||
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
|
||||
|
||||
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
@ -193,7 +193,7 @@ $result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@ -210,8 +210,8 @@ if ($result) {
|
||||
if ($search_country)
|
||||
$param .= "&search_country=" . $search_country;
|
||||
if ($search_tvaintra)
|
||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||
|
||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@ -220,7 +220,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilDoneExpenseReport") . '<br>';
|
||||
@ -273,7 +273,7 @@ if ($result) {
|
||||
|
||||
$expensereport_static->ref = $objp->ref;
|
||||
$expensereport_static->id = $objp->erid;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
@ -282,12 +282,12 @@ if ($result) {
|
||||
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
|
||||
|
||||
|
||||
print '<td class="tdoverflow">' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . '</td>';
|
||||
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
@ -300,20 +300,20 @@ if ($result) {
|
||||
print '<td align="left"><a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
|
||||
if ($nbtotalofrecords > $limit) {
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -139,10 +139,10 @@ if ($massaction == 'ventil') {
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
|
||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||
$sql .= " WHERE rowid = " . $monId;
|
||||
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
|
||||
|
||||
dol_syslog('accountancy/expensereport/list.php:: sql=' . $sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg.= '<div><font color="green">' . $langs->trans("LineOfExpenseReport") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
|
||||
@ -152,7 +152,7 @@ if ($massaction == 'ventil') {
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cpt++;
|
||||
}
|
||||
$msg.='</div>';
|
||||
@ -224,7 +224,7 @@ if ($result) {
|
||||
$i = 0;
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@ -237,8 +237,8 @@ if ($result) {
|
||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
//if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@ -247,7 +247,7 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("ExpenseReportLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilTodoExpenseReport") . '</br><br>';
|
||||
@ -290,8 +290,8 @@ if ($result) {
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
$expensereport_static = new ExpenseReport($db);
|
||||
$form = new Form($db);
|
||||
|
||||
@ -323,7 +323,7 @@ if ($result) {
|
||||
// Fees description -- Can be null
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
@ -356,7 +356,7 @@ if ($result) {
|
||||
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@ -98,13 +98,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
$error = 0;
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent');
|
||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
@ -202,7 +202,7 @@ $result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@ -221,8 +221,8 @@ if ($result) {
|
||||
if ($search_country)
|
||||
$param .= "&search_country=" . $search_country;
|
||||
if ($search_tvaintra)
|
||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||
|
||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@ -231,20 +231,20 @@ if ($result) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
|
||||
print $langs->trans("DescVentilDoneSupplier") . '<br>';
|
||||
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
@ -261,7 +261,7 @@ if ($result) {
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
@ -276,68 +276,68 @@ if ($result) {
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$facturefournisseur_static = new FactureFournisseur($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label;
|
||||
|
||||
|
||||
$facturefournisseur_static->ref = $objp->facnumber;
|
||||
$facturefournisseur_static->id = $objp->facid;
|
||||
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
print $objp->invoice_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
if ($product_static->id)
|
||||
print $product_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||
print '<td align="left">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
}
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
|
||||
if ($nbtotalofrecords > $limit) {
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -104,7 +104,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
$search_desc = '';
|
||||
$search_amount = '';
|
||||
@ -146,10 +146,10 @@ if ($massaction == 'ventil') {
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql .= " SET fk_code_ventilation = " . $monCompte;
|
||||
$sql .= " WHERE rowid = " . $monId;
|
||||
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
|
||||
|
||||
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg.= '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accountventilated->account_number) . '</font></div>';
|
||||
@ -159,7 +159,7 @@ if ($massaction == 'ventil') {
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cpt++;
|
||||
}
|
||||
$msg.='</div>';
|
||||
@ -332,7 +332,7 @@ if ($result) {
|
||||
$facturefourn_static->ref = $objp->ref;
|
||||
$facturefourn_static->id = $objp->facid;
|
||||
$facturefourn_static->type = $objp->type;
|
||||
|
||||
|
||||
$code_buy_p_notset = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
|
||||
@ -356,7 +356,7 @@ if ($result) {
|
||||
|
||||
// $objp->code_buy_p is now code of product/service
|
||||
// $objp->code_buy_l is now default code of product/service
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
@ -381,7 +381,7 @@ if ($result) {
|
||||
// Description
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
@ -422,7 +422,7 @@ if ($result) {
|
||||
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@ -266,7 +266,7 @@ class FormAccounting extends Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT) ? 50 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT;
|
||||
|
||||
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
|
||||
@ -690,6 +690,7 @@ class FormFile
|
||||
{
|
||||
$headershown=1;
|
||||
$out.= '<div class="titre">'.$titletoshow.'</div>'."\n";
|
||||
$out.= '<div class="div-table-responsive-no-min">';
|
||||
$out.= '<table class="noborder" summary="listofdocumentstable" id="'.$modulepart.'_table" width="100%">'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -684,7 +684,10 @@ if ($resql)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[false].'>'.'<td colspan="9" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
$colspan=1;
|
||||
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||
|
||||
print '<tr>'.'<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
// Show total line
|
||||
|
||||
@ -194,7 +194,7 @@ if (!empty($sall))
|
||||
|
||||
if (empty($user->rights->holiday->read_all)) $filter.=' AND cp.fk_user IN ('.join(',',$childids).')';
|
||||
|
||||
if ($type) $filter.=' AND cp.fk_type IN ('.$type.')';
|
||||
if ($type > 0) $filter.=' AND cp.fk_type IN ('.$db->escape($type).')';
|
||||
|
||||
// Récupération de l'ID de l'utilisateur
|
||||
$user_id = $user->id;
|
||||
@ -206,17 +206,18 @@ if ($id > 0)
|
||||
$fuser->getrights();
|
||||
$user_id = $fuser->id;
|
||||
}
|
||||
|
||||
// Récupération des congés payés de l'utilisateur ou de tous les users
|
||||
if (empty($user->rights->holiday->read_all) || $id > 0)
|
||||
{
|
||||
$holiday_payes = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
|
||||
$result = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday
|
||||
}
|
||||
else
|
||||
{
|
||||
$holiday_payes = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday
|
||||
$result = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday
|
||||
}
|
||||
// Si erreur SQL
|
||||
if ($holiday_payes == '-1')
|
||||
if ($result == '-1')
|
||||
{
|
||||
print load_fiche_titre($langs->trans('CPTitreMenu'), '', 'title_hrm.png');
|
||||
|
||||
@ -232,6 +233,20 @@ $num = count($holiday->holiday);
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$title = $langs->trans("User");
|
||||
@ -242,11 +257,9 @@ if ($id > 0)
|
||||
|
||||
dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -273,17 +286,7 @@ print $out;
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
if ($id > 0) print '</br>';
|
||||
|
||||
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
if ($id > 0) print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
if ($id > 0) print '<br>';
|
||||
|
||||
if ($sall)
|
||||
{
|
||||
@ -381,16 +384,16 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",'','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.date_create","",'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"cp.fk_user","",'','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cp.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreateCP"),$_SERVER["PHP_SELF"],"cp.date_create","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"cp.fk_user","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','',$pram,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines
|
||||
@ -446,15 +449,16 @@ if (! empty($holiday->holiday))
|
||||
}
|
||||
|
||||
// Si il n'y a pas d'enregistrement suite à une recherche
|
||||
if($holiday_payes == '2')
|
||||
if ($result == '2')
|
||||
{
|
||||
print '<tr '.$bc[false].'>';
|
||||
print '<tr>';
|
||||
print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
/*if ($user_id == $user->id)
|
||||
|
||||
@ -62,12 +62,10 @@ if (! is_object($conf)) dolibarr_install_syslog("repair: conf file not initializ
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
*/
|
||||
|
||||
pHeader('',"upgrade2",GETPOST('action','aZ09'));
|
||||
|
||||
$actiondone=0;
|
||||
|
||||
// Action to launch the repair script
|
||||
$actiondone=1;
|
||||
|
||||
@ -79,6 +77,7 @@ print 'Option clean_orphelin_dir (0 or \'test\' or \'confirmed\') is '.(GETPOST(
|
||||
print 'Option clean_product_stock_batch (0 or \'test\' or \'confirmed\') is '.(GETPOST('clean_product_stock_batch','alpha')?GETPOST('clean_product_stock_batch','alpha'):'0').'<br>'."\n";
|
||||
print 'Option set_empty_time_spent_amount (0 or \'test\' or \'confirmed\') is '.(GETPOST('set_empty_time_spent_amount','alpha')?GETPOST('set_empty_time_spent_amount','alpha'):'0').'<br>'."\n";
|
||||
print 'Option rebuild_product_thumbs (0 or \'test\' or \'confirmed\') is '.(GETPOST('rebuild_product_thumbs','alpha')?GETPOST('rebuild_product_thumbs','alpha'):'0').'<br>'."\n";
|
||||
print 'Option force_disable_of_modules_not_found (0 or \'test\' or \'confirmed\') is '.(GETPOST('force_disable_of_modules_not_found','alpha')?GETPOST('force_disable_of_modules_not_found','alpha'):'0').'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
print '<table cellspacing="0" cellpadding="1" border="0" width="100%">';
|
||||
@ -316,6 +315,7 @@ if ($ok)
|
||||
|
||||
|
||||
|
||||
|
||||
/* From here, actions need a parameter */
|
||||
|
||||
|
||||
@ -795,6 +795,99 @@ if ($ok && GETPOST('set_empty_time_spent_amount','alpha'))
|
||||
}
|
||||
|
||||
|
||||
// clean_old_module_entries: Clean data into const when files of module were removed without being
|
||||
// clean_linked_elements: Check and clean linked elements
|
||||
if ($ok && GETPOST('force_disable_of_modules_not_found','alpha'))
|
||||
{
|
||||
print '<tr><td colspan="2"><br>*** Force modules not found to be disabled</td></tr>';
|
||||
|
||||
$sql ="SELECT DISTINCT name";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."const as c";
|
||||
$sql.=" WHERE name LIKE 'MAIN_MODULE_%_HOOKS'";
|
||||
$sql.=" ORDER BY name";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$majname = $obj->name;
|
||||
|
||||
print '<tr><td>';
|
||||
print $majname;
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (preg_match('/MAIN_MODULE_(.*)_HOOKS/i', $majname, $reg))
|
||||
{
|
||||
$name=strtolower($reg[1]);
|
||||
|
||||
if ($name)
|
||||
{
|
||||
$reloffile=$name.'/class/actions_'.$name.'.class.php';
|
||||
$result = dol_include_once($reloffile);
|
||||
if (! $result)
|
||||
{
|
||||
print ' - File of hooks ('.$reloffile.') NOT found, we disable the module.';
|
||||
if (GETPOST('force_disable_of_modules_not_found') == 'confirmed')
|
||||
{
|
||||
$sql2 ="DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_MODULE_".strtoupper($name)."_HOOKS'";
|
||||
$resql2=$db->query($sql2);
|
||||
if (! $resql2)
|
||||
{
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
$sql2 ="DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_MODULE_".strtoupper($name)."'";
|
||||
$resql2=$db->query($sql2);
|
||||
if (! $resql2)
|
||||
{
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
else
|
||||
print " - Cleaned";
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' - Canceled (test mode)';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' - File of hooks ('.$reloffile.') found, we do nothing.';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) $db->commit();
|
||||
else $db->rollback();
|
||||
}
|
||||
|
||||
print'</td></tr>';
|
||||
|
||||
if ($error) break;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>No active module with missing files found</td></tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -535,6 +535,15 @@ if (isset($totalarray['totalhtfield']))
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// If no record found
|
||||
if ($num == 0)
|
||||
{
|
||||
$colspan=1;
|
||||
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user