Merge github.com:Dolibarr/dolibarr into dev_finish_packingfeature

This commit is contained in:
Florian HENRY 2020-10-12 11:11:23 +02:00
commit 1f6a99e361
275 changed files with 2221 additions and 689 deletions

13
.gitignore vendored
View File

@ -41,3 +41,16 @@ htdocs/includes/sebastian/
htdocs/includes/squizlabs/
htdocs/includes/webmozart/
htdocs/.well-known/apple-developer-merchantid-domain-association
# Node Modules
build/yarn-error.log
build/node_modules/
node_modules/
#yarn
yarn.lock
#package-lock
package-lock.json
doc/install.lock

View File

@ -6,7 +6,8 @@
os: linux
dist: xenial
#dist: bionic
sudo: required
# Deprecated: The key sudo has no effect anymore.
#sudo: required
language: php

View File

@ -12,8 +12,11 @@ services:
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dolibarr
ports:
- "3306:3306"
networks:
- internal-pod
- external-pod
phpmyadmin:
image: phpmyadmin/phpmyadmin

View File

@ -357,8 +357,8 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$line = str_replace(" time with time zone", " time", $line);
$line = str_replace(" time without time zone", " time", $line);
$line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
$line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
$line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
$line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) {
$field = getfieldname($line);

BIN
doc/images/invoice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -294,13 +294,11 @@ if ($resql)
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts")." : ";
@ -343,15 +341,15 @@ if ($resql)
// Line for search fields
print '<tr class="liste_titre_filter">';
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_labelshort" value="'.$search_labelshort.'"></td>';
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.'"></td>';
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.'"></td>';
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.'"></td>';
if (!empty($arrayfields['aa.account_parent']['checked'])) {
print '<td class="liste_titre">';
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
print '</td>';
}
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre">&nbsp;</td>'; }
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre maxwidthsearch">';
@ -416,18 +414,24 @@ if ($resql)
// Account parent
if (!empty($arrayfields['aa.account_parent']['checked']))
{
if (!empty($obj->account_parent))
// Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table.
// So for orphans, obj->account_parent is set but not obj->rowid2
if (!empty($obj->account_parent) && !empty($obj->rowid2))
{
print "<td>";
print '<!-- obj->account_parent = '.$obj->account_parent.' obj->rowid2 = '.$obj->rowid2.' -->';
$accountparent->id = $obj->rowid2;
$accountparent->label = $obj->label2;
$accountparent->account_number = $obj->account_number2;
print "<td>";
$accountparent->account_number = $obj->account_number2; // Sotre an account number for output
print $accountparent->getNomUrl(1);
print "</td>\n";
if (!$i) $totalarray['nbfield']++;
} else {
print '<td>&nbsp;</td>';
print '<td>';
if (!empty($obj->account_parent)) {
print '<!-- Bad value for obj->account_parent = '.$obj->account_parent.': is a rowid that does not exists -->';
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
}
@ -481,11 +485,11 @@ if ($resql)
// Action
print '<td class="center">';
if ($user->rights->accounting->chartofaccount) {
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
print '&nbsp;';
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_delete();
print '</a>';
}

View File

@ -172,7 +172,7 @@ if ($action == 'display' || $action == 'delete') {
print '<td class="right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&account_category='.$cat_id.'&cptid='.$cpt->rowid.'">';
print $langs->trans("DeleteFromCat");
print img_picto($langs->trans("DeleteFromCat"), 'unlink');
print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"');
print "</a>";
print "</td>";
print "</tr>\n";

View File

@ -100,7 +100,9 @@ if (empty($reshook))
$form = new Form($db);
llxHeader('', $langs->trans("ReportThirdParty"));
$title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
llxHeader('', $title);
// Customer
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '0' as type, sa.entity";
@ -268,7 +270,7 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans('ReportThirdParty'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
print '<div class="warning">'.$langs->trans("WarningCreateSubAccounts").'</div>';
@ -335,17 +337,17 @@ if ($resql)
// Customer
if ($obj->type == 0)
{
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
}
// Supplier
elseif ($obj->type == 1)
{
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
}
// User
elseif ($obj->type == 2)
{
$s .= '<a class="user-back" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
}
print $s;
print '</td>';

View File

@ -339,7 +339,7 @@ if ($action != 'export_csv')
print '<td class="nowraponall right">'.price($opening_balances["'".$line->numero_compte."'"]).'</td>';
print '<td class="nowraponall right">'.price($line->debit).'</td>';
print '<td class="nowraponall right">'.price($line->credit).'</td>';
print '<td class="nowraponall right">'.price($line->debit - $line->credit).'</td>';
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
print '<td class="center">'.$link;
print '</td>';
print "</tr>\n";

View File

@ -154,17 +154,20 @@ print "<br>";
$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
$getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : "");
// Show message
$message = '';
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
$message .= '<br>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlical .=$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
$message .= '<br>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
$message .= '<br>';
$message .= '<br>';

View File

@ -65,6 +65,7 @@ if ($action == 'delete')
$action = '';
}
/*
* View
*/
@ -119,7 +120,9 @@ if (in_array($type, array('pgsql'))) {
print "});\n";
print "</script>\n";
print load_fiche_titre($langs->trans("Backup"), '', 'title_setup');
$title = $langs->trans("Backup");
print load_fiche_titre($title, '', 'title_setup');
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
print '<div class="center opacitymedium">';
@ -139,7 +142,9 @@ print '<br>';
print '<div id="backupdatabaseleft" class="fichehalfleft" >';
print load_fiche_titre($title ? $title : $langs->trans("BackupDumpWizard"));
$title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title);
print '<table width="100%" class="'.($useinecm ? 'nobordernopadding' : 'liste').' nohover">';
print '<tr class="liste_titre">';

View File

@ -122,7 +122,7 @@ $utils = new Utils($db);
// MYSQL
if ($what == 'mysql')
{
$cmddump = GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump = GETPOST("mysqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump = dol_sanitizePathName($cmddump);
if (!empty($dolibarr_main_restrict_os_commands))
@ -163,7 +163,7 @@ if ($what == 'mysqlnobin')
// POSTGRESQL
if ($what == 'postgresql')
{
$cmddump = GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump = GETPOST("postgresqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
$cmddump = dol_sanitizePathName($cmddump);
/* Not required, the command is output on screen but not ran for pgsql

View File

@ -113,7 +113,7 @@ $utils = new Utils($db);
if ($compression == 'zip')
{
$file .= '.zip';
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.back|\.old|\.log|[\\\/]temp[\\\/]|documents[\\\/]admin[\\\/]documents[\\\/])/i');
if ($ret < 0)
{
if ($ret == -2) {

View File

@ -167,7 +167,7 @@ $usefilter = 0;
$sql = "SELECT e.rowid, e.type, e.ip, e.user_agent, e.dateevent,";
$sql .= " e.fk_user, e.description, e.prefix_session,";
$sql .= " u.login";
$sql .= " u.login, u.admin, u.entity, u.firstname, u.lastname, u.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."events as e";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = e.fk_user";
$sql .= " WHERE e.entity IN (".getEntity('event').")";
@ -337,7 +337,18 @@ if ($result)
{
$userstatic->id = $obj->fk_user;
$userstatic->login = $obj->login;
$userstatic->admin = $obj->admin;
$userstatic->entity = $obj->entity;
$userstatic->status = $obj->status;
print $userstatic->getLoginUrl(1);
if (!empty($conf->multicompany->enabled) && $userstatic->admin && !$userstatic->entity)
{
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
} elseif ($userstatic->admin)
{
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
}
} else print '&nbsp;';
print '</td>';

View File

@ -1863,6 +1863,7 @@ if ($action == 'create' && $usercancreate)
$author = new User($db);
$author->fetch($object->user_author_id);
$object->fetch_thirdparty();
$res = $object->fetch_optionals();
$head = commande_prepare_head($object);

View File

@ -3531,6 +3531,8 @@ class Commande extends CommonOrder
$billedtext = '';
if (empty($donotshowbilled)) $billedtext .= ($billed ? ' - '.$langs->trans("Billed") : '');
$labelTooltip = '';
if ($status == self::STATUS_CANCELED) {
$labelStatus = $langs->trans('StatusOrderCanceled');
$labelStatusShort = $langs->trans('StatusOrderCanceledShort');
@ -3544,8 +3546,9 @@ class Commande extends CommonOrder
$labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext;
$statusType = 'status1';
} elseif ($status == self::STATUS_SHIPMENTONPROCESS) {
$labelStatus = $langs->trans('StatusOrderSentShort').$billedtext;
$labelStatus = $langs->trans('StatusOrderSent').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext;
$labelTooltip = $langs->trans("StatusOrderSent").' - '.$langs->trans("DateDeliveryPlanned").dol_print_date($this->date_livraison).$billedtext;
$statusType = 'status4';
} elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
$labelStatus = $langs->trans('StatusOrderToBill');
@ -3553,11 +3556,11 @@ class Commande extends CommonOrder
$statusType = 'status4';
} elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
$labelStatus = $langs->trans('StatusOrderProcessed').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderProcessed').$billedtext;
$labelStatusShort = $langs->trans('StatusOrderProcessedShort').$billedtext;
$statusType = 'status6';
} elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) {
$labelStatus = $langs->trans('StatusOrderDelivered');
$labelStatusShort = $langs->trans('StatusOrderDelivered');
$labelStatusShort = $langs->trans('StatusOrderDeliveredShort');
$statusType = 'status6';
} else {
$labelStatus = $langs->trans('Unknown');
@ -3566,7 +3569,7 @@ class Commande extends CommonOrder
$mode = 0;
}
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', array('tooltip' => $labelTooltip));
}

View File

@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills'));
$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks'));
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
@ -680,9 +680,9 @@ if ($resql)
print '</td>';
}
// Town
if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_town" value="'.$search_town.'"></td>';
if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
// Zip
if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.$search_zip.'"></td>';
if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.dol_escape_htmltag($search_zip).'"></td>';
// State
if (!empty($arrayfields['state.nom']['checked']))
{
@ -905,6 +905,7 @@ if ($resql)
$total = 0;
$subtotal = 0;
$productstat_cache = array();
$productstat_cachevirtual = array();
$getNomUrl_cache = array();
$generic_commande = new Commande($db);
@ -962,7 +963,6 @@ if ($resql)
// Show shippable Icon (create subloop, so may be slow)
if ($conf->stock->enabled)
{
$langs->load("stocks");
if (($obj->fk_statut > 0) && ($obj->fk_statut < 3))
{
$numlines = count($generic_commande->lines); // Loop on each line of order
@ -986,16 +986,16 @@ if ($resql)
if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default is when this option is not set, setting it create strange result
{
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_info .= ' - '.$langs->trans("Stock").': '.$generic_product->stock_reel;
$text_info .= ' - '.$langs->trans("VirtualStock").': '.$generic_product->stock_theorique;
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->product_ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
$text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
$text_info .= '<br>';
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel)
{
$notshippable++;
}
} else { // Detailed code, looks bugged
} else { // Detailed virtual stock, looks bugged, uncomplete and need heavy load.
// stock order and stock order_supplier
$stock_order = 0;
$stock_order_supplier = 0;

View File

@ -212,7 +212,8 @@ if (empty($reshook))
}
// Conciliation
if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && $user->rights->banque->consolidate)
if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && $user->rights->banque->consolidate
&& (!GETPOSTISSET('pageplusone') || (GETPOST('pageplusone') == GETPOST('pageplusoneold'))))
{
$error = 0;
@ -277,11 +278,11 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier)
{
$error = 0;
if (price2num($_POST["addcredit"]) > 0)
if (price2num(GETPOST("addcredit")) > 0)
{
$amount = price2num($_POST["addcredit"]);
$amount = price2num(GETPOST("addcredit"));
} else {
$amount = - price2num($_POST["adddebit"]);
$amount = - price2num(GETPOST("adddebit"));
}
$operation = GETPOST("operation", 'alpha');
@ -633,7 +634,7 @@ if ($resql)
print '</div>';
// Show last bank statements
$nbmax = 15; // We accept to show last 15 receipts (so we can have more than one year)
$nbmax = 12; // We show last 12 receipts (so we can have more than one year)
$liste = "";
$sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
$sql .= " WHERE fk_account=".$object->id." AND num_releve IS NOT NULL";
@ -785,11 +786,12 @@ if ($resql)
}
}
$morehtml = '<div class="inline-block '.(($buttonreconcile || $newcardbutton) ? 'marginrightonly' : '').'">';
/*$morehtml = '<div class="inline-block '.(($buttonreconcile || $newcardbutton) ? 'marginrightonly' : '').'">';
$morehtml .= '<label for="pageplusone">'.$langs->trans("Page")."</label> "; // ' Page ';
$morehtml .= '<input type="text" name="pageplusone" id="pageplusone" class="flat right width25 pageplusone" value="'.($page + 1).'">';
$morehtml .= '/'.$nbtotalofpages.' ';
$morehtml .= '</div>';
*/
if ($action != 'addline' && $action != 'reconcile')
{
@ -801,7 +803,7 @@ if ($resql)
$picto = 'bank_account';
if ($id > 0 || !empty($ref)) $picto = '';
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit);
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1);
// We can add page now to param
if ($page != '') $param .= '&page='.urlencode($page);

View File

@ -4118,17 +4118,13 @@ if ($action == 'create')
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DateInvoice');
print '</td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION))
if ($action != 'editinvoicedate' && !empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION))
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&amp;facid='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
if ($action == 'editinvoicedate') {
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date, 'invoicedate');
} else {
print dol_print_date($object->date, 'day');
}
if ($action == 'editinvoicedate') {
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date, 'invoicedate');
} else {
print dol_print_date($object->date, 'day');
}

View File

@ -1040,8 +1040,10 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
}
if ($othernb) {
$colspan = 6;
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<td class="nowrap" colspan="'.$colspan.'">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";
@ -1174,8 +1176,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
}
if ($othernb) {
$colspan = 6;
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr class="oddeven">';
print '<td class="nowrap" colspan="5">';
print '<td class="nowrap" colspan="'.$colspan.'">';
print '<span class="opacitymedium">'.$langs->trans("More").'... ('.$othernb.')</span>';
print '</td>';
print "</tr>\n";

View File

@ -46,24 +46,24 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
$langs->loadLangs(array('bills', 'banks', 'compta', 'companies'));
$action = GETPOST('action', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist';
$facid = GETPOST('facid', 'int');
$socid = GETPOST('socid', 'int');
$userid = GETPOST('userid', 'int');
$day = GETPOST('day', 'int');
$userid = GETPOST('userid', 'int');
$day = GETPOST('day', 'int');
$month = GETPOST('month', 'int');
$year = GETPOST('year', 'int');
$year = GETPOST('year', 'int');
$search_ref = GETPOST("search_ref", "alpha");
$search_account = GETPOST("search_account", "int");
$search_paymenttype = GETPOST("search_paymenttype");
$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
$search_company = GETPOST("search_company", 'alpha');
$search_paymenttype = GETPOST("search_paymenttype");
$search_account = GETPOST("search_account", "int");
$search_payment_num = GETPOST('search_payment_num', 'alpha');
$search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x"
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@ -76,27 +76,35 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC";
if (!$sortfield) $sortfield = "p.rowid";
if (!$sortfield) $sortfield = "p.ref";
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Paiement($db);
$hookmanager->initHooks(array('paymentlist'));
$extrafields = new ExtraFields($db);
$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'p.ref'=>"RefPayment",
's.nom'=>"ThirdParty",
'p.num_paiement'=>"Numero",
'p.amount'=>"Amount",
);
$arrayfields = array(
'p.rowid' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
'p.ref' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20),
's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))),
'p.num_payment' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80),
'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))),
);
$arrayfields = dol_sort_array($arrayfields, 'position');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('paymentlist'));
$object = new Paiement($db);
/*
* Actions
*/
@ -140,7 +148,7 @@ llxHeader('', $langs->trans('ListPayment'));
if (GETPOST("orphelins", "alpha")) {
// Payments not linked to an invoice. Should not happend. For debug only.
$sql = "SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment";
$sql = "SELECT p.ref, p.datep, p.amount, p.statut, p.num_paiement";
$sql .= ", c.code as paiement_code";
// Add fields from hooks
@ -158,7 +166,7 @@ if (GETPOST("orphelins", "alpha")) {
$sql .= $hookmanager->resPrint;
} else {
// DISTINCT is to avoid duplicate when there is a link to sales representatives
$sql = "SELECT DISTINCT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement as num_payment";
$sql = "SELECT DISTINCT p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement";
$sql .= ", c.code as paiement_code";
$sql .= ", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal";
$sql .= ", s.rowid as socid, s.nom as name, s.email";
@ -198,6 +206,8 @@ if (GETPOST("orphelins", "alpha")) {
if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
if ($search_company) $sql .= natural_search('s.nom', $search_company);
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
@ -251,6 +261,12 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
if ($search_all)
{
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
@ -268,7 +284,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
}
// Filter: Ref
if (!empty($arrayfields['p.rowid']['checked'])) {
if (!empty($arrayfields['p.ref']['checked'])) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
@ -305,7 +321,7 @@ if (!empty($arrayfields['transaction']['checked'])) {
}
// Filter: Cheque number (fund transfer)
if (!empty($arrayfields['p.num_payment']['checked'])) {
if (!empty($arrayfields['p.num_paiement']['checked'])) {
print '<td class="liste_titre">';
print '</td>';
}
@ -343,11 +359,11 @@ print "</tr>";
print '<tr class="liste_titre">';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.rowid']['checked'])) print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.datep']['checked'])) print_liste_field_titre($arrayfields['p.datep']['label'], $_SERVER["PHP_SELF"], "p.datep", '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['c.libelle']['checked'])) print_liste_field_titre($arrayfields['c.libelle']['label'], $_SERVER["PHP_SELF"], "c.libelle", '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.num_payment']['checked'])) print_liste_field_titre($arrayfields['p.num_payment']['label'], $_SERVER["PHP_SELF"], "p.num_payment", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_payment']['tooltip']);
if (!empty($arrayfields['p.num_paiement']['checked'])) print_liste_field_titre($arrayfields['p.num_paiement']['label'], $_SERVER["PHP_SELF"], "p.num_paiement", '', $param, '', $sortfield, $sortorder, '', $arrayfields['p.num_paiement']['tooltip']);
if (!empty($arrayfields['transaction']['checked'])) print_liste_field_titre($arrayfields['transaction']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['ba.label']['checked'])) print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['p.amount']['checked'])) print_liste_field_titre($arrayfields['p.amount']['label'], $_SERVER["PHP_SELF"], "p.amount", '', $param, 'class="right"', $sortfield, $sortorder);
@ -361,6 +377,13 @@ print $hookmanager->resPrint;
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>";
$checkedCount = 0;
foreach ($arrayfields as $column) {
if ($column['checked']) {
$checkedCount++;
}
}
$i = 0;
$totalarray = array();
while ($i < min($num, $limit)) {
@ -382,7 +405,7 @@ while ($i < min($num, $limit)) {
}
// Ref
if (!empty($arrayfields['p.rowid']['checked'])) {
if (!empty($arrayfields['p.ref']['checked'])) {
print '<td>'.$object->getNomUrl(1).'</td>';
if (!$i) $totalarray['nbfield']++;
}
@ -412,8 +435,8 @@ while ($i < min($num, $limit)) {
}
// Filter: Cheque number (fund transfer)
if (!empty($arrayfields['p.num_payment']['checked'])) {
print '<td>'.$objp->num_payment.'</td>';
if (!empty($arrayfields['p.num_paiement']['checked'])) {
print '<td>'.$objp->num_paiement.'</td>';
if (!$i) $totalarray['nbfield']++;
}
@ -448,7 +471,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['p.amount']['checked'])) {
print '<td class="right">'.price($objp->amount).'</td>';
if (!$i) $totalarray['nbfield']++;
$totalarray['pos'][8] = 'amount';
$totalarray['pos'][$checkedCount] = 'amount';
$totalarray['val']['amount'] += $objp->amount;
}

View File

@ -98,7 +98,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
}
$object->amount = $amount;
$object->label = GETPOST("label", 'alpha');
$object->note = GETPOST("note", 'restricthtml');
$object->note_private = GETPOST("note", 'restricthtml');
if (empty($object->datep))
{
@ -239,7 +239,7 @@ if ($action == 'create')
print '<label for="radiorefund">';
print '<input type="radio" id="radiorefund" data-label="'.$langs->trans('VATRefund').'" class="flat" name="refund" value="1"'.($refund ? ' checked="checked"' : '').'>';
print '&nbsp;';
print $langs->trans("Refund");
print $langs->trans("PaymentBack");
print '</label>';
print '</div>';
print "<br>\n";

View File

@ -119,6 +119,28 @@ if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFOR
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
// Customer payments
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire)
{
$arrayresult['searchintocustomerpayments'] = array(
'position'=>170,
'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
// Vendor payments
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
{
$arrayresult['searchintovendorpayments'] = array(
'position'=>175,
'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
// Miscellaneous payments
if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED) && $user->rights->banque->lire)
{

View File

@ -46,6 +46,9 @@ class box_validated_projects extends ModeleBoxes
public $info_box_head = array();
public $info_box_contents = array();
public $enabled = 1;
/**
* Constructor
*
@ -54,15 +57,17 @@ class box_validated_projects extends ModeleBoxes
*/
public function __construct($db, $param = '')
{
global $user, $langs;
global $conf, $user, $langs;
// Load translation files required by the page
$langs->loadLangs(array('boxes', 'projects'));
$this->db = $db;
$this->boxlabel = "ValidatedProjects";
$this->boxlabel = "ProjectsWithTask";
$this->hidden = ! ($user->rights->projet->lire);
if ($conf->global->MAIN_FEATURES_LEVEL < 2) $this->enabled = 0;
}
/**
@ -81,7 +86,7 @@ class box_validated_projects extends ModeleBoxes
$totalnb = 0;
$totalnbTask=0;
$textHead = $langs->trans("ValidatedProjects");
$textHead = $langs->trans("ProjectTasksWithoutTimeSpent");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders
@ -96,17 +101,19 @@ class box_validated_projects extends ModeleBoxes
$projectsListId='';
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
$sql = "SELECT p.rowid, p.ref as Ref, p.fk_soc as Client, p.dateo as startDate,";
$sql.= " (SELECT COUNT(t.rowid) FROM ".MAIN_DB_PREFIX."projet_task AS t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
$sql.= " WHERE t.fk_projet = p.rowid AND c.fk_c_type_contact != 160 AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")) AS 'taskNumber'";
// I tried to solve sql error and performance problem, rewriting sql request but it is not clear what we want.
// Count of tasks without time spent for tasks we are assigned too or
// Count of tasks without time spent for all tasks of projects we are allowed to read (what it does) ?
$sql = "SELECT p.rowid, p.ref, p.fk_soc, p.dateo as startdate,";
$sql.= " COUNT(DISTINCT t.rowid) as tasknumber";
$sql.= " FROM ".MAIN_DB_PREFIX."projet AS p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
// TODO Replace -1, -2, -3 with ID used for type of contat project_task into llx_c_type_contact. Once done, we can switch widget as stable.
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)";
$sql.= " WHERE p.fk_statut = 1"; // Only open projects
if ($projectsListId) $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project we ara allowed
$sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")";
$sql.= " AND c.fk_socpeople = ".$user->id;
$sql.= " GROUP BY p.ref";
$sql.= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo";
$sql.= " ORDER BY p.dateo ASC";
$result = $this->db->query($sql);
@ -135,10 +142,7 @@ class box_validated_projects extends ModeleBoxes
$objp = $this->db->fetch_object($result);
$projectstatic->id = $objp->rowid;
$projectstatic->ref = $objp->Ref;
$projectstatic->customer = $objp->Client;
$projectstatic->startDate = $objp->startDate;
$projectstatic->taskNumber = $objp->taskNumber;
$projectstatic->ref = $objp->ref;
$this->info_box_contents[$i][] = array(
'td' => 'class="nowraponall"',
@ -146,21 +150,26 @@ class box_validated_projects extends ModeleBoxes
'asis' => 1
);
$sql = 'SELECT rowid, nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client;
$resql = $this->db->query($sql);
if ($resql){
$socstatic = new Societe($this->db);
$obj = $this->db->fetch_object($resql);
$this->info_box_contents[$i][] = array(
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
'text' => $obj->nom,
'asis' => 1,
'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid
);
}
else {
dol_print_error($this->db);
}
if ($objp->fk_soc > 0) {
$sql = 'SELECT rowid, nom as name FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->fk_soc;
$resql = $this->db->query($sql);
//$socstatic = new Societe($this->db);
$obj2 = $this->db->fetch_object($resql);
$this->info_box_contents[$i][] = array(
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
'text' => $obj2->name,
'asis' => 1,
'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj2->rowid
);
}
else {
$this->info_box_contents[$i][] = array(
'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"',
'text' => '',
'asis' => 1,
'url' => ''
);
}
$this->info_box_contents[$i][] = array(
'td' => 'class="center"',
@ -169,7 +178,7 @@ class box_validated_projects extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'class="center"',
'text' => $objp->taskNumber."&nbsp;".$langs->trans("Tasks"),
'text' => $objp->tasknumber."&nbsp;".$langs->trans("Tasks"),
'asis' => 1,
);
$i++;

View File

@ -533,7 +533,7 @@ class DolGraph
$vals = array();
$nblines = count($this->data);
$nbvalues = count($this->data[0]) - 1;
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
for ($j = 0; $j < $nblines; $j++)
{
@ -562,7 +562,7 @@ class DolGraph
$vals = array();
$nblines = count($this->data);
$nbvalues = count($this->data[0]) - 1;
$nbvalues = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1);
for ($j = 0; $j < $nblines; $j++)
{

View File

@ -3441,6 +3441,7 @@ class Form
}
print '</select>';
if ($user->admin && empty($noinfoadmin)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print ajax_combobox($htmlname);
}
@ -3510,6 +3511,7 @@ class Form
}
print '</select>';
if ($user->admin && !$noadmininfo) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print ajax_combobox('select'.$htmlname);
}

View File

@ -952,12 +952,21 @@ class FormOther
* @param int $invert Invert
* @param string $option Option
* @param string $morecss More css
* @param bool $addjscombo Add js combo
* @return string
*/
public function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle maxwidth75imp')
public function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle maxwidth75imp', $addjscombo = false)
{
$out = '';
// Add code for jquery to use multiselect
if ($addjscombo)
{
// Enhance with select2
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname);
}
$currentyear = date("Y") + $offset;
$max_year = $currentyear + $max_year;
$min_year = $currentyear - $min_year;

View File

@ -368,6 +368,7 @@ class FormProjets
} else $out .= '&nbsp;';
$out .= '</option>';
}
$num = $this->db->num_rows($resql);
$i = 0;
if ($num)
@ -388,6 +389,18 @@ class FormProjets
$labeltoshow = '';
$disabled = 0;
if ($obj->fk_statut == Project::STATUS_DRAFT)
{
$disabled = 1;
} elseif ($obj->fk_statut == Project::STATUS_CLOSED)
{
if ($discard_closed == 2) $disabled = 1;
} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled = 1;
}
if ($showproject == 'all')
{
$labeltoshow .= dol_trunc($obj->ref, 18); // Project ref

View File

@ -234,8 +234,11 @@ class DoliDBPgsql extends DoliDB
// on update defaulted by now
$line = preg_replace('/(\s*)tms(\s*)timestamp/i', '\\1tms timestamp without time zone DEFAULT now() NOT NULL', $line);
// nuke DEFAULT CURRENT_TIMESTAMP
$line = preg_replace('/(\s*)DEFAULT(\s*)CURRENT_TIMESTAMP/i', '\\1', $line);
// nuke ON UPDATE CURRENT_TIMESTAMP
$line = preg_replace('/(\s*)on(\s*)update(\s*)CURRENT_TIMESTAMP/i', '\\1', $line);
$line = preg_replace('/(\s*)ON(\s*)UPDATE(\s*)CURRENT_TIMESTAMP/i', '\\1', $line);
// unique index(field1,field2)
if (preg_match('/unique index\s*\((\w+\s*,\s*\w+)\)/i', $line))

View File

@ -1605,7 +1605,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
if ($pdfexists && !$error)
{
$heightforphotref = 70;
$heightforphotref = 80;
if (!empty($conf->dol_optimize_smallscreen)) $heightforphotref = 60;
// If the preview file is found
if (file_exists($fileimage))
@ -3133,7 +3133,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title',
'help', 'holiday',
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
'map-marker-alt', 'money-bill-alt', 'mrp', 'note',
'map-marker-alt', 'money-bill-alt', 'mrp', 'note', 'next',
'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom',
'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
@ -3147,7 +3147,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member',
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website',
'off', 'on', 'order',
'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
'paiment', 'play', 'playdisabled', 'previous', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
'setup', 'share-alt', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
@ -3181,7 +3181,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group',
'member'=>'users', 'mrp'=>'cubes', 'trip'=>'wallet', 'group'=>'users',
'member'=>'users', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'trip'=>'wallet', 'group'=>'users',
'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
@ -3192,7 +3193,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'refresh'=>'redo', 'resource'=>'laptop-house',
'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
@ -4375,6 +4376,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
// Right
print '<td class="nobordernopadding valignmiddle right">';
print '<input type="hidden" name="pageplusoneold" value="'.($page+1).'">';
if ($sortfield) $options .= "&sortfield=".urlencode($sortfield);
if ($sortorder) $options .= "&sortorder=".urlencode($sortorder);
// Show navigation bar
@ -8369,7 +8371,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '
/**
* Function dolGetStatus
* Output the badge of a status.
*
* @param string $statusLabel Label of badge no html : use in alt attribute for accessibility
* @param string $statusLabelShort Short label of badge no html
@ -8377,7 +8379,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '
* @param string $statusType status0 status1 status2 status3 status4 status5 status6 status7 status8 status9 : image name or badge name
* @param int $displayMode 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 string $url The url for link
* @param array $params Various params for future : recommended rather than adding more function arguments
* @param array $params Various params. Example: array('tooltip'=>'...', 'badgeParams'=>...)
* @return string Html status string
*/
function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $statusType = 'status0', $displayMode = 0, $url = '', $params = array())
@ -8446,7 +8448,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
$statusLabelShort = (empty($statusLabelShort) ? $statusLabel : $statusLabelShort);
$dolGetBadgeParams['attr']['class'] = 'badge-status';
$dolGetBadgeParams['attr']['title'] = $statusLabel;
$dolGetBadgeParams['attr']['title'] = empty($params['tooltip']) ? $statusLabel : $params['tooltip'];
if ($displayMode == 3) {
$return = dolGetBadge((empty($conf->dol_optimize_smallscreen) ? $statusLabel : (empty($statusLabelShort) ? $statusLabel : $statusLabelShort)), '', $statusType, 'dot', $url, $dolGetBadgeParams);

View File

@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
/**
* Class to build export files with Excel format
@ -59,6 +60,8 @@ class ExportExcel2007new extends ModeleExports
public $worksheet; // Handle sheet
public $styleArray;
public $row;
public $col;
@ -436,4 +439,204 @@ class ExportExcel2007new extends ModeleExports
return $letter;
}
/**
* Set cell value and automatically merge if we give an endcell
*
* @param string $val cell value
* @param string $startCell starting cell
* @param string $endCell ending cell
* @return int 1 if success -1 if failed
*/
public function setCellValue($val, $startCell, $endCell = '')
{
try {
$this->workbook->getActiveSheet()->setCellValue($startCell, $val);
if (! empty($endCell)) {
$cellRange = $startCell.':'.$endCell;
$this->workbook->getActiveSheet()->mergeCells($startCell.':'.$endCell);
}
else $cellRange = $startCell;
if (! empty($this->styleArray)) $this->workbook->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styleArray);
}
catch (Exception $e) {
$this->error = $e->getMessage();
return -1;
}
return 1;
}
/**
* Set border style
*
* @param string $thickness style \PhpOffice\PhpSpreadsheet\Style\Border
* @param string $color color \PhpOffice\PhpSpreadsheet\Style\Color
* @return int 1 if ok
*/
public function setBorderStyle($thickness, $color)
{
$this->styleArray['borders'] = array(
'outline' => array(
'borderStyle' => $thickness,
'color' => array('argb' => $color)
)
);
return 1;
}
/**
* Set font style
*
* @param bool $bold true if bold
* @param string $color color \PhpOffice\PhpSpreadsheet\Style\Color
* @return int 1
*/
public function setFontStyle($bold, $color)
{
$this->styleArray['font'] = array(
'color' => array('argb' => $color),
'bold' => $bold
);
return 1;
}
/**
* Set alignment style (horizontal, left, right, ...)
*
* @param string $horizontal PhpOffice\PhpSpreadsheet\Style\Alignment
* @return int 1
*/
public function setAlignmentStyle($horizontal)
{
$this->styleArray['alignment'] = array('horizontal' => $horizontal);
return 1;
}
/**
* Reset Style
* @return int 1
*/
public function resetStyle()
{
$this->styleArray = array();
return 1;
}
/**
* Make a NxN Block in sheet
*
* @param string $startCell starting cell
* @param array $TDatas array(ColumnName=>array(Row value 1, row value 2, etc ...))
* @param bool $boldTitle true if bold headers
* @return int 1 if OK, -1 if KO
*/
public function setBlock($startCell, $TDatas = array(), $boldTitle = false)
{
try {
if (! empty($TDatas)) {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
$startRow = $startCell->getRow();
foreach ($TDatas as $column => $TRows) {
if ($boldTitle) $this->setFontStyle(true, $this->styleArray['font']['color']['argb']);
$cell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $startRow);
$this->setCellValue($column, $cell->getCoordinate());
$rowPos = $startRow;
if ($boldTitle) $this->setFontStyle(false, $this->styleArray['font']['color']['argb']);
foreach ($TRows as $row) {
$rowPos++;
$cell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $rowPos);
$this->setCellValue($row, $cell->getCoordinate());
}
$startColumn++;
}
}
}
catch (Exception $e) {
$this->error = $e->getMessage();
return -1;
}
return 1;
}
/**
* Make a 2xN Tab in Sheet
*
* @param string $startCell A1
* @param array $TDatas array(Title=>val)
* @param bool $boldTitle true if bold titles
* @return int 1 if OK, -1 if KO
*/
public function setBlock2Columns($startCell, $TDatas = array(), $boldTitle = false)
{
try {
if (! empty($TDatas)) {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
$startRow = $startCell->getRow();
foreach ($TDatas as $title => $val) {
$cell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $startRow);
if ($boldTitle) $this->setFontStyle(true, $this->styleArray['font']['color']['argb']);
$this->setCellValue($title, $cell->getCoordinate());
if ($boldTitle) $this->setFontStyle(false, $this->styleArray['font']['color']['argb']);
$cell2 = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn + 1, $startRow);
$this->setCellValue($val, $cell2->getCoordinate());
$startRow++;
}
}
}
catch (Exception $e) {
$this->error = $e->getMessage();
return -1;
}
return 1;
}
/**
* Enable auto sizing for column range
*
* @param string $firstColumn first column to autosize
* @param string $lastColumn to last column to autosize
* @return int 1
*/
public function enableAutosize($firstColumn, $lastColumn)
{
foreach (range($firstColumn, $lastColumn) as $columnID) {
$this->workbook->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);
}
return 1;
}
/**
* Set a value cell and merging it by giving a starting cell and a length
*
* @param string $val Cell value
* @param string $startCell Starting cell
* @param int $length Length
* @param int $offset Starting offset
* @return string Coordinate or -1 if KO
*/
public function setMergeCellValueByLength($val, $startCell, $length, $offset = 0)
{
try {
$startCell = $this->workbook->getActiveSheet()->getCell($startCell);
$startColumn = Coordinate::columnIndexFromString($startCell->getColumn());
if (! empty($offset)) $startColumn += $offset;
$startRow = $startCell->getRow();
$startCell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn, $startRow);
$startCoordinate = $startCell->getCoordinate();
$this->setCellValue($val, $startCell->getCoordinate());
$endCell = $this->workbook->getActiveSheet()->getCellByColumnAndRow($startColumn + ($length - 1), $startRow);
$endCoordinate = $endCell->getCoordinate();
$this->workbook->getActiveSheet()->mergeCells($startCoordinate.':'.$endCoordinate);
}
catch (Exception $e) {
$this->error = $e->getMessage();
return -1;
}
return $endCoordinate;
}
}

