mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 11:15:21 +01:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
@@ -243,7 +243,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -65,14 +65,6 @@ $formventilation = new FormVentilation($db);
|
||||
$formother = new FormOther($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
}
|
||||
|
||||
if (empty($search_date_start)) {
|
||||
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
|
||||
@@ -106,6 +98,19 @@ if (! empty($search_accountancy_code_end)) {
|
||||
* Action
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$journal = 'bookkepping';
|
||||
@@ -132,155 +137,148 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
|
||||
else {
|
||||
$title_page = $langs->trans("AccountBalance") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$title_page = $langs->trans("AccountBalance") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
/*
|
||||
* List
|
||||
*/
|
||||
$nbtotalofrecords = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, 0, 'title_accountancy');
|
||||
|
||||
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<div class="tabsAction">' . "\n";
|
||||
print '<div class="inline-block divButAction"><input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . '" /></div>';
|
||||
print '</div>';
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('DateStart') . ': ';
|
||||
$moreforfilter.=$form->select_date($search_date_start, 'date_start', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter.=$langs->trans('DateEnd') . ': ';
|
||||
$moreforfilter.=$form->select_date($search_date_end, 'date_end', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
$displayed_account = "";
|
||||
|
||||
foreach ( $object->lines as $line ) {
|
||||
$var = ! $var;
|
||||
$link = '';
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||
if(empty($description)){
|
||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() .'</a>';
|
||||
}
|
||||
print '<tr'. $bc[$var].'>';
|
||||
|
||||
|
||||
// Permet d'afficher le compte comptable
|
||||
if ($root_account_description != $displayed_account) {
|
||||
|
||||
// Affiche un Sous-Total par compte comptable
|
||||
if ($displayed_account != "") {
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td><td class="nowrap" align="right">'.price($sous_total_credit-$sous_total_debit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Affiche le compte comptable en d<>but de ligne
|
||||
print "<tr>";
|
||||
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">'. $root_account_description .'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$displayed_account = $root_account_description;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// $object->get_compte_racine($line->numero_compte);
|
||||
|
||||
|
||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||
print '<td>' . $description . '</td>';
|
||||
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="center">' . $link;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Comptabilise le sous-total
|
||||
$sous_total_debit += $line->debit;
|
||||
$sous_total_credit += $line->credit;
|
||||
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td><td class="nowrap" align="right">'.price($sous_total_credit-$sous_total_debit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">'.$langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">'.price($total_debit).'</td><td class="nowrap" align="right">'.price($total_credit).'</td><td class="nowrap" align="right">'.price($total_credit-$total_debit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$result = $object->fetchAllBalance($sortorder, $sortfield, $limit, $offset, $filter);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
$button = '<input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . '" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, 0, 'title_accountancy', 0, $button);
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('DateStart') . ': ';
|
||||
$moreforfilter .= $form->select_date($search_date_start, 'date_start', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter .= $langs->trans('DateEnd') . ': ';
|
||||
$moreforfilter .= $form->select_date($search_date_end, 'date_end', 0, 0, 1, '', 1, 0, 1);
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
if (! empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<table class="liste ' . ($moreforfilter ? "listwithfilterbefore" : "") . '">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
$displayed_account = "";
|
||||
|
||||
foreach ($object->lines as $line) {
|
||||
$var = ! $var;
|
||||
$link = '';
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
$description = $object->get_compte_desc($line->numero_compte); // Search description of the account
|
||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
||||
if (empty($description)) {
|
||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
print '<tr' . $bc[$var] . '>';
|
||||
|
||||
// Permet d'afficher le compte comptable
|
||||
if ($root_account_description != $displayed_account) {
|
||||
|
||||
// Affiche un Sous-Total par compte comptable
|
||||
if ($displayed_account != "") {
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Affiche le compte comptable en d<>but de ligne
|
||||
print "<tr>";
|
||||
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">' . $root_account_description . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$displayed_account = $root_account_description;
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
}
|
||||
|
||||
// $object->get_compte_racine($line->numero_compte);
|
||||
|
||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||
print '<td>' . $description . '</td>';
|
||||
print '<td align="right">' . number_format($line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="right">' . number_format($line->credit - $line->debit, 2, ',', ' ') . '</td>';
|
||||
print '<td align="center">' . $link;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Comptabilise le sous-total
|
||||
$sous_total_debit += $line->debit;
|
||||
$sous_total_credit += $line->credit;
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit - $sous_total_debit) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price($total_credit - $total_debit) . '</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
}
|
||||
$db->close();
|
||||
@@ -288,12 +288,12 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
|
||||
$title_page = $langs->trans("Bookkeeping");
|
||||
if ($search_date_start || $search_date_end) $title_page .= ' ' . dol_print_date($search_date_start, 'day') . ' - ' . dol_print_date($search_date_end, 'day');
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -356,20 +356,21 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
$button = '<a class="butAction" name="button_export_csv" href="'.$_SERVER["PHP_SELF"].'?action=export_csv'.($param?'&'.$param:'').'">';
|
||||
if (count($filter)) $button.= $langs->trans("ExportFilteredList");
|
||||
else $button.= $langs->trans("ExportList");
|
||||
$button.= '</a>';
|
||||
|
||||
$groupby = ' <a href="./listbyaccount.php">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby, '', $limit);
|
||||
|
||||
print '<div class="tabsAction">' . "\n";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" name="button_export_csv" href="'.$_SERVER["PHP_SELF"].'?action=export_csv'.($param?'&'.$param:'').'">';
|
||||
if (count($filter)) print $langs->trans("ExportFilteredList");
|
||||
else print $langs->trans("ExportList");
|
||||
print '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear'.($param?'&'.$param:'').'">' . $langs->trans("DelBookKeeping") . '</a></div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print ' <a href="./listbyaccount.php">' . $langs->trans("GroupByAccountAccounting") . '</a><br><br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||
|
||||
@@ -156,13 +156,13 @@ if ($action == 'delmouvconfirm') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||
$title_page = $langs->trans("Bookkeeping") . ' ' . strtolower($langs->trans("By")) . ' ' . $langs->trans("AccountAccounting");
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
@@ -207,7 +207,9 @@ if ($action == 'delbookkeepingyear') {
|
||||
|
||||
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,'','',$limit);
|
||||
$viewflat = ' <a href="./list.php">' . $langs->trans("ViewFlatList") . '</a>';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,$viewflat,'',$limit);
|
||||
|
||||
// Reverse sort order
|
||||
if ( preg_match('/^asc/i', $sortorder) )
|
||||
@@ -219,8 +221,6 @@ print '<div class="tabsAction">' . "\n";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a></div>';
|
||||
print '</div>';
|
||||
|
||||
print ' <a href="./list.php">' . $langs->trans("ViewFlatList") . '</a><br><br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans("AccountAccounting") . '</td>';
|
||||
@@ -331,14 +331,15 @@ foreach ( $object->lines as $line ) {
|
||||
}
|
||||
|
||||
// Affiche un Sous-Total du dernier compte comptable affiché
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right" colspan="5">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Affiche le Total
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right" colspan="4">'.$langs->trans("Total").':</td>';
|
||||
print '<td align="right" colspan="5">'.$langs->trans("Total").':</td>';
|
||||
print '<td align="right">';
|
||||
print price($total_debit);
|
||||
print '</td>';
|
||||
|
||||
@@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
|
||||
* Mode List
|
||||
*/
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
|
||||
if ($nbtotalofrecords < 0) {
|
||||
|
||||
@@ -60,10 +60,10 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Load record in memory
|
||||
*
|
||||
* @param int $rowid Id
|
||||
* @param string $account_number Account number
|
||||
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $rowid Id
|
||||
* @param string $account_number Account number
|
||||
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
|
||||
* @return int <0 if KO, Id of record if OK and found
|
||||
*/
|
||||
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) {
|
||||
global $conf;
|
||||
|
||||
@@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -215,7 +215,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -75,9 +75,12 @@ $form = new Form($db);
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans('ReportInOut') . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
|
||||
print load_fiche_titre($langs->trans('ReportInOut'), $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, 'title_accountancy');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
$moreforfilter='';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
$months = array( $langs->trans("JanuaryMin"),
|
||||
$langs->trans("FebruaryMin"),
|
||||
@@ -93,7 +96,8 @@ $months = array( $langs->trans("JanuaryMin"),
|
||||
$langs->trans("DecemberMin"),
|
||||
);
|
||||
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans("Account").'</th>';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th class="liste_titre">'.$langs->trans("Account").'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans("Description").'</th>';
|
||||
print '<th class="liste_titre" align="center">N-1</th>';
|
||||
print '<th class="liste_titre" align="center">'.$langs->trans("NReal").'</th>';
|
||||
@@ -257,6 +261,7 @@ if (!empty($cats))
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records with no order and no limits
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
|
||||
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -414,7 +414,7 @@ if ($rowid > 0)
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
}
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -46,27 +46,27 @@ if (!$user->admin) accessforbidden();
|
||||
$modules = array(
|
||||
'SOCIETE' => 'FCKeditorForCompany',
|
||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'DETAILS' => 'FCKeditorForProductDetails',
|
||||
'USERSIGN' => 'FCKeditorForUserSignature',
|
||||
'MAILING' => 'FCKeditorForMailing',
|
||||
'MAIL' => 'FCKeditorForMail'
|
||||
);
|
||||
// Conditions pour que l'option soit proposee
|
||||
$conditions = array(
|
||||
'SOCIETE' => 1,
|
||||
'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)),
|
||||
'MAILING' => ! empty($conf->mailing->enabled),
|
||||
'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->supplier_proposal->enabled) || ! empty($conf->fournisseur->enabled)),
|
||||
'USERSIGN' => 1,
|
||||
'MAILING' => ! empty($conf->mailing->enabled),
|
||||
'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled))
|
||||
);
|
||||
// Picto
|
||||
$picto = array(
|
||||
'SOCIETE' => 'generic',
|
||||
'PRODUCTDESC' => 'product',
|
||||
'MAILING' => 'email',
|
||||
'DETAILS' => 'generic',
|
||||
'DETAILS' => 'product',
|
||||
'USERSIGN' => 'user',
|
||||
'MAILING' => 'email',
|
||||
'MAIL' => 'email'
|
||||
);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ $langs->load("products");
|
||||
$langs->load("members");
|
||||
$langs->load("projects");
|
||||
$langs->load("hrm");
|
||||
$langs->load("agenda");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
@@ -33,5 +33,5 @@ NETWORK:
|
||||
# If the browser is unable to retrieve the original content, the fallback resource will be used.
|
||||
# In the example above, we display a static image in case the dynamic one is unavailable.
|
||||
FALLBACK:
|
||||
#/ public/offline.php
|
||||
#theme/amarok/img/* theme/eldy/img/
|
||||
#/ public/notice.php
|
||||
#theme/eldy/img/* theme/md/img/*
|
||||
|
||||
@@ -209,7 +209,7 @@ class Categories extends DolibarrApi
|
||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
|
||||
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
|
||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
|
||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
|
||||
$sql.= " GROUP BY year, month, df";
|
||||
$sql.= " ORDER BY year DESC, month DESC, df DESC";
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -592,7 +592,7 @@ if ($id > 0)
|
||||
$propal_static->total_tva = $objp->total_tva;
|
||||
$propal_static->total_ttc = $objp->total_ttc;
|
||||
print $propal_static->getNomUrl(1);
|
||||
if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
|
||||
if ( ($db->jdate($objp->datelimite) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
print '</td><td align="right" width="80px">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
|
||||
@@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
|
||||
$sql .= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -670,6 +670,7 @@ class Propal extends CommonObject
|
||||
//Fetch current line from the database and then clone the object and set it in $oldline property
|
||||
$line = new PropaleLigne($this->db);
|
||||
$line->fetch($rowid);
|
||||
$line->fetch_optionals(); // Fetch extrafields for oldcopy
|
||||
|
||||
$staticline = clone $line;
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.=', p.ref DESC';
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -138,7 +138,7 @@ class CommandeApi extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -501,7 +501,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
$nbtotalofpages = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -137,7 +137,7 @@ class InvoiceApi extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1555,7 +1555,7 @@ else
|
||||
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'";
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -133,7 +133,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
|
||||
$fieldstosearchall = array(
|
||||
'f.facnumber'=>'Ref',
|
||||
'f.ref_client'=>'RefCustomer',
|
||||
'fd.description'=>'Description',
|
||||
'pd.description'=>'Description',
|
||||
's.nom'=>"ThirdParty",
|
||||
'f.note_public'=>'NotePublic',
|
||||
);
|
||||
@@ -156,7 +156,7 @@ $arrayfields=array(
|
||||
'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
||||
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
|
||||
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
|
||||
'am'=>array('label'=>$langs->trans("Received"), 'checked'=>0),
|
||||
'dynamount_payed'=>array('label'=>$langs->trans("Received"), 'checked'=>0),
|
||||
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
|
||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||
@@ -253,7 +253,9 @@ $sql.= ' f.datec as date_creation, f.tms as date_update,';
|
||||
$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name";
|
||||
if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status
|
||||
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
|
||||
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
|
||||
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
// Add fields from hooks
|
||||
@@ -267,7 +269,6 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'facture as f';
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_extrafields as ef on (f.rowid = ef.fk_object)";
|
||||
if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
|
||||
else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_facture = f.rowid';
|
||||
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
|
||||
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
@@ -401,7 +402,7 @@ $listfield=explode(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
|
||||
$sql.= ' f.rowid DESC ';
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -655,8 +656,8 @@ if ($resql)
|
||||
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'],$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['am']['checked'])) print_liste_field_titre($arrayfields['am']['label'],$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'rtp','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['dynamount_payed']['checked'])) print_liste_field_titre($arrayfields['dynamount_payed']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
@@ -675,7 +676,7 @@ if ($resql)
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER["PHP_SELF"],"f.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'],$_SERVER["PHP_SELF"],"fk_statut,paye,type,dynamount_payed","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -786,7 +787,7 @@ if ($resql)
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.$search_montant_ttc.'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['am']['checked']))
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '</td>';
|
||||
@@ -1025,9 +1026,9 @@ if ($resql)
|
||||
$totalarray['totalttc'] += $obj->total_ttc;
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['am']['checked']))
|
||||
if (! empty($arrayfields['dynamount_payed']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs):' ').'</td>';
|
||||
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalamfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalam'] += $paiement;
|
||||
@@ -1035,7 +1036,7 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['rtp']['checked']))
|
||||
{
|
||||
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').'</td>';
|
||||
print '<td align="right">'.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').'</td>'; // TODO Use a denormalized field
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield'];
|
||||
$totalarray['totalrtp'] += $remaintopay;
|
||||
|
||||
@@ -112,7 +112,7 @@ else if ($year > 0)
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -171,7 +171,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="6" name="search_amount" value="'.$search_amount.'">';
|
||||
print '<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.'">';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
@@ -190,7 +190,7 @@ if ($resql)
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Num ref cheque
|
||||
print '<td width="80">';
|
||||
print '<td>';
|
||||
$checkdepositstatic->id=$objp->rowid;
|
||||
$checkdepositstatic->ref=($objp->ref?$objp->ref:$objp->rowid);
|
||||
$checkdepositstatic->statut=$objp->statut;
|
||||
|
||||
@@ -186,7 +186,7 @@ else
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -52,6 +52,17 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
|
||||
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='s.nom, s.rowid';
|
||||
if (! $sortorder) $sortorder='ASC';
|
||||
|
||||
// Date range
|
||||
$year=GETPOST("year");
|
||||
if (empty($year))
|
||||
@@ -155,12 +166,23 @@ if (! empty($conf->accounting->enabled))
|
||||
}
|
||||
|
||||
// Show report array
|
||||
$param='&modecompta='.$modecompta;
|
||||
if ($date_startday) $param.='&date_startday='.$date_startday;
|
||||
if ($date_startmonth) $param.='&date_startmonth='.$date_startmonth;
|
||||
if ($date_startyear) $param.='&date_startyear='.$date_startyear;
|
||||
if ($date_endday) $param.='&date_endday='.$date_endday;
|
||||
if ($date_endmonth) $param.='&date_endmonth='.$date_endmonth;
|
||||
if ($date_endyear) $param.='&date_endyear='.$date_startyear;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="10%"> </td><td> </td>';
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Name"), $_SERVER["PHP_SELF"],'s.nom, s.rowid','',$param,'',$sortfield,$sortorder);
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
print "<td align=\"right\">".$langs->trans("AmountHT")."</td>";
|
||||
print "<td align=\"right\">".$langs->trans("AmountTTC")."</td>";
|
||||
{
|
||||
print_liste_field_titre($langs->trans("AmountHT"), $_SERVER["PHP_SELF"],'amount_ht','',$param,'align="right"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("AmountTTC"), $_SERVER["PHP_SELF"],'amount_ttc','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
/*
|
||||
@@ -202,7 +224,7 @@ else
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY s.nom, s.rowid";
|
||||
$sql.= " ORDER BY s.nom, s.rowid";
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
dol_syslog("get customer invoices", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -328,7 +350,7 @@ else
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
$sql .= " GROUP BY s.nom, s.rowid";
|
||||
$sql .= " ORDER BY s.nom, s.rowid";
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
print '<tr><td colspan="4">'.$langs->trans("SuppliersInvoices").'</td></tr>';
|
||||
|
||||
@@ -413,7 +435,11 @@ else
|
||||
}
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get social contributions deductible=0", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
@@ -473,8 +499,6 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -488,9 +512,13 @@ else
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$sql.= " ORDER BY c.libelle, c.id";
|
||||
}
|
||||
$sql.= " GROUP BY c.libelle, c.id";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'c.libelle, c.id';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get social contributions deductible=1", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
@@ -574,8 +602,12 @@ if (! empty($conf->salaries->enabled))
|
||||
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
|
||||
$sql.= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
|
||||
$sql.= " ORDER BY u.firstname";
|
||||
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'u.firstname, u.lastname';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get payment salaries");
|
||||
$result=$db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
@@ -642,7 +674,7 @@ if (! empty($conf->expensereport->enabled))
|
||||
|
||||
$column='p.date_valid';
|
||||
} else {
|
||||
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc";
|
||||
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid";
|
||||
@@ -656,55 +688,59 @@ if (! empty($conf->expensereport->enabled))
|
||||
print '<tr><td colspan="4">'.$langs->trans("ExpenseReport").'</td></tr>';
|
||||
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
{
|
||||
$sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
|
||||
$sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.ref';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
$sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm";
|
||||
$sql.= " ORDER BY p.ref";
|
||||
|
||||
dol_syslog("get expense report outcome");
|
||||
$result=$db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
if ($result)
|
||||
dol_syslog("get expense report outcome");
|
||||
$result=$db->query($sql);
|
||||
$subtotal_ht = 0;
|
||||
$subtotal_ttc = 0;
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
if ($num)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
if ($num)
|
||||
while ($obj = $db->fetch_object($result))
|
||||
{
|
||||
while ($obj = $db->fetch_object($result))
|
||||
{
|
||||
$total_ht -= $obj->amount_ht;
|
||||
$total_ttc -= $obj->amount_ttc;
|
||||
$subtotal_ht += $obj->amount_ht;
|
||||
$subtotal_ttc += $obj->amount_ttc;
|
||||
$total_ht -= $obj->amount_ht;
|
||||
$total_ttc -= $obj->amount_ttc;
|
||||
$subtotal_ht += $obj->amount_ht;
|
||||
$subtotal_ttc += $obj->amount_ttc;
|
||||
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
|
||||
print "<td>".$langs->trans("ExpenseReport")." <a href=\"".DOL_URL_ROOT."/expensereport/list.php?search_user=".$obj->userid."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price(-$obj->amount_ttc).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
|
||||
|
||||
print "<td>".$langs->trans("ExpenseReport")." <a href=\"".DOL_URL_ROOT."/expensereport/list.php?search_user=".$obj->userid."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price(-$obj->amount_ttc).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ttc).'</td>';
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var]."><td> </td>";
|
||||
print '<td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ht).'</td>';
|
||||
print '<td colspan="3" align="right">'.price(-$subtotal_ttc).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -733,7 +769,11 @@ if (! empty($conf->don->enabled))
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
|
||||
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
|
||||
$sql.= " ORDER BY p.societe, p.firstname, p.lastname, dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'p.societe, p.firstname, p.lastname, dm';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get dunning");
|
||||
$result=$db->query($sql);
|
||||
@@ -808,7 +848,11 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get vat to pay", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
@@ -853,7 +897,11 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get vat received back", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
@@ -897,7 +945,11 @@ else
|
||||
$sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND t.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get vat really paid", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
@@ -938,7 +990,11 @@ else
|
||||
$sql.= " AND t.datev >= '".$db->idate($date_start)."' AND t.datev <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND t.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm";
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') $newsortfield = 'dm';
|
||||
if ($newsortfield == 'amount_ht') $newsortfield = 'amount';
|
||||
if ($newsortfield == 'amount_ttc') $newsortfield = 'amount';
|
||||
$sql.= $db->order($newsortfield, $sortorder);
|
||||
|
||||
dol_syslog("get vat really received back", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* 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
|
||||
@@ -72,6 +73,14 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
// payment mode
|
||||
if ($action == 'setmode' && $user->rights->tax->charges->creer) {
|
||||
$object->fetch($id);
|
||||
@@ -278,14 +287,16 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr>";
|
||||
|
||||
// Label
|
||||
print '<td class="fieldrequired">';
|
||||
print "<tr>";
|
||||
print '<td class="titlefieldcreate fieldrequired">';
|
||||
print $langs->trans("Label");
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
|
||||
print '<td><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
|
||||
// Type
|
||||
print '<td class="fieldrequired">';
|
||||
print $langs->trans("Type");
|
||||
@@ -294,6 +305,7 @@ if ($action == 'create')
|
||||
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end period
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">';
|
||||
@@ -303,6 +315,7 @@ if ($action == 'create')
|
||||
print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">';
|
||||
@@ -310,10 +323,12 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Payment Mode
|
||||
print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
|
||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
@@ -321,6 +336,7 @@ if ($action == 'create')
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Date due
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">';
|
||||
@@ -337,7 +353,9 @@ if ($action == 'create')
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '<div>';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
@@ -356,6 +374,8 @@ if ($id > 0)
|
||||
{
|
||||
$head=tax_prepare_head($object);
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
// Clone confirmation
|
||||
if ($action === 'clone')
|
||||
{
|
||||
@@ -386,101 +406,47 @@ if ($id > 0)
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/sociales/index.php">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
/*
|
||||
// Ref
|
||||
print '<tr><td class="fieldtitle">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object,'id',$linkback);
|
||||
print "</td></tr>";
|
||||
*/
|
||||
|
||||
// Label
|
||||
if ($action == 'edit')
|
||||
/*if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" name="label" size="40" value="'.$object->lib.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$object->lib.'</td></tr>';
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
// Type
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td>".$object->type_libelle."</td>";
|
||||
|
||||
$rowspan=6;
|
||||
if (! empty($conf->banque->enabled)) $rowspan++;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
|
||||
/*
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||
$sql.= "c.code as type_code,c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE p.fk_charge = ".$id;
|
||||
$sql.= " AND p.fk_charge = cs.rowid";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_typepaiement = c.id";
|
||||
$sql.= " ORDER BY dp DESC";
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0; $total = 0;
|
||||
print '<table class="nobordernopadding paymenttable" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
|
||||
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($object->amount)."</td><td bgcolor=\"#d0d0d0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $object->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "</tr>";
|
||||
|
||||
// Period end date
|
||||
@@ -555,13 +521,85 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
||||
//print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
|
||||
/*
|
||||
* Payments
|
||||
*/
|
||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||
$sql.= "c.code as type_code,c.libelle as paiement_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql.= " WHERE p.fk_charge = ".$id;
|
||||
$sql.= " AND p.fk_charge = cs.rowid";
|
||||
$sql.= " AND cs.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_typepaiement = c.id";
|
||||
$sql.= " ORDER BY dp DESC";
|
||||
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0; $total = 0;
|
||||
print '<table class="noborder paymenttable">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("RefPayment").'</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
$labeltype=$langs->trans("PaymentType".$objp->type_code)!=("PaymentType".$objp->type_code)?$langs->trans("PaymentType".$objp->type_code):$objp->paiement_type;
|
||||
print "<td>".$labeltype.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($object->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $object->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\">".price($resteapayer)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<div align="center">';
|
||||
@@ -587,7 +625,7 @@ if ($id > 0)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/card.php",1). "?id=$object->id&action=reopen\">".$langs->trans("ReOpen")."</a>";
|
||||
}
|
||||
|
||||
|
||||
// Edit
|
||||
if ($object->paye == 0 && $user->rights->tax->charges->creer)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,8 @@ class ChargeSociales extends CommonObject
|
||||
public $element='chargesociales';
|
||||
public $table='chargesociales';
|
||||
public $table_element='chargesociales';
|
||||
|
||||
public $picto = 'bill';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -371,7 +372,7 @@ class ChargeSociales extends CommonObject
|
||||
/**
|
||||
* Retourne le libelle du statut d'une charge (impaye, payee)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @return string Label
|
||||
*/
|
||||
@@ -384,7 +385,7 @@ class ChargeSociales extends CommonObject
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @return string Label
|
||||
*/
|
||||
@@ -428,7 +429,13 @@ class ChargeSociales extends CommonObject
|
||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
|
||||
if ($mode == 6)
|
||||
{
|
||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||
}
|
||||
|
||||
return "Error, mode/status not found";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.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
|
||||
@@ -262,7 +262,11 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
$moreforfilter='';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Category filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
@@ -418,6 +422,8 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$db->free($result);
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
// $modecompta != 'CREANCES-DETTES'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
*
|
||||
@@ -260,8 +260,11 @@ if ($modecompta != 'CREANCES-DETTES') {
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
$morefilter='';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre(
|
||||
$langs->trans("User"),
|
||||
@@ -346,6 +349,8 @@ if (count($amount)) {
|
||||
$arrayforsort=$amount;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach($arrayforsort as $key => $value) {
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
@@ -432,6 +437,8 @@ if (count($amount)) {
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/stats/casoc.php
|
||||
* \brief Page reporting CA par societe
|
||||
* \brief Page reporting Turnover (CA) by thirdparty
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@@ -151,6 +151,7 @@ foreach($allparams as $key => $value) {
|
||||
$paramslink .= '&' . $key . '=' . $value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -338,8 +339,13 @@ foreach($headerparams as $key => $value)
|
||||
{
|
||||
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||
}
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
// Category filter
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Category filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true);
|
||||
@@ -614,6 +620,8 @@ if (count($amount)) {
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -178,12 +178,11 @@ if ($modecompta != 'CREANCES-DETTES')
|
||||
}
|
||||
}
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre"><td> </td>';
|
||||
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
@@ -433,6 +432,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
}
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -365,7 +365,7 @@ else
|
||||
}
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -288,7 +288,7 @@ if ($result)
|
||||
$totalnboflines = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -549,7 +549,7 @@ class FormFile
|
||||
$buttonlabeltoshow=$buttonlabel;
|
||||
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
|
||||
|
||||
if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; # So we switch to form after a generation
|
||||
if ($conf->browser->layout == 'phone') $urlsource.='#'.$forname.'_form'; // So we switch to form after a generation
|
||||
if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">';
|
||||
$out.= '<input type="hidden" name="action" value="builddoc">';
|
||||
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -935,7 +935,8 @@ class FormFile
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="modulepart" value="'.$modulepart.'">';
|
||||
}
|
||||
print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').'">';
|
||||
print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Documents2"),$url,"name","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
@@ -971,6 +972,7 @@ class FormFile
|
||||
|
||||
$editline=0;
|
||||
|
||||
print '<!-- Line list_of_documents '.$key.' -->'."\n";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td class="tdoverflow">';
|
||||
|
||||
@@ -1131,7 +1133,7 @@ class FormFile
|
||||
// Show list of documents
|
||||
if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles"));
|
||||
if (empty($url)) $url=$_SERVER["PHP_SELF"];
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<table width="100%" class="nobordernopadding">'."\n";
|
||||
print '<tr class="liste_titre">';
|
||||
$sortref="fullname";
|
||||
if ($modulepart == 'invoice_supplier') $sortref='level1name';
|
||||
@@ -1140,7 +1142,7 @@ class FormFile
|
||||
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print '</tr>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// To show ref or specific information according to view to show (defined by $module)
|
||||
if ($modulepart == 'company')
|
||||
@@ -1276,6 +1278,7 @@ class FormFile
|
||||
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
|
||||
|
||||
$var=!$var;
|
||||
print '<!-- Line list_of_autoecmfiles '.$key.' -->'."\n";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');
|
||||
|
||||
@@ -101,7 +101,7 @@ class FormPropal
|
||||
}
|
||||
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($showempty) print '<option value=""> </option>';
|
||||
if ($showempty) print '<option value="-1"> </option>';
|
||||
|
||||
foreach($listofstatus as $key => $obj)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class FormPropal
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($selected == $obj['id'])
|
||||
if ($selected != '' && $selected == $obj['id'])
|
||||
{
|
||||
print '<option value="'.$obj['id'].'" selected>';
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ function expensereport_prepare_head($object)
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||
{
|
||||
$nbNote = 0;
|
||||
if(!empty($object->note_private)) $nbNote++;
|
||||
if(!empty($object->note_public)) $nbNote++;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/expensereport/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
|
||||
$head[$h][2] = 'note';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
|
||||
@@ -1055,6 +1055,12 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
|
||||
$morehtmlstatus.=$tmptxt;
|
||||
}
|
||||
elseif ($object->element == 'chargesociales')
|
||||
{
|
||||
$tmptxt=$object->getLibStatut(6, $object->totalpaye);
|
||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
|
||||
$morehtmlstatus.=$tmptxt;
|
||||
}
|
||||
elseif ($object->element == 'facturerec')
|
||||
{
|
||||
$morehtmlstatus.='<!-- No status for recurring invoice -->';
|
||||
@@ -2579,7 +2585,7 @@ function img_warning($titlealt = 'default', $morealt = '')
|
||||
|
||||
if ($titlealt == 'default') $titlealt = $langs->trans('Warning');
|
||||
|
||||
return img_picto($titlealt, 'warning.png', 'class="pictowarning"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): ''));
|
||||
return img_picto($titlealt, 'warning.png', 'class="pictowarning valignmiddle"'.($morealt ? ($morealt == '1' ? ' style="float: right"' : ' '.$morealt): ''));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3168,7 +3174,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
|
||||
* @param int $hideselectlimit Force to hide select limit
|
||||
* @return void
|
||||
*/
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -3198,7 +3204,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
print '<td class="nobordernopadding valignmiddle">';
|
||||
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
|
||||
print '<div class="titre inline-block">'.$titre;
|
||||
if (!empty($titre) && $savtotalnboflines > 0) print ' ('.$totalnboflines.')';
|
||||
if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')';
|
||||
print '</div></td>';
|
||||
|
||||
// Center
|
||||
|
||||
@@ -20,7 +20,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
|
||||
|
||||
-- Home - Dashboard
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'Dashboard', 0, '', '', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
|
||||
|
||||
-- Home - Setup
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
|
||||
|
||||
@@ -508,7 +508,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$langs->load("users");
|
||||
|
||||
// Home - dashboard
|
||||
$newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("Dashboard"), 0, 1, '', $mainmenu, 'home');
|
||||
$newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home');
|
||||
|
||||
// Setup
|
||||
$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup');
|
||||
@@ -681,15 +681,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $menutoshow=$langs->trans("CustomersCategoriesShort");
|
||||
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $menutoshow=$langs->trans("ProspectsCategoriesShort");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=2", $menutoshow, 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
$newmenu->add("/categories/card.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
$newmenu->add("/categories/card.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
// Categories Contact
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
$newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
$newmenu->add("/categories/card.php?action=create&type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
// Categories suppliers
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
|
||||
$newmenu->add("/categories/index.php?leftmenu=catfournish&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
|
||||
$newmenu->add("/categories/card.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
|
||||
|
||||
@@ -315,9 +315,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$height_note=0;
|
||||
}
|
||||
|
||||
$iniY = $tab_top + 7;
|
||||
$curY = $tab_top + 7;
|
||||
$nexY = $tab_top + 7;
|
||||
$iniY = $tab_top + 11;
|
||||
$curY = $tab_top + 11;
|
||||
$nexY = $tab_top + 11;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0 ; $i < $nblines ; $i++)
|
||||
@@ -637,7 +637,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
if (empty($hidetop))
|
||||
{
|
||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
||||
$pdf->line($this->marge_gauche, $tab_top+10, $this->page_largeur-$this->marge_droite, $tab_top+10);
|
||||
}
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
@@ -88,9 +88,20 @@ print "</tr>";
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<td class="fieldrequired">'.$langs->trans("KeyForCronAccess").'</td>';
|
||||
print '<td><input type="text" class="flat" id="CRON_KEY" name="CRON_KEY" value="'. (GETPOST('CRON_KEY')?GETPOST('CRON_KEY'):(! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:'')) . '" size="40">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
$disabled='';
|
||||
if (! empty($conf->global->CRON_DISABLE_KEY_CHANGE)) $disabled=' disabled="disabled"';
|
||||
print '<td>';
|
||||
if (empty($conf->global->CRON_DISABLE_KEY_CHANGE))
|
||||
{
|
||||
print '<input type="text" class="flat minwidth200"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'. (GETPOST('CRON_KEY')?GETPOST('CRON_KEY'):(! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:'')) . '">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
}
|
||||
else
|
||||
{
|
||||
print (! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:'');
|
||||
print '<input type="hidden" id="CRON_KEY" name="CRON_KEY" value="'. (GETPOST('CRON_KEY')?GETPOST('CRON_KEY'):(! empty($conf->global->CRON_KEY)?$conf->global->CRON_KEY:'')) . '">';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -225,7 +225,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/disabled.php
|
||||
* \brief Page to use to replace index.php to disable all software
|
||||
*/
|
||||
?>
|
||||
<html>
|
||||
<body>
|
||||
This feature has been disabled on this test server.<br>
|
||||
Cette fonctionnalité a été désactivée sur ce serveur de test.<br>
|
||||
</body>
|
||||
</html>
|
||||
@@ -305,9 +305,6 @@ if ($action == 'create')
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tbody>';
|
||||
|
||||
$nbrows=11;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
|
||||
$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
|
||||
@@ -428,11 +425,8 @@ if (! empty($id) && $action == 'edit')
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$nbrows=12;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
|
||||
// Date
|
||||
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
$form->select_date($object->date,'','','','',"update");
|
||||
print '</td>';
|
||||
|
||||
@@ -454,10 +448,10 @@ if (! empty($id) && $action == 'edit')
|
||||
print "</tr>\n";
|
||||
|
||||
$langs->load("companies");
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$object->societe.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$object->lastname.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$object->firstname.'"></td></tr>';
|
||||
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$object->societe.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$object->lastname.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$object->firstname.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.$object->address.'</textarea></td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
@@ -468,7 +462,7 @@ if (! empty($id) && $action == 'edit')
|
||||
print '</tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
@@ -593,9 +587,6 @@ if (! empty($id) && $action != 'edit')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$nbrows=12;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
|
||||
// Ref
|
||||
/*
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
@@ -604,7 +595,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print '</tr>';
|
||||
*/
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td colspan="2">';
|
||||
print dol_print_date($object->date,"day");
|
||||
print "</td>";
|
||||
|
||||
@@ -668,13 +659,13 @@ if (! empty($id) && $action != 'edit')
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
|
||||
|
||||
/*
|
||||
* Payments
|
||||
*/
|
||||
@@ -737,16 +728,13 @@ if (! empty($id) && $action != 'edit')
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$remaintopay = $object->amount - $totalpaid;
|
||||
|
||||
@@ -821,7 +809,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ if (trim($search_name) != '')
|
||||
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -159,14 +159,13 @@ llxHeader();
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$fullpath=$conf->ecm->dir_output.'/'.$ecmdir->label.'/'.$urlfile;
|
||||
$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile;
|
||||
|
||||
$file = new stdClass();
|
||||
$file->section_id=$ecmdir->id;
|
||||
$file->label=$urlfile;
|
||||
|
||||
$head = ecm_file_prepare_head($file);
|
||||
dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
|
||||
|
||||
if ($_GET["action"] == 'edit')
|
||||
{
|
||||
@@ -177,8 +176,10 @@ if ($_GET["action"] == 'edit')
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
$s='';
|
||||
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
|
||||
$tmpecmdir->fetch($ecmdir->id);
|
||||
@@ -203,7 +204,7 @@ while ($tmpecmdir && $result > 0)
|
||||
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
|
||||
print $s;
|
||||
print ' -> ';
|
||||
if (GETPOST('action') == 'edit') print '<input type="text" name="label" size="64" value="'.$urlfile.'">';
|
||||
if (GETPOST('action') == 'edit') print '<input type="text" name="label" class="quatrevingtpercent" value="'.$urlfile.'">';
|
||||
else print $urlfile;
|
||||
print '</td></tr>';
|
||||
/*print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
@@ -234,20 +235,39 @@ print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
|
||||
print dol_print_size($totalsize);
|
||||
print '</td></tr>';
|
||||
*/
|
||||
if ($_GET["action"] == 'edit')
|
||||
{
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
print '<tr><td>'.$langs->trans("DirectDownloadLink").'</td><td>';
|
||||
$modulepart='ecm';
|
||||
$forcedownload=1;
|
||||
$rellink='/document.php?modulepart='.$modulepart;
|
||||
if ($forcedownload) $rellink.='&attachment=1';
|
||||
if (! empty($object->entity)) $rellink.='&entity='.$object->entity;
|
||||
$filepath=$relativepath.$file->label;
|
||||
$rellink.='&file='.urlencode($filepath);
|
||||
$fulllink=$urlwithroot.$rellink;
|
||||
print img_picto('','object_globe.png').' ';
|
||||
print '<input type="text" class="quatrevingtpercent" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
|
||||
print ' <a data-ajax="false" href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($_GET["action"] == 'edit')
|
||||
{
|
||||
print '</form>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
print '</div>';
|
||||
|
||||
|
||||
// Confirmation de la suppression d'une ligne categorie
|
||||
|
||||
@@ -222,7 +222,7 @@ if ($action == 'edit')
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
$s='';
|
||||
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
|
||||
$tmpecmdir->fetch($ecmdir->id);
|
||||
@@ -233,7 +233,7 @@ while ($tmpecmdir && $result > 0)
|
||||
$tmpecmdir->ref=$tmpecmdir->label;
|
||||
if ($i == 0 && $action == 'edit')
|
||||
{
|
||||
$s='<input type="text" name="label" size="40" maxlength="32" value="'.$tmpecmdir->label.'">';
|
||||
$s='<input type="text" name="label" class="minwidth300" maxlength="32" value="'.$tmpecmdir->label.'">';
|
||||
}
|
||||
else $s=$tmpecmdir->getNomUrl(1).$s;
|
||||
if ($tmpecmdir->fk_parent)
|
||||
@@ -251,7 +251,7 @@ while ($tmpecmdir && $result > 0)
|
||||
print img_picto('','object_dir').' <a href="'.DOL_URL_ROOT.'/ecm/index.php">'.$langs->trans("ECMRoot").'</a> -> ';
|
||||
print $s;
|
||||
print '</td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<textarea class="flat" name="description" cols="80">';
|
||||
|
||||
@@ -238,7 +238,7 @@ $parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -2225,7 +2225,8 @@ if ($action != 'create' && $action != 'edit')
|
||||
// If bank module is not used
|
||||
if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->fk_statut == 5)
|
||||
{
|
||||
if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
|
||||
//if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
|
||||
if ($object->paid == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id='.$object->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
|
||||
}
|
||||
|
||||
@@ -93,7 +93,15 @@ if ($object->id)
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ExpenseReport"), 0, 'trip');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
@@ -102,25 +110,22 @@ if ($object->id)
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Societe
|
||||
//print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$modulepart = 'expensereport';
|
||||
$permission = $user->rights->expensereport->creer;
|
||||
$permtoedit = $user->rights->expensereport->creer;
|
||||
|
||||
@@ -128,6 +128,7 @@ if (isset($_POST['action']))
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref, d.total_ht, d.total_tva, d.total_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
|
||||
$sql.= ' AND d.entity IN ('.getEntity('expensereport', 1).')';
|
||||
$sql.= " ORDER BY d.rowid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -147,7 +147,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u"
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE u.rowid = d.fk_user_author";
|
||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) $sql.=' AND d.fk_user_author IN ('.join(',',$childids).')';
|
||||
//$sql.= " AND d.entity = ".$conf->entity;
|
||||
$sql.= ' AND d.entity IN ('.getEntity('expensereport', 1).')';
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND d.fk_user_author = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND d.fk_user_author = ".$socid;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
@@ -43,21 +43,36 @@ $title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Info");
|
||||
$helpurl="EN:Module_Expense_Reports";
|
||||
llxHeader("",$title,$helpurl);
|
||||
|
||||
if ($id)
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
$object->info($id);
|
||||
$object->fetch($id,$ref);
|
||||
$object->info($object->id);
|
||||
|
||||
$head = expensereport_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("ExpenseReport"), 0, 'trip');
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($object);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -192,7 +192,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_valid,";
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_valid, d.date_create, d.tms as date_modif,";
|
||||
$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.statut, u.photo";
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
@@ -203,7 +203,7 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport_extrafields as ef on (d.rowid = ef.fk_object)";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE d.fk_user_author = u.rowid AND d.entity = ".$conf->entity;
|
||||
$sql.= " WHERE d.fk_user_author = u.rowid AND d.entity IN (".getEntity('expensereport', 1).")";
|
||||
// Search all
|
||||
if (!empty($sall)) $sql.= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
// Ref
|
||||
@@ -275,7 +275,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -290,7 +290,7 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$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;
|
||||
@@ -308,7 +308,7 @@ if ($resql)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
@@ -317,7 +317,7 @@ if ($resql)
|
||||
if ($user->rights->expensereport->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -334,9 +334,9 @@ if ($resql)
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||
}
|
||||
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
@@ -348,10 +348,10 @@ if ($resql)
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
@@ -493,10 +493,10 @@ if ($resql)
|
||||
$total_total_ht = 0;
|
||||
$total_total_ttc = 0;
|
||||
$total_total_tva = 0;
|
||||
|
||||
|
||||
$expensereportstatic=new ExpenseReport($db);
|
||||
$usertmp = new User($db);
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$i=0;
|
||||
@@ -512,6 +512,8 @@ if ($resql)
|
||||
$expensereportstatic->valid=$obj->date_valid;
|
||||
$expensereportstatic->date_debut=$obj->date_debut;
|
||||
$expensereportstatic->date_fin=$obj->date_fin;
|
||||
$expensereportstatic->date_create=$obj->date_create;
|
||||
$expensereportstatic->date_modif=$obj->date_modif;
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
@@ -594,7 +596,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['d.datec']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->date_create), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@@ -602,7 +604,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['d.tms']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||
print dol_print_date($db->jdate($obj->date_modif), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@@ -657,18 +659,18 @@ if ($resql)
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
|
||||
/*
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
|
||||
{
|
||||
|
||||
119
htdocs/expensereport/note.php
Normal file
119
htdocs/expensereport/note.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/commande/note.php
|
||||
* \ingroup commande
|
||||
* \brief Fiche de notes sur une commande
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
|
||||
$langs->load("trips");
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("orders");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$ref=GETPOST('ref','alpha');
|
||||
$socid=GETPOST('socid','int');
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'expensereport',$id,'');
|
||||
|
||||
|
||||
$object = new ExpenseReport($db);
|
||||
if (! $object->fetch($id, $ref) > 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$permissionnote=$user->rights->expensereport->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Note");
|
||||
$helpurl="EN:Module_Expense_Reports";
|
||||
llxHeader("",$title,$helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id, $ref);
|
||||
$object->info($object->id);
|
||||
|
||||
$head = expensereport_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("ExpenseReport"), 0, 'trip');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
/*
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
|
||||
print "</td></tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@@ -199,7 +199,7 @@ $disable_delete = 0;
|
||||
$sql = 'SELECT er.rowid as did, er.paid, er.total_ttc, per.amount';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'payment_expensereport as per,'.MAIN_DB_PREFIX.'expensereport as er';
|
||||
$sql.= ' WHERE per.fk_expensereport = er.rowid';
|
||||
$sql.= ' AND er.entity = '.$conf->entity;
|
||||
$sql.= ' AND er.entity IN ('.getEntity('expensereport', 1).')';
|
||||
$sql.= ' AND per.rowid = '.$id;
|
||||
|
||||
dol_syslog("expensereport/payment/card.php", LOG_DEBUG);
|
||||
|
||||
@@ -193,8 +193,9 @@ if (GETPOST("action") == 'create')
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">'.price($expensereport->total_ttc,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p";
|
||||
$sql.= " WHERE p.fk_expensereport = ".$chid;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p, ".MAIN_DB_PREFIX."expensereport as e";
|
||||
$sql.= " WHERE p.fk_expensereport = e.rowid AND p.fk_expensereport = ".$chid;
|
||||
$sql.= ' AND e.entity IN ('.getEntity('expensereport', 1).')';
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@@ -139,6 +139,7 @@ else:
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d";
|
||||
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid";
|
||||
$sql.= " WHERE d.fk_statut = 6";
|
||||
$sql.= ' AND d.entity IN ('.getEntity('expensereport', 1).')';
|
||||
$sql.= " ORDER BY d.date_valid DESC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@@ -280,8 +280,8 @@ else dol_print_error($db);
|
||||
/*
|
||||
* interventions to process
|
||||
*/
|
||||
/*
|
||||
if (! empty($conf->fichinter->enabled))
|
||||
|
||||
if (! empty($conf->ficheinter->enabled))
|
||||
{
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
@@ -348,9 +348,6 @@ if (! empty($conf->fichinter->enabled))
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
|
||||
$fieldstosearchall = array(
|
||||
'cf.ref'=>'Ref',
|
||||
'cf.ref_supplier'=>'RefSupplierOrder',
|
||||
//'pd.description'=>'Description',
|
||||
'pd.description'=>'Description',
|
||||
's.nom'=>"ThirdParty",
|
||||
'cf.note_public'=>'NotePublic',
|
||||
);
|
||||
@@ -371,7 +371,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -2342,7 +2342,7 @@ else
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
$paymentstatic->id=$objp->rowid;
|
||||
$paymentstatic->datepaye=$db->jdate($objp->dp);
|
||||
$paymentstatic->ref=$objp->ref;
|
||||
$paymentstatic->ref=($objp->ref ? $objp->ref : $objp->rowid);;
|
||||
$paymentstatic->num_paiement=$objp->num_paiement;
|
||||
$paymentstatic->payment_code=$objp->payment_code;
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
|
||||
@@ -127,7 +127,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search
|
||||
$fieldstosearchall = array(
|
||||
'f.ref'=>'Ref',
|
||||
'f.ref_supplier'=>'RefSupplier',
|
||||
//'fd.description'=>'Description',
|
||||
'pd.description'=>'Description',
|
||||
's.nom'=>"ThirdParty",
|
||||
'f.note_public'=>'NotePublic',
|
||||
);
|
||||
@@ -246,10 +246,10 @@ $formcompany=new FormCompany($db);
|
||||
llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
|
||||
|
||||
$sql = "SELECT";
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.datef, f.date_lim_reglement as datelimite,";
|
||||
if ($search_all || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement,";
|
||||
$sql.= " f.total_ht, f.total_ttc, f.total_tva as total_vat, f.paye as paye, f.fk_statut as fk_statut, f.libelle as label,";
|
||||
$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,";
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql.= " p.rowid as project_id, p.ref as project_ref";
|
||||
@@ -266,7 +266,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typ
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields as ef on (f.rowid = ef.fk_object)";
|
||||
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
|
||||
if ($search_all || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
|
||||
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet";
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
@@ -372,7 +372,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -435,7 +435,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy',0,'','',$limit);
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" - $soc->name":""), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
if ($search_all)
|
||||
{
|
||||
|
||||
@@ -83,13 +83,19 @@ if ($user->societe_id > 0)
|
||||
$hookmanager->initHooks(array('paymentsupplier'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label('paymentsupplier');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
|
||||
$arrayfields=array();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_account="";
|
||||
@@ -100,6 +106,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$day='';
|
||||
$year='';
|
||||
$month='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
$parameters=array('socid'=>$socid);
|
||||
@@ -590,10 +597,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
*/
|
||||
if (empty($action))
|
||||
{
|
||||
if ($page == -1) $page = 0 ;
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page=GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$offset = $limit * $page ;
|
||||
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
|
||||
@@ -627,6 +638,14 @@ if (empty($action))
|
||||
$sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label";
|
||||
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
@@ -636,53 +655,86 @@ if (empty($action))
|
||||
$i = 0;
|
||||
$var=True;
|
||||
|
||||
$paramlist='';
|
||||
$paramlist.=($search_ref?"&search_ref=".urlencode($search_ref):"");
|
||||
$paramlist.=($search_company?"&search_company=".urlencode($search_company):"");
|
||||
$paramlist.=($search_amount?"&search_amount=".urlencode($search_amount):"");
|
||||
$paramlist.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
|
||||
if ($optioncss != '') $paramlist.='&optioncss='.urlencode($optioncss);
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num, 0, 'title_accountancy.png');
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($search_ref) $param.=($search_ref?"&search_ref=".urlencode($search_ref):"");
|
||||
if ($search_company) $param.=($search_company?"&search_company=".urlencode($search_company):"");
|
||||
if ($search_amount != '') $param.=($search_amount?"&search_amount=".urlencode($search_amount):"");
|
||||
if ($search_payment_num) $param.=($search_payment_num?"&search_payment_num=".urlencode($search_payment_num):"");
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
// Add $param from extra fields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
$crit=$val;
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||
|
||||
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||
else $moreforfilter = $hookmanager->resPrint;
|
||||
|
||||
if ($moreforfilter)
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('RefPayment'),$_SERVER["PHP_SELF"],'p.rowid','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','',$paramlist,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$paramlist,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('RefPayment'),$_SERVER["PHP_SELF"],'p.rowid','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','',$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$param,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
// Lines for filters fields
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td align="left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
|
||||
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="left">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.$search_company.'">';
|
||||
print '<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.$search_payment_num.'">';
|
||||
print '<input class="flat" type="text" size="4" name="search_payment_num" value="'.dol_escape_htmltag($search_payment_num).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$form->select_comptes($search_account,'search_account',0,'',1);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
|
||||
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
|
||||
@@ -120,7 +120,7 @@ if ($fourn_id > 0)
|
||||
$sql .= " AND ppf.fk_soc = ".$fourn_id;
|
||||
}
|
||||
// Count total nb of records without orderby and limit
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -96,6 +96,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LVL'
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LBP', '[163]', 1, 'Lebanon Pound');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LRD', '[36]', 1, 'Liberia Dollar');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'LTL', '[76,116]', 1, 'Lithuania Litas');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MGA', NULL, 1, 'Ariary');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MKD', '[1076,1077,1085]', 1, 'Macedonia Denar');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MYR', '[82,77]', 1, 'Malaysia Ringgit');
|
||||
INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MRO', NULL, 1, 'Mauritania Ouguiya');
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
-- Visible in misc page
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_NOT_INSTALLED','1','chaine','Setup is running',1,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show: -1=stable+deprecated, 0=stable only (default), 1=stable+experimental, 2=stable+experimental+development',1,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_LOGTOHTML','0','chaine','If this constants is defined, it is possible to have logs inside pages by adding the parameter &logtohtml=1',1,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAILING_LIMIT_SENDBYWEB','25','chaine','Number of targets to defined packet size when sending mass email',1,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_LOG_TO_HTML','0','chaine','If this option is set to 1, it is possible to see log output at end of HTML sources by adding paramater logtohtml=1 on URL',1,0);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_LOG_TO_HTML','0','chaine','If this option is set to 1, it is possible to see log output at end of HTML sources by adding paramater logtohtml=1 on URL. Module log must also be enabled.',1,0);
|
||||
|
||||
-- Hidden and common to all entities
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_HANDLERS','["mod_syslog_file"]','chaine','Which logger to use',0,0);
|
||||
|
||||
@@ -64,6 +64,10 @@ ALTER TABLE llx_website ADD COLUMN virtualhost varchar(255) after fk_default_hom
|
||||
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_account integer after fk_type;
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_mode_reglement integer after fk_account;
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_user_author integer;
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_user_modif integer;
|
||||
ALTER TABLE llx_chargesociales ADD COLUMN fk_user_valid integer;
|
||||
|
||||
|
||||
ALTER TABLE llx_ecm_files ADD COLUMN gen_or_uploaded varchar(12) after cover;
|
||||
|
||||
@@ -215,6 +219,15 @@ create table llx_user_employment
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_date_debut (date_debut);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_date_fin (date_fin);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_statut (fk_statut);
|
||||
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve);
|
||||
|
||||
|
||||
-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate.
|
||||
drop table tmp_links_double;
|
||||
@@ -226,5 +239,7 @@ drop table tmp_links_double;
|
||||
|
||||
ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label);
|
||||
|
||||
ALTER TABLE llx_expensereport ADD UNIQUE INDEX idx_expensereport_uk_ref (ref, entity);
|
||||
|
||||
UPDATE llx_projet_task SET ref = NULL WHERE ref = '';
|
||||
ALTER TABLE llx_projet_task ADD UNIQUE INDEX uk_projet_task_ref (ref, entity);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
-- ALTER TABLE llx_accountingaccount MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||
-- ALTER TABLE llx_accountingaccount MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||
-- You can check with show full columns from llx_accountingaccount;
|
||||
-- You can check with "show full columns from llx_accountingaccount";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ create table llx_chargesociales
|
||||
tms timestamp,
|
||||
date_creation datetime, -- date de creation
|
||||
date_valid datetime, -- date de validation
|
||||
fk_user_author integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
fk_user_valid integer, -- user validating
|
||||
fk_type integer NOT NULL,
|
||||
fk_account integer, -- bank account
|
||||
fk_mode_reglement integer, -- mode de reglement
|
||||
|
||||
36
htdocs/install/mysql/tables/llx_expensereport.key.sql
Normal file
36
htdocs/install/mysql/tables/llx_expensereport.key.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2008-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
--
|
||||
-- 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
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_expensereport ADD UNIQUE INDEX idx_expensereport_uk_ref (ref, entity);
|
||||
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_date_debut (date_debut);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_date_fin (date_fin);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_statut (fk_statut);
|
||||
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_author (fk_user_author);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_valid (fk_user_valid);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve);
|
||||
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve);
|
||||
|
||||
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
|
||||
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
|
||||
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_approve FOREIGN KEY (fk_user_approve) REFERENCES llx_user (rowid);
|
||||
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_refuse FOREIGN KEY (fk_user_refuse) REFERENCES llx_user (rowid);
|
||||
|
||||
@@ -29,5 +29,5 @@ create table llx_projet_task_time
|
||||
invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here
|
||||
invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here
|
||||
import_key varchar(14), -- Import key
|
||||
note text,
|
||||
note text
|
||||
)ENGINE=innodb;
|
||||
|
||||
@@ -140,7 +140,7 @@ DelYear=Year to delete
|
||||
DelJournal=Journal to delete
|
||||
ConfirmDeleteMvt=This will delete all lines of the general ledger for year and/or from a specific journal. At least one criteria is required.
|
||||
ConfirmDeleteMvtPartial=This will delete the selected line(s) of the general ledger
|
||||
DelBookKeeping=Delete the record of the general ledger
|
||||
DelBookKeeping=Delete record of the general ledger
|
||||
FinanceJournal=Finance journal
|
||||
ExpenseReportsJournal=Expense reports journal
|
||||
DescFinanceJournal=Finance journal including all the types of payments by bank account
|
||||
|
||||
@@ -28,6 +28,10 @@ Reconciliation=Reconciliation
|
||||
RIB=Bank Account Number
|
||||
IBAN=IBAN number
|
||||
BIC=BIC/SWIFT number
|
||||
SwiftValid=BIC/SWIFT valid
|
||||
SwiftVNotalid=BIC/SWIFT not valid
|
||||
IbanValid=BAN valid
|
||||
IbanNotValid=BAN not valid
|
||||
StandingOrders=Direct Debit orders
|
||||
StandingOrder=Direct debit order
|
||||
AccountStatement=Account statement
|
||||
|
||||
@@ -41,7 +41,7 @@ ConsumedBy=Consumed by
|
||||
NotConsumed=Not consumed
|
||||
NoReplacableInvoice=No replacable invoices
|
||||
NoInvoiceToCorrect=No invoice to correct
|
||||
InvoiceHasAvoir=Corrected by one or several invoices
|
||||
InvoiceHasAvoir=Was source of one or several credit notes
|
||||
CardBill=Invoice card
|
||||
PredefinedInvoices=Predefined Invoices
|
||||
Invoice=Invoice
|
||||
|
||||
@@ -697,6 +697,7 @@ Test=Test
|
||||
Element=Element
|
||||
NoPhotoYet=No pictures available yet
|
||||
Dashboard=Dashboard
|
||||
MyDashboard=My dashboard
|
||||
Deductible=Deductible
|
||||
from=from
|
||||
toward=toward
|
||||
@@ -750,6 +751,8 @@ GroupBy=Group by...
|
||||
ViewFlatList=View flat list
|
||||
RemoveString=Remove string '%s'
|
||||
SomeTranslationAreUncomplete=Some languages may be partially translated or may contains errors. If you detect some, you can fix language files registering to <a href="https://transifex.com/projects/p/dolibarr/" target="_blank">http://transifex.com/projects/p/dolibarr/</a>.
|
||||
DirectDownloadLink=Direct download link
|
||||
Download=Download
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
|
||||
@@ -20,8 +20,8 @@ OnlyOpenedProject=Only open projects are visible (projects in draft or closed st
|
||||
ClosedProjectsAreHidden=Closed projects are not visible.
|
||||
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
||||
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
|
||||
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task you are assigned on. Assign task to you if you want to enter time on it.
|
||||
OnlyYourTaskAreVisible=Only tasks you are assigned on are visible. Assign task to you if you want to enter time on it.
|
||||
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task assigned to you. Assign task to yourself if you need to enter time on it.
|
||||
OnlyYourTaskAreVisible=Only tasks assigned to you are visible. Assign task to yourself if it is not visible and you need to enter time on it.
|
||||
ImportDatasetTasks=Tasks of projects
|
||||
NewProject=New project
|
||||
AddProject=Create project
|
||||
|
||||
@@ -86,7 +86,7 @@ if ($filtre) {
|
||||
$sql.= " GROUP BY l.rowid, l.label, l.capital, l.datestart, l.dateend";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -157,7 +157,7 @@ if (! empty($enddate))
|
||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
|
||||
dol_syslog(__FILE__, LOG_DEBUG);
|
||||
|
||||
@@ -124,7 +124,7 @@ $sql.= " u.login, u.firstname, u.lastname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p";
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."user u ON u.rowid = p.fk_user_creat";
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006 Auguria SARL <info@auguria.org>
|
||||
@@ -11,9 +11,10 @@
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014-2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.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
|
||||
@@ -820,6 +821,23 @@ $formfile = new FormFile($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
|
||||
|
||||
// Load object modBarCodeProduct
|
||||
$res=0;
|
||||
if (! empty($conf->barcode->enabled) && ! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM))
|
||||
{
|
||||
$module=strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
|
||||
$dirbarcode=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']);
|
||||
foreach ($dirbarcode as $dirroot)
|
||||
{
|
||||
$res=dol_include_once($dirroot.$module.'.php');
|
||||
if ($res) break;
|
||||
}
|
||||
if ($res > 0)
|
||||
{
|
||||
$modBarCodeProduct =new $module();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
{
|
||||
@@ -857,22 +875,6 @@ else
|
||||
$modCodeProduct = new $module();
|
||||
}
|
||||
|
||||
// Load object modBarCodeProduct
|
||||
if (! empty($conf->barcode->enabled) && ! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM))
|
||||
{
|
||||
$module=strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
|
||||
$dirbarcode=array_merge(array('/core/modules/barcode/'),$conf->modules_parts['barcode']);
|
||||
foreach ($dirbarcode as $dirroot)
|
||||
{
|
||||
$res=dol_include_once($dirroot.$module.'.php');
|
||||
if ($res) break;
|
||||
}
|
||||
if ($res > 0)
|
||||
{
|
||||
$modBarCodeProduct =new $module();
|
||||
}
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
@@ -1483,10 +1485,13 @@ else
|
||||
if (($action != 'editbarcodetype') && ! empty($user->rights->produit->creer) && $createbarcode) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbarcodetype&id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editbarcodetype')
|
||||
if ($action == 'editbarcodetype' || $action == 'editbarcode')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
||||
$formbarcode = new FormBarCode($db);
|
||||
}
|
||||
if ($action == 'editbarcodetype')
|
||||
{
|
||||
$formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'fk_barcode_type');
|
||||
}
|
||||
else
|
||||
@@ -1506,13 +1511,16 @@ else
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editbarcode')
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setbarcode">';
|
||||
print '<input type="hidden" name="barcode_type_code" value="'.$object->barcode_type_code.'">';
|
||||
print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.$object->barcode.'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
$tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode;
|
||||
if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type);
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setbarcode">';
|
||||
print '<input type="hidden" name="barcode_type_code" value="'.$object->barcode_type_code.'">';
|
||||
print '<input size="40" class="maxwidthonsmartphone" type="text" name="barcode" value="'.$tmpcode.'">';
|
||||
print ' <input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ class ProductApi extends DolibarrApi
|
||||
// Show product on buy
|
||||
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
@@ -212,7 +212,7 @@ class ProductApi extends DolibarrApi
|
||||
// Show product on buy
|
||||
if ($to_buy) $sql.= " AND p.to_buy = ".$db->escape($to_buy);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -304,7 +304,7 @@ else
|
||||
$sql.=$hookmanager->resPrint;
|
||||
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -1661,7 +1661,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
$filter = array('t.fk_product' => $object->id,'t.fk_soc' => GETPOST('socid', 'int'));
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||
// List of all prices by customers
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -259,7 +259,7 @@ $sql.=$db->order($sortfield,$sortorder);
|
||||
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
$nbtotalofrecords = -1;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user