Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ad00a17ac3
@ -498,7 +498,10 @@ if ($mode == 'feature') {
|
|||||||
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) {
|
if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($objMod->boxes as $val) {
|
foreach ($objMod->boxes as $val) {
|
||||||
$text .= ($i ? ', ' : '').($val['file'] ? $val['file'] : $val[0]);
|
$boxstring = (empty($val['file']) ? (empty($val[0]) ? '' : $val[0]) : $val['file']);
|
||||||
|
if ($boxstring) {
|
||||||
|
$text .= ($i ? ', ' : '').$boxstring;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -632,7 +632,7 @@ if ($id) {
|
|||||||
|
|
||||||
// Active
|
// Active
|
||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
print '<a class="reposition" href="'.$url.'action='.$acts[($obj->status ? 1 : 0)].'">'.$actl[($obj->status ? 1 : 0)].'</a>';
|
print '<a class="reposition" href="'.$url.'action='.$acts[($obj->status ? 1 : 0)].'&token='.newToken().'">'.$actl[($obj->status ? 1 : 0)].'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
|
|||||||
@ -335,7 +335,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Previous Fiscal year (N-1)
|
// Previous Fiscal year (N-1)
|
||||||
foreach ($sommes as $code => $det) {
|
foreach ($sommes as $code => $det) {
|
||||||
$vars[$code] = $det['NP'];
|
$vars[$code] = empty($det['NP']) ? 0 : $det['NP'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = strtr($formula, $vars);
|
$result = strtr($formula, $vars);
|
||||||
@ -355,12 +355,16 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Year N
|
// Year N
|
||||||
$code = $cat['code']; // code of categorie ('VTE', 'MAR', ...)
|
$code = $cat['code']; // code of categorie ('VTE', 'MAR', ...)
|
||||||
$sommes[$code]['NP'] += $r;
|
if (empty($sommes[$code]['NP'])) {
|
||||||
|
$sommes[$code]['NP'] = $r;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['NP'] += $r;
|
||||||
|
}
|
||||||
|
|
||||||
// Current fiscal year (N)
|
// Current fiscal year (N)
|
||||||
if (is_array($sommes) && !empty($sommes)) {
|
if (is_array($sommes) && !empty($sommes)) {
|
||||||
foreach ($sommes as $code => $det) {
|
foreach ($sommes as $code => $det) {
|
||||||
$vars[$code] = $det['N'];
|
$vars[$code] = empty($det['N']) ? 0 : $det['N'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,13 +375,17 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
$r = dol_eval($result, 1, 1, '1');
|
$r = dol_eval($result, 1, 1, '1');
|
||||||
|
|
||||||
print '<td class="liste_total right borderright"><span class="amount">'.price($r).'</span></td>';
|
print '<td class="liste_total right borderright"><span class="amount">'.price($r).'</span></td>';
|
||||||
$sommes[$code]['N'] += $r;
|
if (empty($sommes[$code]['N'])) {
|
||||||
|
$sommes[$code]['N'] = $r;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['N'] += $r;
|
||||||
|
}
|
||||||
|
|
||||||
// Detail by month
|
// Detail by month
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth) {
|
||||||
foreach ($sommes as $code => $det) {
|
foreach ($sommes as $code => $det) {
|
||||||
$vars[$code] = $det['M'][$k];
|
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
|
||||||
}
|
}
|
||||||
$result = strtr($formula, $vars);
|
$result = strtr($formula, $vars);
|
||||||
$result = str_replace('--', '+', $result);
|
$result = str_replace('--', '+', $result);
|
||||||
@ -386,14 +394,18 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
$r = dol_eval($result, 1, 1, '1');
|
$r = dol_eval($result, 1, 1, '1');
|
||||||
|
|
||||||
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
|
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
|
||||||
$sommes[$code]['M'][$k] += $r;
|
if (empty($sommes[$code]['M'][$k])) {
|
||||||
|
$sommes[$code]['M'][$k] = $r;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['M'][$k] += $r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) < $date_startmonth) {
|
if (($k + 1) < $date_startmonth) {
|
||||||
foreach ($sommes as $code => $det) {
|
foreach ($sommes as $code => $det) {
|
||||||
$vars[$code] = $det['M'][$k];
|
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
|
||||||
}
|
}
|
||||||
$result = strtr($formula, $vars);
|
$result = strtr($formula, $vars);
|
||||||
$result = str_replace('--', '+', $result);
|
$result = str_replace('--', '+', $result);
|
||||||
@ -402,7 +414,11 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
$r = dol_eval($result, 1, 1, '1');
|
$r = dol_eval($result, 1, 1, '1');
|
||||||
|
|
||||||
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
|
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
|
||||||
$sommes[$code]['M'][$k] += $r;
|
if (empty($sommes[$code]['M'][$k])) {
|
||||||
|
$sommes[$code]['M'][$k] = $r;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['M'][$k] += $r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,14 +445,14 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
$arrayofaccountforfilter = array();
|
$arrayofaccountforfilter = array();
|
||||||
foreach ($cpts as $i => $cpt) { // Loop on each account.
|
foreach ($cpts as $i => $cpt) { // Loop on each account.
|
||||||
if (!is_null($cpt['account_number'])) {
|
if (isset($cpt['account_number'])) {
|
||||||
$arrayofaccountforfilter[] = $cpt['account_number'];
|
$arrayofaccountforfilter[] = $cpt['account_number'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// N-1
|
// N-1
|
||||||
if (!empty($arrayofaccountforfilter)) {
|
if (!empty($arrayofaccountforfilter)) {
|
||||||
$return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, $cat['dc'] ? $cat['dc'] : 0);
|
$return = $AccCat->getSumDebitCredit($arrayofaccountforfilter, $date_start_previous, $date_end_previous, empty($cat['dc']) ? 0 : $cat['dc']);
|
||||||
if ($return < 0) {
|
if ($return < 0) {
|
||||||
setEventMessages(null, $AccCat->errors, 'errors');
|
setEventMessages(null, $AccCat->errors, 'errors');
|
||||||
$resultNP = 0;
|
$resultNP = 0;
|
||||||
@ -444,8 +460,16 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
foreach ($cpts as $i => $cpt) { // Loop on each account found
|
foreach ($cpts as $i => $cpt) { // Loop on each account found
|
||||||
$resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']]) ? 0 : $AccCat->sdcperaccount[$cpt['account_number']];
|
$resultNP = empty($AccCat->sdcperaccount[$cpt['account_number']]) ? 0 : $AccCat->sdcperaccount[$cpt['account_number']];
|
||||||
|
|
||||||
$totCat['NP'] += $resultNP;
|
if (empty($totCat['NP'])) {
|
||||||
$sommes[$code]['NP'] += $resultNP;
|
$totCat['NP'] = $resultNP;
|
||||||
|
} else {
|
||||||
|
$totCat['NP'] += $resultNP;
|
||||||
|
}
|
||||||
|
if (empty($sommes[$code]['NP'])) {
|
||||||
|
$sommes[$code]['NP'] = $resultNP;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['NP'] += $resultNP;
|
||||||
|
}
|
||||||
$totPerAccount[$cpt['account_number']]['NP'] = $resultNP;
|
$totPerAccount[$cpt['account_number']]['NP'] = $resultNP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -467,23 +491,47 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($monthtoprocess.'_'.$yeartoprocess);
|
//var_dump($monthtoprocess.'_'.$yeartoprocess);
|
||||||
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, $cat['dc'] ? $cat['dc'] : 0, 'nofilter', $monthtoprocess, $yeartoprocess);
|
if (isset($cpt['account_number'])) {
|
||||||
if ($return < 0) {
|
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess);
|
||||||
setEventMessages(null, $AccCat->errors, 'errors');
|
if ($return < 0) {
|
||||||
$resultM = 0;
|
setEventMessages(null, $AccCat->errors, 'errors');
|
||||||
|
$resultM = 0;
|
||||||
|
} else {
|
||||||
|
$resultM = $AccCat->sdc;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$resultM = $AccCat->sdc;
|
$resultM = 0;
|
||||||
|
}
|
||||||
|
if (empty($totCat['M'][$k])) {
|
||||||
|
$totCat['M'][$k] = $resultM;
|
||||||
|
} else {
|
||||||
|
$totCat['M'][$k] += $resultM;
|
||||||
|
}
|
||||||
|
if (empty($sommes[$code]['M'][$k])) {
|
||||||
|
$sommes[$code]['M'][$k] = $resultM;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['M'][$k] += $resultM;
|
||||||
|
}
|
||||||
|
if (isset($cpt['account_number'])) {
|
||||||
|
$totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
|
||||||
}
|
}
|
||||||
$totCat['M'][$k] += $resultM;
|
|
||||||
$sommes[$code]['M'][$k] += $resultM;
|
|
||||||
$totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
|
|
||||||
|
|
||||||
$resultN += $resultM;
|
$resultN += $resultM;
|
||||||
}
|
}
|
||||||
|
|
||||||
$totCat['N'] += $resultN;
|
if (empty($totCat)) {
|
||||||
$sommes[$code]['N'] += $resultN;
|
$totCat['N'] = $resultN;
|
||||||
$totPerAccount[$cpt['account_number']]['N'] = $resultN;
|
} else {
|
||||||
|
$totCat['N'] += $resultN;
|
||||||
|
}
|
||||||
|
if (empty($sommes[$code]['N'])) {
|
||||||
|
$sommes[$code]['N'] = $resultN;
|
||||||
|
} else {
|
||||||
|
$sommes[$code]['N'] += $resultN;
|
||||||
|
}
|
||||||
|
if (isset($cpt['account_number'])) {
|
||||||
|
$totPerAccount[$cpt['account_number']]['N'] = $resultN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -543,16 +591,26 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
// Loop on detail of all accounts to output the detail
|
// Loop on detail of all accounts to output the detail
|
||||||
if ($showaccountdetail != 'no') {
|
if ($showaccountdetail != 'no') {
|
||||||
foreach ($cpts as $i => $cpt) {
|
foreach ($cpts as $i => $cpt) {
|
||||||
$resultNP = $totPerAccount[$cpt['account_number']]['NP'];
|
if (isset($cpt['account_number'])) {
|
||||||
$resultN = $totPerAccount[$cpt['account_number']]['N'];
|
$resultNP = $totPerAccount[$cpt['account_number']]['NP'];
|
||||||
|
$resultN = $totPerAccount[$cpt['account_number']]['N'];
|
||||||
|
} else {
|
||||||
|
$resultNP = 0;
|
||||||
|
$resultN = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($showaccountdetail == 'all' || $resultN != 0) {
|
if ($showaccountdetail == 'all' || $resultN != 0) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td class="tdoverflowmax250 borderright">';
|
|
||||||
print ' '.length_accountg($cpt['account_number']);
|
if (isset($cpt['account_number'])) {
|
||||||
print ' - ';
|
$labeldetail = ' '.length_accountg($cpt['account_number']).' - '.$cpt['account_label'];
|
||||||
print $cpt['account_label'];
|
} else {
|
||||||
|
$labeldetail = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="tdoverflowmax250 borderright" title="'.dol_escape_htmltag($labeldetail).'">';
|
||||||
|
print dol_escape_htmltag($labeldetail);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right"><span class="amount">'.price($resultNP).'</span></td>';
|
print '<td class="right"><span class="amount">'.price($resultNP).'</span></td>';
|
||||||
print '<td class="right borderright"><span class="amount">'.price($resultN).'</span></td>';
|
print '<td class="right borderright"><span class="amount">'.price($resultN).'</span></td>';
|
||||||
@ -560,13 +618,21 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
// Make one call for each month
|
// Make one call for each month
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth) {
|
||||||
$resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
|
if (isset($cpt['account_number'])) {
|
||||||
|
$resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
|
||||||
|
} else {
|
||||||
|
$resultM = 0;
|
||||||
|
}
|
||||||
print '<td class="right"><span class="amount">'.price($resultM).'</span></td>';
|
print '<td class="right"><span class="amount">'.price($resultM).'</span></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) < $date_startmonth) {
|
if (($k + 1) < $date_startmonth) {
|
||||||
$resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
|
if (isset($cpt['account_number'])) {
|
||||||
|
$resultM = empty($totPerAccount[$cpt['account_number']]['M'][$k]) ? 0 : $totPerAccount[$cpt['account_number']]['M'][$k];
|
||||||
|
} else {
|
||||||
|
$resultM = 0;
|
||||||
|
}
|
||||||
print '<td class="right"><span class="amount">'.price($resultM).'</span></td>';
|
print '<td class="right"><span class="amount">'.price($resultM).'</span></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1789,6 +1789,8 @@ class Contact extends CommonObject
|
|||||||
$sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact";
|
$sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc";
|
$sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc";
|
||||||
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."socpeople sp";
|
||||||
|
$sql .= " ON sc.fk_socpeople = sp.rowid AND sp.statut = 1";
|
||||||
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
|
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
|
||||||
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
|
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
|
||||||
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
|
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
|
||||||
|
|||||||
@ -34,6 +34,9 @@ class Utils
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
public $error;
|
||||||
|
public $errors;
|
||||||
|
|
||||||
public $output; // Used by Cron method to return message
|
public $output; // Used by Cron method to return message
|
||||||
public $result; // Used by Cron method to return data
|
public $result; // Used by Cron method to return data
|
||||||
|
|
||||||
|
|||||||
@ -976,8 +976,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
$tmp = json_decode($obj->note, true);
|
$tmp = json_decode($obj->note, true);
|
||||||
}
|
}
|
||||||
return array(
|
return array(
|
||||||
'authorid' => $tmp['authorid'],
|
'authorid' => empty($tmp['authorid']) ? '' : $tmp['authorid'],
|
||||||
'ip' => $tmp['ip'],
|
'ip' => empty($tmp['ip']) ? '' : $tmp['ip'],
|
||||||
'lastactivationdate' => $this->db->jdate($obj->tms),
|
'lastactivationdate' => $this->db->jdate($obj->tms),
|
||||||
'lastactivationversion' => (!empty($tmp['lastactivationversion']) ? $tmp['lastactivationversion'] : 'unknown'),
|
'lastactivationversion' => (!empty($tmp['lastactivationversion']) ? $tmp['lastactivationversion'] : 'unknown'),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -40,6 +40,11 @@ class CommActionRapport
|
|||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
|
public $error;
|
||||||
|
|
||||||
|
public $errors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string description
|
* @var string description
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4509,7 +4509,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</strong>';
|
print '</strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocpdfrel).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocrelpdf).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
|
|||||||
@ -147,7 +147,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
|
|||||||
$sql .= $hookmanager->resPrint;
|
$sql .= $hookmanager->resPrint;
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('stock').')';
|
|
||||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
||||||
}
|
}
|
||||||
@ -168,6 +167,7 @@ if (!empty($search_categ) && $search_categ != '-1') {
|
|||||||
}
|
}
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
}
|
}
|
||||||
|
$sql .= " AND EXISTS (SELECT e.rowid FROM ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = s.fk_entrepot AND e.entity IN (".getEntity('stock')."))";
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall);
|
$sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall);
|
||||||
}
|
}
|
||||||
@ -363,6 +363,13 @@ if ($resql) {
|
|||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
|
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" type="text" name="sref" size="6" value="'.$sref.'">';
|
print '<input class="flat" type="text" name="sref" size="6" value="'.$sref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -391,14 +398,20 @@ if ($resql) {
|
|||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
print $searchpicto;
|
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||||
print '</td>';
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
//Line for column titles
|
//Line for column titles
|
||||||
print "<tr class=\"liste_titre\">";
|
print "<tr class=\"liste_titre\">";
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print_liste_field_titre('');
|
||||||
|
}
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
|
||||||
if (isModEnabled("service") && $type == 1) {
|
if (isModEnabled("service") && $type == 1) {
|
||||||
@ -429,7 +442,10 @@ if ($resql) {
|
|||||||
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
print_liste_field_titre('');
|
// Action column
|
||||||
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print_liste_field_titre('');
|
||||||
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
@ -440,6 +456,10 @@ if ($resql) {
|
|||||||
$product->load_stock();
|
$product->load_stock();
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $product->getNomUrl(1, '', 16);
|
print $product->getNomUrl(1, '', 16);
|
||||||
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
|
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
|
||||||
@ -504,7 +524,11 @@ if ($resql) {
|
|||||||
$parameters = array('obj'=>$objp);
|
$parameters = array('obj'=>$objp);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $product); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
print '<td></td>';
|
// Action column
|
||||||
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,7 +227,7 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps on p.rowid = ps.fk_pro
|
|||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on ps.fk_entrepot = e.rowid'; // Link on unique key
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on ps.fk_entrepot = e.rowid'; // Link on unique key
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_batch as pb on pb.fk_product_stock = ps.rowid'; // Detail for each lot on each warehouse
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_batch as pb on pb.fk_product_stock = ps.rowid'; // Detail for each lot on each warehouse
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowid AND pl.batch = pb.batch'; // Link on unique key
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowid AND pl.batch = pb.batch'; // Link on unique key
|
||||||
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
$sql .= " WHERE p.entity IN (".getEntity('product').") AND e.entity IN (".getEntity('stock').")";
|
||||||
if (!empty($search_categ) && $search_categ != '-1') {
|
if (!empty($search_categ) && $search_categ != '-1') {
|
||||||
$sql .= " AND ";
|
$sql .= " AND ";
|
||||||
if ($search_categ == -2) {
|
if ($search_categ == -2) {
|
||||||
@ -514,6 +514,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|||||||
// Fields title search
|
// Fields title search
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
|
$searchpicto = $form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" type="text" name="sref" size="6" value="'.$sref.'">';
|
print '<input class="flat" type="text" name="sref" size="6" value="'.$sref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -571,6 +578,10 @@ $totalarray['nbfield'] = 0;
|
|||||||
// Fields title label
|
// Fields title label
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print_liste_field_titre('');
|
||||||
|
}
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
|
||||||
if (isModEnabled("service") && $type == 1) {
|
if (isModEnabled("service") && $type == 1) {
|
||||||
@ -591,7 +602,9 @@ print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique",
|
|||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre('');
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print_liste_field_titre('');
|
||||||
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
@ -648,6 +661,11 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $product_static->getNomUrl(1, '', 16);
|
print $product_static->getNomUrl(1, '', 16);
|
||||||
@ -711,7 +729,10 @@ while ($i < $imaxinloop) {
|
|||||||
|
|
||||||
print '<td class="right nowrap">'.$product_static->LibStatut($objp->tobuy, 5, 1).'</td>';
|
print '<td class="right nowrap">'.$product_static->LibStatut($objp->tobuy, 5, 1).'</td>';
|
||||||
|
|
||||||
print '<td></td>';
|
// Action column
|
||||||
|
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||||
|
print '<td></td>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -46,9 +46,6 @@ if (!defined('NOLOGIN')) {
|
|||||||
if (!defined('NOCSRFCHECK')) {
|
if (!defined('NOCSRFCHECK')) {
|
||||||
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
||||||
}
|
}
|
||||||
if (!defined('NOIPCHECK')) {
|
|
||||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
|
||||||
}
|
|
||||||
if (!defined('NOBROWSERNOTIF')) {
|
if (!defined('NOBROWSERNOTIF')) {
|
||||||
define('NOBROWSERNOTIF', '1');
|
define('NOBROWSERNOTIF', '1');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -549,6 +549,8 @@ if ($action == "dosign" && empty($cancel)) {
|
|||||||
$("#signbutton").attr("disabled",false);
|
$("#signbutton").attr("disabled",false);
|
||||||
if(!$._data($("#signbutton")[0], "events")){
|
if(!$._data($("#signbutton")[0], "events")){
|
||||||
$("#signbutton").on("click",function(){
|
$("#signbutton").on("click",function(){
|
||||||
|
console.log("We click on button sign");
|
||||||
|
$("#signbutton").val(\''.dol_escape_js($langs->transnoentities('PleaseBePatient')).'\');
|
||||||
var signature = $("#signature").jSignature("getData", "image");
|
var signature = $("#signature").jSignature("getData", "image");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|||||||
@ -252,7 +252,7 @@ if (is_array($results)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<b class="wordbreak">';
|
print '<b class="wordbreak">';
|
||||||
print $tmpuser->getFullName();
|
print $tmpuser->getFullName($langs);
|
||||||
print ' '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope');
|
print ' '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope');
|
||||||
print '</b>';
|
print '</b>';
|
||||||
print '</b><br>';
|
print '</b><br>';
|
||||||
|
|||||||
@ -71,6 +71,8 @@ if (empty($conf->global->MAILING_LIMIT_SENDBYCLI)) {
|
|||||||
$conf->global->MAILING_LIMIT_SENDBYCLI = 0;
|
$conf->global->MAILING_LIMIT_SENDBYCLI = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$langs->loadLangs(array("main", "mails"));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Main
|
* Main
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user