View File

@ -827,6 +827,158 @@ class modFournisseur extends DolibarrModules
$this->import_convertvalue_array[$r] = [
'fd.fk_facture_fourn' => ['rule' => 'fetchidfromref', 'file' => '/fourn/class/fournisseur.facture.class.php', 'class' => 'FactureFournisseur', 'method' => 'fetch'],
];
//Import Purchase Orders
$r++;
$this->import_code[$r] = 'commande_fournisseur_' . $r;
$this->import_label[$r] = 'Purchase Orders';
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX . 'commande_fournisseur', 'extra' => MAIN_DB_PREFIX . 'commande_fournisseur_extrafields'];
$this->import_tables_creator_array[$r] = ['c' => 'fk_user_author']; // Fields to store import user id
$this->import_fields_array[$r] = [
'c.ref' => 'Document Ref*',
'c.ref_supplier' => 'RefSupplier',
'c.fk_soc' => 'ThirdPartyName*',
'c.fk_projet' => 'ProjectId',
'c.date_creation' => 'DateCreation',
'c.date_valid' => 'DateValid',
'c.date_approve' => 'DateApprove',
'c.date_commande' => 'DateOrder',
'c.fk_user_modif' => 'ModifiedById',
'c.fk_user_valid' => 'ValidatedById',
'c.fk_user_approve' => 'ApprovedById',
'c.source' => 'Source',
'c.fk_statut' => 'Status*',
'c.billed' => 'Billed(0/1)',
'c.remise_percent' => 'GlobalDiscount',
'c.tva' => 'TotalTVA',
'c.total_ht' => 'TotalHT',
'c.total_ttc' => 'TotalTTC',
'c.note_private' => 'NotePrivate',
'c.note_public' => 'Note',
'c.date_livraison' => 'DeliveryDate',
'c.fk_cond_reglement' => 'Payment Condition',
'c.fk_mode_reglement' => 'Payment Mode',
'c.model_pdf' => 'Model'
];
if (! empty($conf->multicurrency->enabled)) {
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
$this->import_fields_array[$r]['c.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->import_fields_array[$r]['c.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
// Add extra fields
$import_extrafield_sample = [];
$sql = "SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, " . $conf->entity . ")";
$resql = $this->db->query($sql);
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 'extra.' . $obj->name;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
$import_extrafield_sample[$fieldname] = $fieldlabel;
}
}
// End add extra fields
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commande_fournisseur'];
$this->import_regex_array[$r] = [
'c.ref' => '(PO\d{4}-\d{4}|PORDER.{1,32}$|PROV.{1,32}$)',
'c.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'
];
$this->import_updatekeys_array[$r] = ['c.ref' => 'Ref'];
$this->import_convertvalue_array[$r] = [
'c.fk_soc' => [
'rule' => 'fetchidfromref',
'file' => '/societe/class/societe.class.php',
'class' => 'Societe',
'method' => 'fetch',
'element' => 'ThirdParty'
],
'c.fk_mode_reglement' => [
'rule' => 'fetchidfromcodeorlabel',
'file' => '/compta/paiement/class/cpaiement.class.php',
'class' => 'Cpaiement',
'method' => 'fetch',
'element' => 'cpayment'
],
'c.source' => ['rule' => 'zeroifnull'],
];
//Import PO Lines
$r++;
$this->import_code[$r] = 'commande_fournisseurdet_'.$r;
$this->import_label[$r] = 'PO Lines';
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX . 'commande_fournisseurdet', 'extra' => MAIN_DB_PREFIX . 'commande_fournisseurdet_extrafields'];
$this->import_fields_array[$r] = [
'cd.fk_commande' => 'Document Ref*',
'cd.fk_parent_line' => 'PrParentLine',
'cd.fk_product' => 'IdProduct',
'cd.label' => 'Label',
'cd.description' => 'LineDescription',
'cd.tva_tx' => 'LineVATRate',
'cd.qty' => 'LineQty',
'cd.remise_percent' => 'Reduc. Percent',
'cd.remise' => 'Reduc.',
'cd.subprice' => 'Sub Price',
'cd.total_ht' => 'LineTotalHT',
'cd.total_tva' => 'LineTotalVAT',
'cd.total_ttc' => 'LineTotalTTC',
'cd.product_type' => 'TypeOfLineServiceOrProduct',
'cd.date_start' => 'Start Date',
'cd.date_end' => 'End Date',
'cd.info_bits' => 'InfoBits',
'cd.special_code' => 'Special Code',
'cd.rang' => 'LinePosition',
'cd.fk_unit' => 'Unit'
];
if (! empty($conf->multicurrency->enabled)) {
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
$this->import_fields_array[$r]['cd.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->import_fields_array[$r]['cd.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
// Add extra fields
$sql="SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . "extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, " . $conf->entity . ")";
$resql = $this->db->query($sql);
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 'extra.' . $obj->name;
$fieldlabel = ucfirst($obj->label);
$this->import_fields_array[$r][$fieldname] = $fieldlabel . ($obj->fieldrequired ? '*' : '');
}
}
// End add extra fields
$this->import_fieldshidden_array[$r] = ['extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'commande_fournisseurdet'];
$this->import_regex_array[$r] = [
'cd.product_type' => '[0|1]$',
'cd.fk_product' => 'rowid@' . MAIN_DB_PREFIX . 'product',
'cd.multicurrency_code' => 'code@' . MAIN_DB_PREFIX . 'multicurrency'
];
$this->import_updatekeys_array[$r] = ['cd.fk_commande' => 'Purchase Order Id'];
$this->import_convertvalue_array[$r] = [
'cd.fk_commande' => [
'rule' => 'fetchidfromref',
'file' => '/fourn/class/fournisseur.commande.class.php',
'class' => 'CommandeFournisseur',
'method' => 'fetch',
'element' => 'order_supplier'
],
'cd.info_bits' => ['rule' => 'zeroifnull'],
'cd.special_code' => ['rule' => 'zeroifnull'],
];
}

View File

@ -177,7 +177,7 @@ class modHoliday extends DolibarrModules
$this->rights[$r][0] = 20005; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/modify leave requests for everybody'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write_all'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][4] = 'writeall_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$r++;

View File

@ -134,7 +134,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->name = "canelle";
$this->description = $langs->trans('SuppliersInvoiceModel');
// Dimension page
// Page dimensions
$this->type = 'pdf';
$formatarray = pdf_getFormat();
$this->page_largeur = $formatarray['width'];
@ -145,12 +145,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
// Define column position
$this->posxdesc = $this->marge_gauche + 1;
@ -489,7 +489,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
// Collection of totals by VAT value in $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva;
else $tvaligne = $object->lines[$i]->total_tva;
@ -668,7 +668,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->atleastoneratenotnull = 0;
foreach ($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey > 0) // We do not display rate 0
{
$this->atleastoneratenotnull++;
@ -1209,7 +1209,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
//Recipient name
// On peut utiliser le nom de la societe du contact
// We can use the name of the contact's company
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {

View File

@ -142,13 +142,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Affiche mode reglement
$this->option_condreg = 1; // Affiche conditions reglement
$this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_escompte = 0; // Affiche si il y a eu escompte
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
$this->option_modereg = 1; // Display payment mode
$this->option_condreg = 1; // Display payment terms
$this->option_codeproduitservice = 1; // Display product-service code
$this->option_multilang = 1; // Available in several languages
$this->option_escompte = 0; // Displays if there has been a discount
$this->option_credit_note = 0; // Support credit notes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -139,8 +139,8 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->option_logo = 1; // Affiche logo
$this->option_multilang = 1; // Dispo en plusieurs langues
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages
// Define column position
$this->posxdate = $this->marge_gauche + 1;
@ -168,7 +168,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->atleastoneratenotnull = 0;
$this->atleastonediscount = 0;
// Recupere emetteur
// Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
}
@ -462,13 +462,13 @@ class pdf_standard extends ModelePDFSuppliersPayments
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
// Affiche zone cheèque
// Display check zone
$posy = $this->_tableau_cheque($pdf, $object, $bottomlasttab, $outputlangs);
// Affiche zone totaux
//$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
// Pied de page
// Footer page
$this->_pagefoot($pdf, $object, $outputlangs);
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();

View File

@ -214,6 +214,8 @@ if (empty($reshook))
if ($action == 'add' && $user->rights->expensereport->creer)
{
$error = 0;
$object = new ExpenseReport($db);
$object->date_debut = $date_start;
@ -222,6 +224,19 @@ if (empty($reshook))
$object->fk_user_author = GETPOST('fk_user_author', 'int');
if (!($object->fk_user_author > 0)) $object->fk_user_author = $user->id;
// Check that expense report is for a user inside the hierarchy or advanced permission for all is set
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->writeall_advance))) {
$error++;
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
} else {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
if (! in_array($object->fk_user_author, $childids)) {
$error++;
setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors');
}
}
}
$fuser = new User($db);
$fuser->fetch($object->fk_user_author);
@ -1354,6 +1369,7 @@ if (empty($reshook))
$title = $langs->trans("ExpenseReport")." - ".$langs->trans("Card");
$helpurl = "EN:Module_Expense_Reports";
llxHeader("", $title, $helpurl);
$form = new Form($db);

View File

@ -459,7 +459,7 @@ if ($step == 1 || !$datatoexport)
print '</td><td class="right">';
if ($objexport->array_export_perms[$key])
{
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'filenew').'</a>';
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').'</a>';
} else {
print $langs->trans("NotEnoughPermissions");
}

View File

@ -1290,7 +1290,7 @@ if ($id > 0 || !empty($ref)) {
print '</td>';
}
if ($action != 'editline' ||  && $lineid != $objp->dispatchlineid)
if ($action != 'editline' || $lineid != $objp->dispatchlineid)
{
print '<td class="linecoledit center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;lineid=' . $objp->dispatchlineid .'#line_'. $objp->dispatchlineid . '">';

View File

@ -67,7 +67,7 @@ if ($user->socid > 0)
$socid = $user->socid;
}
$mode = GETPOST("mode");
$mode = GETPOST("mode", 'aZ09');
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_label = GETPOST("search_label", "alpha");
@ -92,6 +92,7 @@ $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat',
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_status = GETPOST('search_status', 'int');
$search_paymentmode = GETPOST('search_paymentmode', 'int');
$search_paymentcond = GETPOST('search_paymentcond', 'int');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
@ -165,7 +166,8 @@ $arrayfields = array(
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1),
'f.fk_cond_reglement'=>array('label'=>$langs->trans("PaymentTerm"), 'checked'=>1, 'position'=>50),
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1, 'position'=>52),
'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1, 'position'=>105),
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0, 'position'=>110),
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj == "1", 'position'=>95),
@ -240,6 +242,7 @@ if (empty($reshook))
$search_multicurrency_montant_ttc = '';
$search_status = '';
$search_paymentmode = '';
$search_paymentcond = '';
$search_town = '';
$search_zip = "";
$search_state = "";
@ -367,7 +370,8 @@ if ($search_multicurrency_montant_vat != '') $sql .= natural_search('f.multicurr
if ($search_multicurrency_montant_ttc != '') $sql .= natural_search('f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
if ($search_login) $sql .= natural_search('u.login', $search_login);
if ($search_status != '' && $search_status >= 0) $sql .= " AND f.fk_statut = ".$db->escape($search_status);
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode."";
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".((int) $search_paymentmode);
if ($search_paymentcond > 0) $sql .= " AND f.fk_cond_reglement = ".((int) $search_paymentcond);
$sql .= dolSqlDateFilter("f.datef", $day, $month, $year);
$sql .= dolSqlDateFilter("f.date_lim_reglement", $day_lim, $month_lim, $year_lim);
if ($option == 'late') $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'";
@ -385,7 +389,7 @@ if ($filter && $filter != -1)
$sql .= ' AND '.$db->escape(trim($filt[0])).' = '.$db->escape(trim($filt[1]));
}
}
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale);
if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
if ($search_user > 0)
{
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='invoice_supplier' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
@ -720,11 +724,18 @@ if ($resql)
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT));
print '</td>';
}
// Condition of payment
if (!empty($arrayfields['f.fk_cond_reglement']['checked']))
{
print '<td class="liste_titre left">';
$form->select_conditions_paiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100');
print '</td>';
}
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '<td class="liste_titre left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 20, 1, 'maxwidth100');
print '</td>';
}
if (!empty($arrayfields['f.total_ht']['checked']))
@ -873,6 +884,7 @@ if ($resql)
if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder);
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
if (!empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, '', $sortfield, $sortorder, 'right ');
@ -1096,6 +1108,14 @@ if ($resql)
if (!$i) $totalarray['nbfield']++;
}
// Payment condition
if (!empty($arrayfields['f.fk_cond_reglement']['checked']))
{
print '<td>';
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', '', -1);
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Payment mode
if (!empty($arrayfields['f.fk_mode_reglement']['checked']))
{

View File

@ -251,9 +251,10 @@ if ($result > 0)
print '<br>';
/**
* Liste des factures
* List of vendor invoices
*/
$sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom as name, s.rowid as socid';
$sql = 'SELECT f.rowid, f.rowid as facid, f.ref, f.ref_supplier, f.type, f.paye, f.total_ht, f.total_tva, f.total_ttc, f.datef as date, f.fk_statut as status,';
$sql .= ' pf.amount, s.nom as name, s.rowid as socid';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
$sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
$sql .= ' AND pf.fk_paiementfourn = '.$object->id;
@ -285,6 +286,13 @@ if ($result > 0)
$facturestatic->id = $objp->facid;
$facturestatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
$facturestatic->date = $db->jdate($objp->date);
$facturestatic->type = $objp->type;
$facturestatic->total_ht = $objp->total_ht;
$facturestatic->total_tva = $objp->total_tva;
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->statut = $objp->status;
$facturestatic->alreadypaid = -1; // unknown
print '<tr class="oddeven">';
// Ref
@ -300,7 +308,7 @@ if ($result > 0)
// Payed
print '<td class="right">'.price($objp->amount).'</td>';
// Status
print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->fk_statut, 6, 1).'</td>';
print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->status, 6, 1).'</td>';
print "</tr>\n";
if ($objp->paye == 1)

View File

@ -57,20 +57,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->loadLangs(array('companies', 'bills', 'banks', 'compta'));
$action = GETPOST('action', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'vendorpaymentlist';
$socid = GETPOST('socid', 'int');
$search_ref = GETPOST('search_ref', 'alpha');
$search_ref = GETPOST('search_ref', 'alpha');
$search_day = GETPOST('search_day', 'int');
$search_month = GETPOST('search_month', 'int');
$search_year = GETPOST('search_year', 'int');
$search_year = GETPOST('search_year', 'int');
$search_company = GETPOST('search_company', 'alpha');
$search_payment_type = GETPOST('search_payment_type');
$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
$search_bank_account = GETPOST('search_bank_account', 'int');
$search_bank_account = GETPOST('search_bank_account', 'int');
$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -86,7 +86,15 @@ $pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC";
if (!$sortfield) $sortfield = "p.datep";
// TODO: add global search for this list
$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'p.ref'=>"RefPayment",
's.nom'=>"ThirdParty",
'p.num_paiement'=>"Numero",
'p.amount'=>"Amount",
);
$arrayfields = array(
'p.ref' =>array('label'=>"RefPayment", 'checked'=>1, 'position'=>10),
@ -99,6 +107,7 @@ $arrayfields = array(
);
$arrayfields = dol_sort_array($arrayfields, 'position');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('paymentsupplierlist'));
$object = new PaiementFourn($db);
@ -164,6 +173,8 @@ if ($search_cheque_num != '') $sql .= natural_search('p.num_paiement', $search_c
if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
if ($search_bank_account > 0) $sql .= ' AND b.fk_account='.$search_bank_account."'";
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@ -223,6 +234,12 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'supplier_invoice', 0, '', '', $limit, 0, 0, 1);
if ($search_all)
{
foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
}
$moreforfilter = '';
$parameters = array();

View File

@ -82,7 +82,8 @@ if (($id > 0) || $ref)
}
$cancreate = 0;
if (!empty($user->rights->holiday->write_all)) $cancreate = 1;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance)) $cancreate = 1;
if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate = 1;
$candelete = 0;
@ -146,12 +147,26 @@ if (empty($reshook))
$valideur = GETPOST('valideur', 'int');
$description = trim(GETPOST('description', 'restricthtml'));
// Check that leave is for a user inside the hierarchy or advanced permission for all is set
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->writeall_advance))) {
$error++;
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
} else {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
if (! in_array($fuserid, $childids)) {
$error++;
setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors');
$action = 'create';
}
}
}
// If no type
if ($type <= 0)
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error++;
$action = 'add';
$action = 'create';
}
// If no start date
@ -159,21 +174,21 @@ if (empty($reshook))
{
setEventMessages($langs->trans("NoDateDebut"), null, 'errors');
$error++;
$action = 'add';
$action = 'create';
}
// If no end date
if (empty($date_fin))
{
setEventMessages($langs->trans("NoDateFin"), null, 'errors');
$error++;
$action = 'add';
$action = 'create';
}
// If start date after end date
if ($date_debut > $date_fin)
{
setEventMessages($langs->trans("ErrorEndDateCP"), null, 'errors');
$error++;
$action = 'add';
$action = 'create';
}
// Check if there is already holiday for this period
@ -182,16 +197,16 @@ if (empty($reshook))
{
setEventMessages($langs->trans("alreadyCPexist"), null, 'errors');
$error++;
$action = 'add';
$action = 'create';
}
// If there is no Business Days within request
$nbopenedday = num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
if ($nbopenedday < 0.5)
{
setEventMessages($langs->trans("ErrorDureeCP"), null, 'errors');
setEventMessages($langs->trans("ErrorDureeCP"), null, 'errors'); // No working day
$error++;
$action = 'add';
$action = 'create';
}
// If no validator designated
@ -741,7 +756,8 @@ if (empty($reshook))
$object->fetch($id);
// Si statut en attente de validation et valideur = valideur ou utilisateur, ou droits de faire pour les autres
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || !empty($user->rights->holiday->write_all)))
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) && ($user->id == $object->fk_validator || in_array($object->fk_user, $childids)
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))))
{
$db->begin();
@ -866,15 +882,15 @@ llxHeader('', $langs->trans('CPTitreMenu'));
if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
{
// Si l'utilisateur n'a pas le droit de faire une demande
if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all)))
// If user has no permission to create a leave
if ((in_array($fuserid, $childids) && empty($user->rights->holiday->write)) || (!in_array($fuserid, $childids) && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance))))
{
$errors[] = $langs->trans('CantCreateCP');
} else {
// Formulaire de demande de congés payés
// Form to add a leave request
print load_fiche_titre($langs->trans('MenuAddCP'), '', 'title_hrm.png');
// Si il y a une erreur
// Error management
if (GETPOST('error')) {
switch (GETPOST('error')) {
case 'datefin' :
@ -981,11 +997,13 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
print '<td class="titlefield fieldrequired">'.$langs->trans("User").'</td>';
print '<td>';
if (empty($user->rights->holiday->write_all))
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance))
{
print $form->select_dolusers(($fuserid ? $fuserid : $user->id), 'fuserid', 0, '', 0, 'hierarchyme', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
//print '<input type="hidden" name="fuserid" value="'.($fuserid?$fuserid:$user->id).'">';
} else print $form->select_dolusers(GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
} else {
print $form->select_dolusers(GETPOST('fuserid', 'int') ? GETPOST('fuserid', 'int') : $user->id, 'fuserid', 0, '', 0, '', '', '0,'.$conf->entity, 0, 0, $morefilter, 0, '', 'maxwidth300');
}
print '</td>';
print '</tr>';
@ -1459,7 +1477,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotTheAssignedApprover").'">'.$langs->trans("ActionRefuseCP").'</a>';
}
}
if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || !empty($user->rights->holiday->write_all)) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved
if (($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved
{
if (($object->date_debut > dol_now()) || $user->admin) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
else print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("HolidayStarted").'">'.$langs->trans("ActionCancelCP").'</a>';

View File

@ -421,7 +421,7 @@ if ($resql)
print '<div class="tabsAction">';
$canedit = (($user->id == $user_id && $user->rights->holiday->write) || ($user->id != $user_id && $user->rights->holiday->write_all));
$canedit = (($user->id == $user_id && $user->rights->holiday->write) || ($user->id != $user_id && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))));
if ($canedit)
{

View File

@ -25,9 +25,16 @@
*/
require '../main.inc.php';
// Security check (access forbidden for external user too)
if (empty($user->rights->holiday->define_holiday) || $user->socid > 0) {
accessforbidden();
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
@ -39,15 +46,15 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ')
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$search_id = GETPOST('search_id', 'alpha');
$search_prev_solde = GETPOST('search_prev_solde', 'alpha');
$search_new_solde = GETPOST('search_new_solde', 'alpha');
$year = GETPOST('year');
if (empty($year))
{
$tmpdate = dol_getdate(dol_now());
$year = $tmpdate['year'];
}
$search_id = GETPOST('search_id', 'alphanohtml');
$search_month = GETPOST('search_month', 'int');
$search_year = GETPOST('search_year', 'int');
$search_employee = GETPOST('search_employee', 'int');
$search_validator = GETPOST('search_validator', 'int');
$search_description = GETPOST('search_description', 'alphanohtml');
$search_type = GETPOST('search_type', 'int');
$search_prev_solde = GETPOST('search_prev_solde', 'alphanohtml');
$search_new_solde = GETPOST('search_new_solde', 'alphanohtml');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -61,10 +68,6 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="cpl.rowid";
if (! $sortorder) $sortorder="DESC";
// Protection if external user
if ($user->socid > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if (!$user->rights->holiday->read_all) accessforbidden();
@ -92,81 +95,126 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (empty($reshook)) {
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$search_id = '';
$toselect = '';
$search_array_options = array();
}
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_id = '';
$search_month = '';
$search_year = '';
$search_employee = '';
$search_validator = '';
$search_description = '';
$search_type = '';
$search_prev_solde = '';
$search_new_solde = '';
$toselect = '';
$search_array_options = array();
}
if (GETPOST('button_removefilter_x', 'alpha')
|| GETPOST('button_removefilter.x', 'alpha')
|| GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha')
|| GETPOST('button_search.x', 'alpha')
|| GETPOST('button_search', 'alpha'))
{
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
if (GETPOST('button_removefilter_x', 'alpha')
|| GETPOST('button_removefilter.x', 'alpha')
|| GETPOST('button_removefilter', 'alpha')
|| GETPOST('button_search_x', 'alpha')
|| GETPOST('button_search.x', 'alpha')
|| GETPOST('button_search', 'alpha'))
{
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
// Mass actions
/*$objectclass='MyObject';
$objectlabel='MyObject';
$permissiontoread = $user->rights->mymodule->read;
$permissiontodelete = $user->rights->mymodule->delete;
$uploaddir = $conf->mymodule->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
*/
// Mass actions
/*$objectclass='MyObject';
$objectlabel='MyObject';
$permissiontoread = $user->rights->mymodule->read;
$permissiontodelete = $user->rights->mymodule->delete;
$uploaddir = $conf->mymodule->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
*/
}
// Definition of fields for lists
$arrayfields = array(
'cpl.rowid'=>array('label'=>$langs->trans("ID"), 'checked'=>1),
'cpl.date_action'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
'cpl.fk_user_action'=>array('label'=>$langs->trans("ActionByCP"), 'checked'=>1),
'cpl.fk_user_update'=>array('label'=>$langs->trans("UserUpdateCP"), 'checked'=>1),
'cpl.type_action'=>array('label'=>$langs->trans("Description"), 'checked'=>1),
'cpl.fk_type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
'cpl.prev_solde'=>array('label'=>$langs->trans("PrevSoldeCP"), 'checked'=>1),
'variation'=>array('label'=>$langs->trans("Variation"), 'checked'=>1),
'cpl.new_solde'=>array('label'=>$langs->trans("NewSoldeCP"), 'checked'=>1),
'cpl.rowid'=>array('label'=>$langs->trans("ID"), 'checked'=>1),
'cpl.date_action'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
'cpl.fk_user_action'=>array('label'=>$langs->trans("ActionByCP"), 'checked'=>1),
'cpl.fk_user_update'=>array('label'=>$langs->trans("UserUpdateCP"), 'checked'=>1),
'cpl.type_action'=>array('label'=>$langs->trans("Description"), 'checked'=>1),
'cpl.fk_type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
'cpl.prev_solde'=>array('label'=>$langs->trans("PrevSoldeCP"), 'checked'=>1),
'variation'=>array('label'=>$langs->trans("Variation"), 'checked'=>1),
'cpl.new_solde'=>array('label'=>$langs->trans("NewSoldeCP"), 'checked'=>1),
);
/*
* View
*/
$form = new Form($db);
$formother = new FormOther($db);
$holidaylogstatic = new stdClass();
$alltypeleaves = $object->getTypes(1, -1); // To have labels
llxHeader('', $langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')');
llxHeader('', $langs->trans('CPTitreMenu'));
$sqlwhere = " AND date_action BETWEEN ".
$sqlwhere.= "'".$db->idate(dol_get_first_day($year, 1, 1))."'";
$sqlwhere.= " AND ";
$sqlwhere.= "'".$db->idate(dol_get_last_day($year, 12, 1))."'";
$sqlwhere = '';
if ($search_id != '') $sqlwhere.= natural_search('rowid', $search_id, 1);
if ($search_prev_solde != '') $sqlwhere.= natural_search('prev_solde', $search_prev_solde, 1);
if ($search_new_solde != '') $sqlwhere.= natural_search('new_solde', $search_new_solde, 1);
if (!empty($search_year) && $search_year > 0) {
if (!empty($search_month) && $search_month > 0) {
$from_date = dol_get_first_day($search_year, $search_month, 1);
$to_date = dol_get_last_day($search_year, $search_month, 1);
} else {
$from_date = dol_get_first_day($search_year, 1, 1);
$to_date = dol_get_last_day($search_year, 12, 1);
}
$sqlwhere .= "AND date_action BETWEEN '".$db->idate($from_date)."' AND '".$db->idate($to_date)."'";
}
if (!empty($search_id) && $search_id > 0) $sqlwhere.= natural_search('rowid', $search_id, 1);
if (!empty($search_validator) && $search_validator > 0) $sqlwhere.= natural_search('fk_user_action', $search_validator, 1);
if (!empty($search_employee) && $search_employee > 0) $sqlwhere.= natural_search('fk_user_update', $search_employee, 1);
if (!empty($search_description)) $sqlwhere.= natural_search('type_action', $search_description);
if (!empty($search_type) && $search_type > 0) $sqlwhere.= natural_search('fk_type', $search_type, 1);
if (!empty($search_prev_solde)) $sqlwhere.= natural_search('prev_solde', $search_prev_solde, 1);
if (!empty($search_new_solde)) $sqlwhere.= natural_search('new_solde', $search_new_solde, 1);
$sqlorder = $db->order($sortfield, $sortorder);
// Recent changes are more important than old changes
$log_holiday = $object->fetchLog($sqlorder, $sqlwhere); // Load $object->logs
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
//TODO: $result = $db->query($sql);
//TODO: $nbtotalofrecords = $db->num_rows($result);
$nbtotalofrecords = is_array($object->logs) ? count($object->logs) : 0;
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
}
// TODO: $num = $db->num_rows($resql);
$num = is_array($object->logs) ? count($object->logs) : 0;
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($search_id) $param = '&search_id='.urlencode($search_id);
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if (!empty($search_id)) $param .= '&search_statut='.urlencode($search_statut);
if (!empty($search_month) && $search_month > 0) $param .= '&search_month='.urlencode($search_month);
if (!empty($search_year) && $search_year > 0) $param .= '&search_year='.urlencode($search_year);
if (!empty($search_validator) && $search_validator > 0) $param .= '&search_validator='.urlencode($search_validator);
if (!empty($search_employee) && $search_employee > 0) $param .= '&search_employee='.urlencode($search_employee);
if (!empty($search_description)) $param .= '&search_description='.urlencode($search_description);
if (!empty($search_type) && $search_type > 0) $param .= '&search_type='.urlencode($search_type);
if (!empty($search_prev_solde)) $param .= '&search_prev_solde='.urlencode($search_prev_solde);
if (!empty($search_new_solde)) $param .= '&search_new_solde='.urlencode($search_new_solde);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
@ -178,44 +226,23 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$pagination = '<div class="pagination">';
$pagination.= '<ul>';
$pagination.= '<li class="pagination">';
$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request', '', $user->rights->holiday->write);
print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
$pagination.= '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year - 1).$param.'">';
$pagination.= '<i class="fa fa-chevron-left" title="Previous"></i>';
$pagination.= '</a>';
$pagination.= '<li class="pagination">';
$pagination.= '<span class="active">'.$langs->trans("Year").' '.$year.'</span>';
$pagination.= '</li>';
$pagination.= '<li class="pagination">';
$pagination.= '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year + 1).$param.'">';
$pagination.= '<i class="fa fa-chevron-right" title="Next"></i>';
$pagination.= '</a>';
$pagination.= '</li>';
$pagination.= '</li>';
$pagination.= '</ul>';
$pagination.= '</div>';
print load_fiche_titre($langs->trans('LogCP'), $pagination, 'title_hrm.png');
print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
print '<div class="info">'.$langs->trans('LastUpdateCP').': ';
$lastUpdate = $object->getConfCP('lastUpdate');
if ($lastUpdate)
{
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
print '<strong>'.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>'."\n";
if ($lastUpdate) {
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
$yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
print '<strong>'.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
print '<br>';
print $langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>';
} else {
print $langs->trans('None');
}
else {
print $langs->trans('None');
}
print "</div><br>\n";
print '</div>';
print '<br>';
$moreforfilter = '';
@ -225,20 +252,84 @@ $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfiel
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">';
print '<tbody>';
print '<tr class="liste_titre_filter">';
// Filter Id
if (!empty($arrayfields['cpl.rowid']['checked'])) {
print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
}
// Filter: Date
if (!empty($arrayfields['cpl.date_action']['checked'])) {
print '<td class="liste_titre right">';
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
print $formother->selectyear($search_year, 'search_year', 1, 10, 5, 0, 0, '', 'maxwidth200', true);
print '</td>';
}
// Filter: Validator
if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
$validator = new UserGroup($db);
$excludefilter = $user->admin ? '' : 'u.rowid <> '.$user->id;
$valideurobjects = $validator->listUsersForGroup($excludefilter);
$valideurarray = array();
foreach ($valideurobjects as $val) {
$valideurarray[$val->id] = $val->id;
}
print '<td class="liste_titre">';
print $form->select_dolusers($search_validator, "search_validator", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
print '</td>';
}
// Filter: User
if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
print '<td class="liste_titre">';
print $form->select_dolusers($search_employee, "search_employee", 1, "", $disabled, $include, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
print '</td>';
}
// Filter: Description
if (!empty($arrayfields['cpl.type_action']['checked'])) {
print '<td class="liste_titre">';
print '<input type="text" class="maxwidth50" name="search_description" value="'.$search_description.'">';
print '</td>';
}
// Filter: Type
if (!empty($arrayfields['cpl.fk_type']['checked'])) {
foreach ($alltypeleaves as $key => $val) {
$labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
$arraytypeleaves[$val['rowid']] = $labeltoshow;
}
print '<td class="liste_titre">';
print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '</td>';
}
// Filter: Previous balance
if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
print '<td class="liste_titre">';
print '<input type="text" class="maxwidth50" name="search_prev_solde" value="'.$search_prev_solde.'">';
print '</td>';
}
// Filter: Variation (only placeholder)
if (!empty($arrayfields['variation']['checked'])) {
print '<td class="liste_titre"></td>';
}
// Filter: New Balance
if (!empty($arrayfields['cpl.new_solde']['checked'])) {
print '<td class="liste_titre">';
print '<input type="text" class="maxwidth50" name="search_new_solde" value="'.$search_new_solde.'">';
print '</td>';
}
print '<tr class="liste_titre">';
if (!empty($arrayfields['cpl.rowid']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
if (!empty($arrayfields['cpl.date_action']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.fk_user_action']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.fk_user_update']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.type_action']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.fk_type']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.prev_solde']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_prev_solde" value="'.$search_prev_solde.'"></td>';
if (!empty($arrayfields['variation']['checked'])) print '<td class="liste_titre"></td>';
if (!empty($arrayfields['cpl.new_solde']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_new_solde" value="'.$search_new_solde.'"></td>';
// Action column
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
@ -256,51 +347,102 @@ if (!empty($arrayfields['cpl.fk_type']['checked'])) print_liste_field_titre($arr
if (!empty($arrayfields['cpl.prev_solde']['checked'])) print_liste_field_titre($arrayfields['cpl.prev_solde']['label'], $_SERVER["PHP_SELF"], 'prev_solde', '', '', '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['variation']['checked'])) print_liste_field_titre($arrayfields['variation']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['cpl.new_solde']['checked'])) print_liste_field_titre($arrayfields['cpl.new_solde']['label'], $_SERVER["PHP_SELF"], 'new_solde', '', '', '', $sortfield, $sortorder, 'right ');
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print '</tr>';
// TODO: $i = 0;
$i = 1;
foreach ($object->logs as $logs_CP)
while ($i < min($num, $limit))
{
$user_action = new User($db);
$user_action->fetch($logs_CP['fk_user_action']);
//TODO: $obj = $db->fetch_object($resql);
$obj = next($object->logs);
$user_update = new User($db);
$user_update->fetch($logs_CP['fk_user_update']);
$holidaylogstatic->id = $obj['rowid'];
$holidaylogstatic->date = $obj['date_action'];
$holidaylogstatic->validator = $obj['fk_user_action'];
$holidaylogstatic->employee = $obj['fk_user_update'];
$holidaylogstatic->description = $obj['type_action'];
$holidaylogstatic->type = $obj['fk_type'];
$holidaylogstatic->balance_previous = $obj['prev_solde'];
$holidaylogstatic->balance_new = $obj['new_solde'];
$delta = price2num($logs_CP['new_solde'] - $logs_CP['prev_solde'], 5);
$detasign = ($delta > 0 ? '+' : '');
print '<tr class="oddeven">';
print '<tr class="oddeven">';
if (!empty($arrayfields['cpl.rowid']['checked'])) print '<td>'.$logs_CP['rowid'].'</td>';
if (!empty($arrayfields['cpl.date_action']['checked'])) print '<td style="text-align: center;">'.$logs_CP['date_action'].'</td>';
if (!empty($arrayfields['cpl.fk_user_action']['checked'])) print '<td>'.$user_action->getNomUrl(-1).'</td>';
if (!empty($arrayfields['cpl.fk_user_update']['checked'])) print '<td>'.$user_update->getNomUrl(-1).'</td>';
if (!empty($arrayfields['cpl.type_action']['checked'])) print '<td>'.$logs_CP['type_action'].'</td>';
if (!empty($arrayfields['cpl.fk_type']['checked']))
{
print '<td>';
$label = (($alltypeleaves[$logs_CP['fk_type']]['code'] && $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code']) != $alltypeleaves[$logs_CP['fk_type']]['code']) ? $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code']) : $alltypeleaves[$logs_CP['fk_type']]['label']);
print $label ? $label : $logs_CP['fk_type'];
print '</td>';
}
// Id
if (!empty($arrayfields['cpl.rowid']['checked'])) {
print '<td>'.$holidaylogstatic->id.'</td>';
}
if (!empty($arrayfields['cpl.prev_solde']['checked'])) print '<td style="text-align: right;">'.price2num($logs_CP['prev_solde'], 5).' '.$langs->trans('days').'</td>';
if (!empty($arrayfields['variation']['checked'])) print '<td style="text-align: right;">'.$detasign.$delta.'</td>';
if (!empty($arrayfields['cpl.new_solde']['checked'])) print '<td style="text-align: right;">'.price2num($logs_CP['new_solde'], 5).' '.$langs->trans('days').'</td>';
print '<td></td>';
print '</tr>'."\n";
// Date
if (!empty($arrayfields['cpl.date_action']['checked'])) {
print '<td style="text-align: center">'.$holidaylogstatic->date.'</td>';
}
// Validator
if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
$user_action = new User($db);
$user_action->fetch($holidaylogstatic->validator);
print '<td>'.$user_action->getNomUrl(-1).'</td>';
}
// Emloyee
if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
$user_update = new User($db);
$user_update->fetch($holidaylogstatic->employee);
print '<td>'.$user_update->getNomUrl(-1).'</td>';
}
// Description
if (!empty($arrayfields['cpl.type_action']['checked'])) {
print '<td>'.$holidaylogstatic->description.'</td>';
}
// Type
if (!empty($arrayfields['cpl.fk_type']['checked'])) {
if ($alltypeleaves[$holidaylogstatic->type]['code'] && $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']) != $alltypeleaves[$holidaylogstatic->type]['code']) {
$label = $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']);
} else {
$label = $alltypeleaves[$holidaylogstatic->type]['label'];
}
print '<td>';
print $label ? $label : $holidaylogstatic->type;
print '</td>';
}
// Previous balance
if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_previous, 5).' '.$langs->trans('days').'</td>';
}
// Variation
if (!empty($arrayfields['variation']['checked'])) {
$delta = price2num($holidaylogstatic->balance_new - $holidaylogstatic->balance_previous, 5);
$detasign = ($delta > 0 ? '+' : '');
print '<td style="text-align: right;">'.$detasign.$delta.'</td>';
}
// New Balance
if (!empty($arrayfields['cpl.new_solde']['checked'])) {
print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_new, 5).' '.$langs->trans('days').'</td>';
}
// Buttons
print '<td></td>';
print '</tr>';
$i++;
}
if ($log_holiday == '2')
{
print '<tr class="opacitymedium">';
print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
print '</tr>';
if ($log_holiday == '2') {
print '<tr class="opacitymedium">';
print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
print '</tr>';
}
print '</tbody>'."\n";
print '</table>'."\n";
print '</table>';
print '</div>';
print '</form>';

View File

@ -361,7 +361,7 @@ if ($step == 1 || !$datatoimport)
print '</td><td style="text-align: right">';
if ($objimport->array_import_perms[$key])
{
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=2&datatoimport='.$objimport->array_import_code[$key].$param.'">'.img_picto($langs->trans("NewImport"), 'filenew').'</a>';
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=2&datatoimport='.$objimport->array_import_code[$key].$param.'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15x"').'</a>';
} else {
print $langs->trans("NotEnoughPermissions");
}
@ -424,7 +424,7 @@ if ($step == 2 && $datatoimport)
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<span class="opacitymedium">'.$langs->trans("ChooseFormatOfFileToImport", img_picto('', 'filenew')).'</span><br><br>';
print '<span class="opacitymedium">'.$langs->trans("ChooseFormatOfFileToImport", img_picto('', 'next', '')).'</span><br><br>';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
@ -445,7 +445,7 @@ if ($step == 2 && $datatoimport)
print '<td style="text-align:center"><a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample").'</a></td>';
// Action button
print '<td style="text-align:right">';
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=3&format='.$key.$param.'">'.img_picto($langs->trans("SelectFormat"), 'filenew').'</a>';
print '<a href="'.DOL_URL_ROOT.'/imports/import.php?step=3&format='.$key.$param.'">'.img_picto($langs->trans("SelectFormat"), 'next', 'class="fa-15x"').'</a>';
print '</td>';
print '</tr>';
}
@ -549,7 +549,7 @@ if ($step == 3 && $datatoimport)
print '<input type="hidden" value="'.dol_escape_htmltag($enclosure).'" name="enclosure">';
print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">';
print '<span class="opacitymedium">'.$langs->trans("ChooseFileToImport", img_picto('', 'filenew')).'</span><br><br>';
print '<span class="opacitymedium">'.$langs->trans("ChooseFileToImport", img_picto('', 'next')).'</span><br><br>';
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
@ -643,7 +643,7 @@ if ($step == 3 && $datatoimport)
print '">'.img_delete().'</a></td>';
// Action button
print '<td style="text-align:right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?step=4'.$param.'&filetoimport='.urlencode($relativepath).'">'.img_picto($langs->trans("NewImport"), 'filenew').'</a>';
print '<a href="'.$_SERVER['PHP_SELF'].'?step=4'.$param.'&filetoimport='.urlencode($relativepath).'">'.img_picto($langs->trans("NewImport"), 'next', 'class="fa-15x"').'</a>';
print '</td>';
print '</tr>';
}

View File

@ -156,6 +156,7 @@ class Odf
*/
public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859')
{
$value = $encode ? htmlspecialchars($value) : $value;
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
$convertedValue = $value;

View File

@ -119,7 +119,7 @@ ALTER TABLE llx_categorie_warehouse ADD CONSTRAINT fk_categorie_warehouse_fk_war
create table llx_holiday_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -135,7 +135,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
create table llx_entrepot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -165,7 +165,7 @@ ALTER TABLE llx_events ADD COLUMN prefix_session varchar(255) NULL;
create table llx_payment_salary_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- salary payment id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -183,8 +183,8 @@ ALTER TABLE llx_oauth_token ADD COLUMN fk_soc integer DEFAULT NULL after token;
ALTER TABLE llx_adherent_type ADD COLUMN duration varchar(6) DEFAULT NULL after morphy;
ALTER TABLE llx_mailing ADD COLUMN tms timestamp;
ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp;
ALTER TABLE llx_mailing ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_mailing_cibles ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_projet ADD COLUMN usage_opportunity integer DEFAULT 0;
ALTER TABLE llx_projet ADD COLUMN usage_task integer DEFAULT 1;
@ -458,7 +458,7 @@ create table llx_c_shipment_package_type
CREATE TABLE llx_product_fournisseur_price_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -478,7 +478,7 @@ CREATE TABLE llx_mrp_mo(
note_private text,
date_creation datetime NOT NULL,
date_valid datetime NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
fk_user_valid integer,
@ -514,7 +514,7 @@ ALTER TABLE llx_mrp_mo ADD INDEX idx_mrp_mo_fk_project (fk_project);
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -551,7 +551,7 @@ CREATE TABLE llx_mrp_production(
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
fk_stock_movement integer, -- id of stock movement when movements are validated
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14)
@ -576,7 +576,7 @@ ALTER TABLE llx_facture_rec MODIFY COLUMN fk_cond_reglement integer NOT NULL DEF
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -587,7 +587,7 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;

View File

@ -36,7 +36,7 @@ UPDATE llx_c_units set scale = 86400 where code = 'D' and unit_type = 'time';
create table llx_commande_fournisseur_dispatch_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -57,7 +57,7 @@ create table llx_c_shipment_package_type
create table llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -69,7 +69,7 @@ ALTER TABLE llx_facture_rec MODIFY COLUMN titre varchar(200) NOT NULL;
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -303,7 +303,7 @@ ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_
ALTER TABLE llx_categorie_website_page ADD CONSTRAINT fk_categorie_website_page_website_page_rowid FOREIGN KEY (fk_website_page) REFERENCES llx_website_page (rowid);
ALTER TABLE llx_categorie ADD COLUMN date_creation datetime;
ALTER TABLE llx_categorie ADD COLUMN tms timestamp;
ALTER TABLE llx_categorie ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_categorie ADD COLUMN fk_user_creat integer;
ALTER TABLE llx_categorie ADD COLUMN fk_user_modif integer;

View File

@ -47,7 +47,7 @@ ALTER TABLE llx_bom_bom_extrafields ADD INDEX idx_bom_bom_extrafields_fk_object
create table llx_mrp_mo_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -124,7 +124,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
last_main_doc varchar(255),
@ -150,7 +150,7 @@ ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN remuneration_sugge
create table llx_recruitment_recruitmentjobposition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -169,7 +169,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -200,7 +200,7 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD INDEX idx_recruitment_rec
create table llx_recruitment_recruitmentcandidature_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -290,8 +290,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52);
ALTER TABLE llx_ecm_directories CHANGE COLUMN date_m tms timestamp;
ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp;
ALTER TABLE llx_ecm_directories CHANGE COLUMN date_m tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_ecm_files CHANGE COLUMN date_m tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswer)__<br>\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
@ -337,7 +337,7 @@ ALTER TABLE llx_menu MODIFY COLUMN enabled text;
CREATE TABLE llx_ecm_files_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -347,7 +347,7 @@ ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_ob
CREATE TABLE llx_ecm_directories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -357,3 +357,12 @@ ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255);
ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
DELETE FROM llx_const WHERE name in ('MAIN_INCLUDE_ZERO_VAT_IN_REPORTS');
UPDATE llx_projet_task_time SET tms = null WHERE tms = 0;
ALTER TABLE llx_projet_task_time MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime;
DELETE FROM llx_user_rights WHERE fk_id IN (SELECT id FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous');
DELETE FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous';

View File

@ -419,19 +419,19 @@ update llx_actioncomm set elementtype='order' where elementtype='commande';
update llx_actioncomm set elementtype='contract' where elementtype='contrat';
alter table llx_propal add column tms timestamp after fk_projet;
alter table llx_propal add column tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after fk_projet;
create table llx_product_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL
) ENGINE=innodb;
create table llx_societe_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL
) ENGINE=innodb;
@ -487,7 +487,7 @@ ALTER TABLE llx_don ADD phone varchar(24) after email;
ALTER TABLE llx_element_element MODIFY sourcetype varchar(32) NOT NULL;
ALTER TABLE llx_element_element MODIFY targettype varchar(32) NOT NULL;
ALTER TABLE llx_societe_prices MODIFY tms timestamp NULL;
ALTER TABLE llx_societe_prices MODIFY tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- ALTER TABLE llx_societe_prices ALTER COLUMN tms DROP NOT NULL;
-- Fix: It seems this is missing for some users

View File

@ -62,7 +62,7 @@ ALTER TABLE llx_societe MODIFY code_compta varchar(24);
ALTER TABLE llx_societe MODIFY code_compta_fournisseur varchar(24);
ALTER TABLE llx_chargesociales ADD COLUMN tms timestamp;
ALTER TABLE llx_chargesociales ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_chargesociales ADD COLUMN date_creation datetime;
ALTER TABLE llx_chargesociales ADD COLUMN date_valid datetime;
@ -118,7 +118,7 @@ CREATE TABLE llx_localtax
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer NOT NULL DEFAULT '1',
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep date DEFAULT NULL,
datev date DEFAULT NULL,
amount double NOT NULL DEFAULT '0',

View File

@ -39,7 +39,7 @@ ALTER TABLE llx_societe DROP COLUMN description;
ALTER TABLE llx_societe DROP COLUMN services;
ALTER TABLE llx_societe MODIFY COLUMN ref_ext varchar(128);
ALTER TABLE llx_bank ADD COLUMN tms timestamp after datec;
ALTER TABLE llx_bank ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP after datec;
-- Monaco VAT Rates
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27,'19.6','0','VAT standard rate (France hors DOM-TOM)',1);
@ -267,7 +267,7 @@ ALTER TABLE llx_extrafields ADD COLUMN fieldrequired INTEGER DEFAULT 0;
create table llx_socpeople_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -276,7 +276,7 @@ ALTER TABLE llx_socpeople_extrafields ADD INDEX idx_socpeople_extrafields (fk_ob
create table llx_actioncomm_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -835,7 +835,7 @@ CREATE TABLE llx_product_price_by_qty
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product_price integer NOT NULL,
date_price timestamp,
date_price timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
price double (24,8) DEFAULT 0,
price_ttc double (24,8) DEFAULT 0,
qty_min real DEFAULT 0
@ -910,7 +910,7 @@ ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(8);
create table llx_user_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;

View File

@ -23,7 +23,7 @@ ALTER TABLE llx_menu MODIFY COLUMN leftmenu varchar(100);
create table llx_adherent_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -115,7 +115,7 @@ ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAUL
-- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- VPGSQL8.2 DROP table llx_c_shipment_mode;
-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL);
-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(255) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (1,'CATCH','Catch','Catch by client','',1);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (2,'TRANS','Transporter','Generic transporter','',1);
-- VPGSQL8.2 INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi','',0);
@ -136,7 +136,7 @@ ALTER TABLE llx_stock_mouvement MODIFY COLUMN value real;
create table llx_propal_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -145,7 +145,7 @@ ALTER TABLE llx_propal_extrafields ADD INDEX idx_propal_extrafields (fk_object);
create table llx_facture_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -205,7 +205,7 @@ ALTER TABLE llx_facturedet DROP COLUMN fk_export_compta;
CREATE TABLE llx_cronjob
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
jobtype varchar(10) NOT NULL,
label text NOT NULL,
@ -249,7 +249,7 @@ DROP TABLE llx_printer_ipp;
CREATE TABLE llx_printer_ipp
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
@ -265,7 +265,7 @@ ALTER TABLE llx_adherent MODIFY COLUMN ref_ext varchar(128);
create table llx_commande_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -299,7 +299,7 @@ ALTER TABLE llx_socpeople CHANGE COLUMN note note_private text;
create table llx_projet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -308,7 +308,7 @@ ALTER TABLE llx_projet_extrafields ADD INDEX idx_projet_extrafields (fk_object);
create table llx_projet_task_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -319,7 +319,7 @@ CREATE TABLE llx_opensurvey_comments (
id_comment INTEGER unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
id_sondage CHAR(16) NOT NULL,
comment text NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
usercomment text
) ENGINE=InnoDB;
@ -336,7 +336,7 @@ CREATE TABLE llx_opensurvey_sondage (
survey_link_visible integer DEFAULT 1,
canedit integer DEFAULT 0,
origin varchar(64),
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
sujet TEXT
) ENGINE=InnoDB;
CREATE TABLE llx_opensurvey_user_studs (
@ -344,7 +344,7 @@ CREATE TABLE llx_opensurvey_user_studs (
nom VARCHAR(64) NOT NULL,
id_sondage VARCHAR(16) NOT NULL,
reponses VARCHAR(100) NOT NULL,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN id_sondage_admin CHAR(24);
@ -367,7 +367,7 @@ UPDATE llx_extrafields SET elementtype='societe' WHERE elementtype='company';
create table llx_commande_fournisseur_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -376,7 +376,7 @@ ALTER TABLE llx_commande_fournisseur_extrafields ADD INDEX idx_commande_fourniss
create table llx_facture_fourn_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -43,7 +43,7 @@ ALTER TABLE llx_socpeople ADD COLUMN statut tinyint DEFAULT 1 NOT NULL AFTER imp
create table llx_fichinter_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -55,7 +55,7 @@ ALTER TABLE llx_product ADD COLUMN desiredstock integer DEFAULT 0;
create table llx_commandedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
@ -69,7 +69,7 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN info_bits integer DEFAULT 0 after tota
create table llx_facturedet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -79,7 +79,7 @@ ALTER TABLE llx_facturedet_extrafields ADD INDEX idx_facturedet_extrafields (fk_
create table llx_propaldet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -314,7 +314,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
-- Add ref_ext on bordereau_cheque
ALTER TABLE llx_bordereau_cheque ADD ref_ext VARCHAR(255);
ALTER TABLE llx_bordereau_cheque ADD tms timestamp;
ALTER TABLE llx_bordereau_cheque ADD tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- Task 1011
@ -337,7 +337,7 @@ ALTER TABLE llx_contratdet ADD column product_type integer DEFAULT 1 after total
create table llx_contrat_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -74,7 +74,7 @@ ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
@ -108,7 +108,7 @@ create table llx_product_customer_price
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_soc integer NOT NULL,
price double(24,8) DEFAULT 0,
@ -164,7 +164,7 @@ ALTER TABLE llx_product ADD COLUMN tobatch tinyint DEFAULT 0 NOT NULL;
CREATE TABLE llx_product_batch (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product_stock integer NOT NULL,
eatby datetime DEFAULT NULL,
sellby datetime DEFAULT NULL,
@ -187,7 +187,7 @@ CREATE TABLE llx_expeditiondet_batch (
--DROP TABLE llx_payment_salary
CREATE TABLE llx_payment_salary (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user integer NOT NULL,
datep date,
datev date,
@ -229,7 +229,7 @@ ALTER TABLE llx_projet_task_time ADD thm double(24,8) AFTER fk_user;
create table llx_categories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -283,7 +283,7 @@ CREATE TABLE llx_resource
fk_code_type_resource varchar(32),
note_public text,
note_private text,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_resource ADD INDEX fk_code_type_resource_idx (fk_code_type_resource);
@ -298,7 +298,7 @@ CREATE TABLE llx_element_resources
busy integer,
mandatory integer,
fk_user_create integer,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_element_resources ADD UNIQUE INDEX idx_element_resources_idx1 (resource_id, resource_type, element_id, element_type);

View File

@ -137,7 +137,7 @@ DROP TABLE llx_compta_compte_generaux;
-- Align size for accounting account
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_parent varchar(32);
ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec;
ALTER TABLE llx_accountingaccount add column tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER datec;
ALTER TABLE llx_accountingdebcred MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(32);
ALTER TABLE llx_c_chargesociales MODIFY COLUMN accountancy_code varchar(32);
@ -233,7 +233,7 @@ create table llx_accounting_fiscalyear
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer NULL,
fk_user_modif integer NULL
)ENGINE=innodb;
@ -1050,7 +1050,7 @@ create table llx_c_email_templates
private smallint DEFAULT 0 NOT NULL, -- Template public or private
fk_user integer, -- Id utilisateur si modele prive, sinon null
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
position smallint, -- Position
active tinyint DEFAULT 1 NOT NULL,
@ -1112,7 +1112,7 @@ ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
CREATE TABLE llx_fichinterdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -1121,7 +1121,7 @@ ALTER TABLE llx_fichinterdet_extrafields ADD INDEX idx_ficheinterdet_extrafields
CREATE TABLE llx_usergroup_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -49,7 +49,7 @@ create table llx_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(80) NOT NULL,
fk_bank integer,
capital real DEFAULT 0 NOT NULL,
@ -75,7 +75,7 @@ create table llx_payment_loan
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
@ -145,7 +145,7 @@ ALTER TABLE llx_product ADD COLUMN lifo double(24,8) AFTER fifo;
CREATE TABLE llx_printing
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
printer_name text NOT NULL,
printer_location text NOT NULL,
@ -177,7 +177,7 @@ DELETE from llx_const where name = 'MAIN_USE_JQUERY_MULTISELECT' and value = '1'
create table llx_bank_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -198,7 +198,7 @@ ALTER TABLE llx_bank_account_extrafields ADD INDEX idx_bank_account_extrafields
create table llx_contratdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -210,7 +210,7 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN delivery_time_days integer;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN comment varchar(255);
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN status integer;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN batch varchar(30) DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN eatby date DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN sellby date DEFAULT NULL;
@ -240,7 +240,7 @@ CREATE TABLE llx_expensereport (
date_approve datetime,
date_refuse datetime,
date_cancel datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer NOT NULL,
fk_user_modif integer DEFAULT NULL,
fk_user_valid integer DEFAULT NULL,
@ -297,7 +297,7 @@ create table llx_payment_expensereport
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_expensereport integer,
datec datetime, -- date de creation
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
@ -316,7 +316,7 @@ ALTER TABLE llx_societe ADD COLUMN name_alias varchar(128) NULL;
create table llx_commande_fournisseurdet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -327,7 +327,7 @@ ALTER TABLE llx_commande_fournisseurdet_extrafields ADD INDEX idx_commande_fourn
create table llx_facture_fourn_det_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -357,7 +357,7 @@ CREATE TABLE llx_askpricesupplier (
ref_int varchar(255) DEFAULT NULL,
fk_soc integer DEFAULT NULL,
fk_projet integer DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime DEFAULT NULL,
date_valid datetime DEFAULT NULL,
date_cloture datetime DEFAULT NULL,
@ -422,14 +422,14 @@ CREATE TABLE llx_askpricesupplierdet (
CREATE TABLE llx_askpricesupplier_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
CREATE TABLE llx_askpricesupplierdet_extrafields (
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) DEFAULT NULL
) ENGINE=innodb;
@ -491,7 +491,7 @@ ALTER TABLE llx_don CHANGE COLUMN fk_project fk_projet integer NULL;
create table llx_don_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -503,7 +503,7 @@ create table llx_payment_donation
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_donation integer,
datec datetime, -- date de creation
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime, -- payment date
amount real DEFAULT 0,
fk_typepayment integer NOT NULL,
@ -585,7 +585,7 @@ CREATE TABLE IF NOT EXISTS llx_propal_merge_pdf_product (
fk_user_author integer DEFAULT NULL,
fk_user_mod integer NOT NULL,
datec datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14) DEFAULT NULL
) ENGINE=InnoDB;

View File

@ -146,7 +146,7 @@ CREATE TABLE llx_ecm_files
cover text, -- is this file a file to use for a cover
extraparams varchar(255), -- for stock other parameters with json format
date_c datetime,
date_m timestamp,
date_m timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_c integer,
fk_user_m integer,
acl text -- for future permission 'per file'
@ -227,7 +227,7 @@ CREATE TABLE IF NOT EXISTS llx_establishment (
fk_user_author integer NOT NULL,
fk_user_mod integer NOT NULL,
datec datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
status smallint DEFAULT 1
) ENGINE=InnoDB;
@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS llx_user_rib (
fk_user integer NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(30),
bank varchar(255), -- bank name
code_banque varchar(128), -- bank code
@ -263,7 +263,7 @@ create table llx_stock_lotserial
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@ -282,7 +282,7 @@ create table llx_budget
date_start date,
date_end date,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@ -296,7 +296,7 @@ create table llx_budget_lines
fk_project_ids varchar(255) NOT NULL, -- List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'.
amount double(24,8) NOT NULL,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@ -369,7 +369,7 @@ create table llx_categorie_project
create table llx_expedition_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -379,7 +379,7 @@ ALTER TABLE llx_expedition_extrafields ADD INDEX idx_expedition_extrafields (fk_
create table llx_expeditiondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -392,7 +392,7 @@ ALTER TABLE llx_expeditiondet_extrafields ADD INDEX idx_expeditiondet_extrafield
create table llx_livraison_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -402,7 +402,7 @@ ALTER TABLE llx_livraison_extrafields ADD INDEX idx_livraison_extrafields (fk_ob
create table llx_livraisondet_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- object id
import_key varchar(14) -- import key
)ENGINE=innodb;
@ -595,7 +595,7 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN doc_ref varchar(300) NOT NULL;
ALTER TABLE llx_holiday ADD COLUMN tms timestamp;
ALTER TABLE llx_holiday ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_holiday ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_holiday ADD INDEX idx_holiday_entity (entity);

View File

@ -54,7 +54,7 @@ CREATE TABLE llx_product_lot (
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer
@ -140,7 +140,7 @@ CREATE TABLE llx_website
fk_default_home integer,
date_creation datetime,
date_modification datetime,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website ADD COLUMN fk_default_home integer;
ALTER TABLE llx_website CHANGE COLUMN shortname ref varchar(24) NOT NULL;
@ -158,7 +158,7 @@ CREATE TABLE llx_website_page
status integer,
date_creation datetime,
date_modification datetime,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
@ -475,7 +475,7 @@ CREATE TABLE llx_advtargetemailing
fk_user_author integer NOT NULL,
datec datetime NOT NULL,
fk_user_mod integer NOT NULL,
tms timestamp NOT NULL
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=InnoDB;
ALTER TABLE llx_advtargetemailing ADD UNIQUE INDEX uk_advtargetemailing_name (name);

View File

@ -114,7 +114,7 @@ ALTER TABLE llx_societe_remise ADD COLUMN entity integer DEFAULT 1 NOT NULL afte
create table llx_expensereport_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -133,7 +133,7 @@ UPDATE llx_adherent_type SET subscription = '1' WHERE subscription = 'yes';
CREATE TABLE llx_product_lot_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -145,7 +145,7 @@ ALTER TABLE llx_website_page MODIFY COLUMN content MEDIUMTEXT;
CREATE TABLE llx_product_warehouse_properties
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_entrepot integer NOT NULL,
seuil_stock_alerte integer DEFAULT 0,
@ -156,7 +156,7 @@ CREATE TABLE llx_product_warehouse_properties
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_creation datetime;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN tms timestamp;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN numero_compte varchar(32) NOT NULL;
-- VMYSQL4.3 ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN code_journal varchar(32) NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_accounting_bookkeeping ALTER COLUMN numero_compte SET NOT NULL;
@ -186,7 +186,7 @@ ALTER TABLE llx_entrepot ADD COLUMN fk_parent integer DEFAULT 0;
create table llx_resource_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -222,7 +222,7 @@ create table llx_user_employment
ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
fk_user integer,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
job varchar(128), -- job position. may be a dictionary

View File

@ -61,7 +61,7 @@ ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_suppli
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN fk_user_creat integer NOT NULL DEFAULT 0;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin;
@ -160,7 +160,7 @@ ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_projet_task_time ADD COLUMN datec date;
ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp;
ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price ADD COLUMN fk_multicurrency integer;
ALTER TABLE llx_product_price ADD COLUMN multicurrency_code varchar(255);
@ -171,12 +171,12 @@ ALTER TABLE llx_product_price ADD COLUMN multicurrency_price_ttc double(24,8) DE
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer;
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price;
ALTER TABLE llx_product_price_by_qty ADD COLUMN tms timestamp;
ALTER TABLE llx_product_price_by_qty ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key varchar(14);
ALTER TABLE llx_user ADD COLUMN import_key varchar(14);
ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp;
ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
UPDATE llx_facture_rec SET tms = datec where tms < '2000-01-01';
CREATE TABLE llx_product_attribute
@ -295,7 +295,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
tms timestamp, -- | date last modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | date last modification
import_key varchar(14),
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib
@ -391,7 +391,7 @@ ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '';
CREATE TABLE llx_payment_various
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime,
datep date,
datev date,
@ -438,7 +438,7 @@ rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 0,
ref varchar(48),
datec datetime DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer,
fk_user_modif integer,
fk_user_valid integer,
@ -453,7 +453,7 @@ CREATE TABLE llx_inventorydet
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_inventory integer DEFAULT 0,
fk_warehouse integer DEFAULT 0,
fk_product integer DEFAULT 0,
@ -467,7 +467,7 @@ new_pmp double DEFAULT 0
)ENGINE=InnoDB;
ALTER TABLE llx_inventory ADD COLUMN datec datetime DEFAULT NULL;
ALTER TABLE llx_inventory ADD COLUMN tms timestamp;
ALTER TABLE llx_inventory ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms);
ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec);
@ -502,7 +502,7 @@ CREATE TABLE llx_loan_schedule
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datep datetime,
amount_capital real DEFAULT 0,
amount_insurance real DEFAULT 0,
@ -547,7 +547,7 @@ CREATE TABLE llx_website_page
fk_user_create integer,
fk_user_modif integer,
date_creation datetime,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pageurl);
@ -566,7 +566,7 @@ UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories
CREATE TABLE llx_blockedlog
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
action varchar(50),
amounts real NOT NULL,
signature varchar(100) NOT NULL,
@ -593,7 +593,7 @@ CREATE TABLE llx_blockedlog_authority
rowid integer AUTO_INCREMENT PRIMARY KEY,
blockchain longtext NOT NULL,
signature varchar(100) NOT NULL,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;
ALTER TABLE llx_blockedlog_authority ADD INDEX signature (signature);
@ -613,7 +613,7 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255);
CREATE TABLE llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -623,7 +623,7 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f
CREATE TABLE llx_facturedet_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;

View File

@ -265,7 +265,7 @@ ALTER TABLE llx_menu MODIFY fk_leftmenu varchar(100);
CREATE TABLE llx_website_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -285,7 +285,7 @@ CREATE TABLE llx_website_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -307,7 +307,7 @@ ALTER TABLE llx_website_account ADD CONSTRAINT llx_website_account_fk_website FO
CREATE TABLE llx_website_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -326,7 +326,7 @@ alter table llx_user add column pass_encoding varchar(24) NULL;
CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_c_exp_tax_cat integer DEFAULT 0 NOT NULL,
fk_range integer DEFAULT 0 NOT NULL,
coef double DEFAULT 0 NOT NULL,
@ -441,7 +441,7 @@ INSERT INTO llx_c_exp_tax_range (rowid,fk_c_exp_tax_cat,range_ik, entity, active
CREATE TABLE llx_expensereport_rules (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
dates datetime NOT NULL,
datee datetime NOT NULL,
amount numeric(24,8) NOT NULL,
@ -464,7 +464,7 @@ ALTER TABLE llx_extrafields ADD COLUMN fk_user_author integer;
ALTER TABLE llx_extrafields ADD COLUMN fk_user_modif integer;
ALTER TABLE llx_extrafields ADD COLUMN datec datetime;
ALTER TABLE llx_extrafields ADD COLUMN enabled varchar(255) DEFAULT '1';
ALTER TABLE llx_extrafields ADD COLUMN tms timestamp;
ALTER TABLE llx_extrafields ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
-- We fix value of 'list' from 0 to 1 for all extrafields created before this migration
--VMYSQL4.1 UPDATE llx_extrafields SET list = 1 WHERE list = 0 AND fk_user_author IS NULL and fk_user_modif IS NULL and datec IS NULL;
@ -528,7 +528,7 @@ DROP TABLE llx_projet_task_comment;
CREATE TABLE llx_comment (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
description text NOT NULL,
fk_user_author integer DEFAULT NULL,
fk_element integer DEFAULT NULL,
@ -572,7 +572,7 @@ create table llx_c_email_senderprofile
entity integer DEFAULT 1 NOT NULL, -- multi company id
private smallint DEFAULT 0 NOT NULL, -- Template public or private
date_creation datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
email varchar(255), -- Email
signature text, -- Predefined signature
@ -655,7 +655,7 @@ create table llx_onlinesignature
object_type varchar(32) NOT NULL,
object_id integer NOT NULL,
datec datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(255) NOT NULL,
ip varchar(128),
pathoffile varchar(255)
@ -709,7 +709,7 @@ ALTER TABLE llx_resource ADD CONSTRAINT fk_resource_fk_country FOREIGN KEY (fk_c
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -149,7 +149,7 @@ CREATE TABLE llx_societe_remise_supplier
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
fk_user_author integer, -- creation user
remise_supplier double(6,3) DEFAULT 0 NOT NULL, -- discount
@ -246,7 +246,7 @@ CREATE TABLE llx_ticket
date_read datetime,
date_close datetime,
notify_tiers_at_create tinyint,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_ticket ADD COLUMN notify_tiers_at_create integer;
@ -271,7 +271,7 @@ ALTER TABLE llx_ticket_msg ADD CONSTRAINT fk_ticket_msg_fk_track_id FOREIGN KEY
CREATE TABLE llx_ticket_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
@ -279,7 +279,7 @@ CREATE TABLE llx_ticket_extrafields
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -371,7 +371,7 @@ CREATE TABLE llx_societe_account(
date_last_login datetime,
date_previous_login datetime,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -433,7 +433,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -449,7 +449,7 @@ ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_type (fk_asset_type);
create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -458,7 +458,7 @@ create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(50) NOT NULL,
accountancy_code_asset varchar(32),
accountancy_code_depreciation_asset varchar(32),
@ -473,7 +473,7 @@ ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_type FOREIGN KEY (fk_asset_t
create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -43,7 +43,7 @@ ALTER TABLE llx_facture ADD COLUMN pos_source varchar(32);
create table llx_facture_rec_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
@ -182,7 +182,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -202,7 +202,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
type varchar(128) NOT NULL,
rulevalue varchar(128) NULL,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),
@ -217,7 +217,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL,
actionparam varchar(255) NULL,
date_creation datetime NOT NULL,
tms timestamp NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
position integer DEFAULT 0,

View File

@ -87,7 +87,7 @@ create table llx_mailing_unsubscribe
unsubscribegroup varchar(128) DEFAULT '',
ip varchar(128),
date_creat datetime, -- creation date
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=innodb;
ALTER TABLE llx_mailing_unsubscribe ADD UNIQUE uk_mailing_unsubscribe(email, entity, unsubscribegroup);
@ -223,7 +223,7 @@ CREATE TABLE llx_bom_bom(
qty double(24,8),
efficiency double(8,4),
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_valid datetime,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
@ -240,7 +240,7 @@ ALTER TABLE llx_bom_bom ADD COLUMN date_valid datetime;
create table llx_bom_bom_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -266,7 +266,7 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL;
create table llx_bom_bomline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
@ -335,7 +335,7 @@ UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos
create table llx_reception
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
@ -383,7 +383,7 @@ ALTER TABLE llx_reception ADD INDEX idx_reception_fk_shipping_method (fk_shippin
create table llx_reception_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -24,7 +24,7 @@ create table llx_accounting_account
rowid bigint AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_pcg_version varchar(32) NOT NULL, -- Chart system
pcg_type varchar(20) NOT NULL, -- First part of Key for predefined groups
account_number varchar(32) NOT NULL,

View File

@ -45,7 +45,7 @@ CREATE TABLE llx_accounting_bookkeeping
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
tms timestamp, -- | date last modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date
fk_user integer NULL, -- The id of user that validate the accounting source document
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib

View File

@ -44,7 +44,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
fk_user_author integer NOT NULL, -- | user creating
fk_user_modif integer, -- | user making last change
date_creation datetime, -- FEC:EcritureDate | creation date
tms timestamp, -- | date last modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- | last modification date
fk_user integer NULL, -- The id of user that validate the accounting source document
code_journal varchar(32) NOT NULL, -- FEC:JournalCode
journal_label varchar(255), -- FEC:JournalLib

View File

@ -25,7 +25,7 @@ create table llx_accounting_fiscalyear
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL
)ENGINE=innodb;

View File

@ -33,7 +33,7 @@ create table llx_actioncomm
code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...)
datec datetime, -- date creation
tms timestamp, -- date modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_author integer, -- user id of user that has created record
fk_user_mod integer, -- user id of user that has modified record

View File

@ -19,7 +19,7 @@
create table llx_actioncomm_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -72,7 +72,7 @@ create table llx_adherent
model_pdf varchar(255),
datevalid datetime, -- date de validation
datec datetime, -- date de creation
tms timestamp, -- date de modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_author integer, -- can be null because member can be create by a guest
fk_user_mod integer,
fk_user_valid integer,

View File

@ -21,7 +21,7 @@
create table llx_adherent_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL, -- member id
import_key varchar(14) -- import key
)ENGINE=innodb;

View File

@ -26,7 +26,7 @@ create table llx_adherent_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
statut smallint NOT NULL DEFAULT 0,
libelle varchar(50) NOT NULL,
morphy varchar(3) NOT NULL,

View File

@ -19,7 +19,7 @@
create table llx_adherent_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -28,5 +28,5 @@ CREATE TABLE llx_advtargetemailing
fk_user_author integer NOT NULL,
datec datetime NOT NULL,
fk_user_mod integer NOT NULL,
tms timestamp NOT NULL
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
)ENGINE=innodb;

View File

@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
note_public text,
note_private text,
date_creation datetime NOT NULL,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
import_key varchar(14),

View File

@ -16,7 +16,7 @@
create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -17,7 +17,7 @@ create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(50) NOT NULL,
accountancy_code_asset varchar(32),
accountancy_code_depreciation_asset varchar(32),

View File

@ -16,7 +16,7 @@
create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -21,7 +21,7 @@ create table llx_bank
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datev date, -- date de valeur
dateo date, -- date operation
amount double(24,8) NOT NULL default 0,

View File

@ -26,7 +26,7 @@ create table llx_bank_account
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ref varchar(12) NOT NULL,
label varchar(30) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id

View File

@ -19,7 +19,7 @@
create table llx_bank_account_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -21,7 +21,7 @@ CREATE TABLE llx_blockedlog
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL,
date_creation datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
action varchar(50),
amounts double(24,8) NOT NULL,
element varchar(50),

View File

@ -3,5 +3,5 @@ CREATE TABLE llx_blockedlog_authority
rowid integer AUTO_INCREMENT PRIMARY KEY,
blockchain longtext NOT NULL,
signature varchar(100) NOT NULL,
tms timestamp
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=innodb;

View File

@ -31,7 +31,7 @@ CREATE TABLE llx_bom_bom(
duration double(24,8) DEFAULT NULL,
date_creation datetime NOT NULL,
date_valid datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
fk_user_valid integer,

View File

@ -16,7 +16,7 @@
create table llx_bom_bom_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -16,7 +16,7 @@
create table llx_bom_bomline_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -33,7 +33,7 @@ create table llx_bordereau_cheque
fk_bank_account integer,
fk_user_author integer,
statut smallint NOT NULL DEFAULT 0,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
note text,
entity integer DEFAULT 1 NOT NULL -- multi company id
)ENGINE=innodb;

View File

@ -23,6 +23,6 @@ create table llx_boxes_def
rowid integer AUTO_INCREMENT PRIMARY KEY,
file varchar(200) NOT NULL, -- Do not increase this as file+note must be small to allow index
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
note varchar(130) -- Do not increase this as file+note must be small to allow index
)ENGINE=innodb;

View File

@ -26,7 +26,7 @@ create table llx_budget
date_start date,
date_end date,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer

View File

@ -23,7 +23,7 @@ create table llx_budget_lines
fk_project_ids varchar(180) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project 'Projects to come'. 'FILTER:ref=*ABC' or 'FILTER:categid=123' = Can also be a dynamic rule to select projects.
amount double(24,8) NOT NULL,
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer,
fk_user_modif integer,
import_key integer

View File

@ -23,7 +23,7 @@ create table llx_c_email_senderprofile
entity integer DEFAULT 1 NOT NULL, -- multi company id
private smallint DEFAULT 0 NOT NULL, -- Template public (0) or private (id of user)
date_creation datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(255), -- Label of predefined email
email varchar(255) NOT NULL, -- Email
signature text, -- Predefined signature

View File

@ -27,7 +27,7 @@ create table llx_c_email_templates
private smallint DEFAULT 0 NOT NULL, -- Template public or private
fk_user integer, -- Id user owner if template is private, or null
datec datetime,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
label varchar(180), -- Label of predefined email
position smallint, -- Position
enabled varchar(255) DEFAULT '1', -- Condition to have this module visible

View File

@ -24,7 +24,7 @@
create table llx_c_field_list
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
element varchar(64) NOT NULL, -- name of element list
entity integer DEFAULT 1 NOT NULL, -- entity id
name varchar(32) NOT NULL, -- name of field with table alias (ex: p.ref)

View File

@ -20,7 +20,7 @@ create table llx_c_shipment_mode
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
code varchar(30) NOT NULL,
libelle varchar(50) NOT NULL,
description text,

View File

@ -32,7 +32,7 @@ create table llx_categorie
fk_soc integer DEFAULT NULL, -- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set.
visible tinyint DEFAULT 1 NOT NULL, -- determine if the products are visible or not
date_creation datetime, -- date creation
tms timestamp, -- date modification
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
fk_user_creat integer, -- user making creation
fk_user_modif integer, -- user making last change
import_key varchar(14) -- Import key

View File

@ -19,7 +19,7 @@
create table llx_categories_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -25,7 +25,7 @@ create table llx_chargesociales
date_ech datetime NOT NULL, -- date echeance
libelle varchar(80) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
date_creation datetime, -- date de creation
date_valid datetime, -- date de validation
fk_user_author integer, -- user making creation

Some files were not shown because too many files have changed in this diff Show More