Merge remote-tracking branch 'upstream/develop' into socialnetworks
This commit is contained in:
commit
03086026b8
@ -44,7 +44,7 @@ $actionsave=GETPOST('save', 'alpha');
|
||||
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
|
||||
$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
|
||||
|
||||
// List of aviable colors
|
||||
// List of available colors
|
||||
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
@ -28,6 +27,7 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
|
||||
|
||||
@ -38,6 +38,7 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$actionsave=GETPOST('save', 'alpha');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
@ -60,7 +61,7 @@ if ($action == 'setbankorder') {
|
||||
}
|
||||
}
|
||||
|
||||
//Auto report last num releve on conciliate
|
||||
// Auto report last num releve on conciliate
|
||||
if ($action == 'setreportlastnumreleve') {
|
||||
if (dolibarr_set_const($db, "BANK_REPORT_LAST_NUM_RELEVE", 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
@ -82,6 +83,58 @@ elseif ($action == 'unsetreportlastnumreleve') {
|
||||
}
|
||||
}
|
||||
|
||||
// Colorize movements
|
||||
if ($action == 'setbankcolorizemovement') {
|
||||
if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
elseif ($action == 'unsetbankcolorizemovement') {
|
||||
if (dolibarr_set_const($db, "BANK_COLORIZE_MOVEMENT", 0, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($actionsave)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$i=1; $errorsaved=0;
|
||||
$error=0;
|
||||
|
||||
// Save colors
|
||||
while ($i <= 2)
|
||||
{
|
||||
$color=trim(GETPOST('BANK_COLORIZE_MOVEMENT_COLOR'.$i, 'alpha'));
|
||||
if ($color=='-1') $color='';
|
||||
|
||||
$res=dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
@ -157,10 +210,11 @@ elseif ($action == 'setdoc') {
|
||||
|
||||
|
||||
/*
|
||||
* view
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
@ -169,6 +223,10 @@ llxHeader("", $langs->trans("BankSetupModule"));
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
|
||||
|
||||
print '<form name="bankmovementcolorconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
$head = bank_admin_prepare_head(null);
|
||||
dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account');
|
||||
|
||||
@ -372,7 +430,56 @@ foreach ($dirmodels as $reldir) {
|
||||
print '</table>';
|
||||
//}
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BankColorizeMovement"), '', '');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td colspan="4">' . $langs->trans("Name") . '</td>';
|
||||
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td colspan="4" width="100">';
|
||||
print $langs->trans('BankColorizeMovementDesc');
|
||||
print "</td>";
|
||||
// Active
|
||||
if ($conf->global->BANK_COLORIZE_MOVEMENT) {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetbankcolorizemovement">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setbankcolorizemovement">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
if(! empty($conf->global->BANK_COLORIZE_MOVEMENT))
|
||||
{
|
||||
$i=1;
|
||||
while ($i <= 2)
|
||||
{
|
||||
$key=$i;
|
||||
$color='BANK_COLORIZE_MOVEMENT_COLOR'.$key;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Label
|
||||
print '<td colspan="4" width="180" class="nowrap">'.$langs->trans("BankColorizeMovementName".$key)."</td>";
|
||||
// Color
|
||||
print '<td class="nowrap right">';
|
||||
print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key)?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key):$conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset');
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
@ -384,7 +491,6 @@ print '<br><br>';
|
||||
//{
|
||||
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>' . $langs->trans("Name") . '</td>';
|
||||
@ -416,6 +522,12 @@ print "</tr>\n";
|
||||
print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" id="save" name="save" class="button hideifnotset" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -116,7 +116,7 @@ if (empty($reshook))
|
||||
if (GETPOST('addfilter', 'alpha'))
|
||||
{
|
||||
$emailcollectorfilter = new EmailCollectorFilter($db);
|
||||
$emailcollectorfilter->type = GETPOST('filtertype', 'az09');
|
||||
$emailcollectorfilter->type = GETPOST('filtertype', 'aZ09');
|
||||
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
|
||||
$emailcollectorfilter->fk_emailcollector = $object->id;
|
||||
$emailcollectorfilter->status = 1;
|
||||
@ -150,7 +150,7 @@ if ($action == 'deletefilter')
|
||||
if (GETPOST('addoperation', 'alpha'))
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
$emailcollectoroperation->type = GETPOST('operationtype', 'az09');
|
||||
$emailcollectoroperation->type = GETPOST('operationtype', 'aZ09');
|
||||
$emailcollectoroperation->actionparam = GETPOST('operationparam', 'none');
|
||||
$emailcollectoroperation->fk_emailcollector = $object->id;
|
||||
$emailcollectoroperation->status = 1;
|
||||
|
||||
@ -63,8 +63,6 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("expensereports");
|
||||
|
||||
llxHeader('', $langs->trans("ExpenseReportsSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
118
htdocs/admin/holiday_extrafields.php
Normal file
118
htdocs/admin/holiday_extrafields.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/holiday_extrafields.php
|
||||
* \ingroup holiday
|
||||
* \brief Page to setup extra fields of holiday
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'errors', 'holiday', 'other'));
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=ExtraFields::$type2label;
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->transnoentitiesnoconv($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='holiday'; //Must be the $table_element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans("HolidaySetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = holiday_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Holidays"), -1, 'holiday');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
if ($action != 'create' && $action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Creation of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print '<br><div id="newattrib"></div>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition of an optional field */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -50,7 +50,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmatio
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'alpha');
|
||||
$search_label=GETPOST('search_label', 'alpha');
|
||||
$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)'
|
||||
$search_type_template=GETPOST('search_type_template', 'alpha');
|
||||
$search_lang=GETPOST('search_lang', 'alpha');
|
||||
$search_fk_user=GETPOST('search_fk_user', 'intcomma');
|
||||
@ -263,6 +263,7 @@ if (empty($reshook))
|
||||
{
|
||||
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
|
||||
$keycode=$listfieldvalue[$i];
|
||||
if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]);
|
||||
if ($value == 'lang') $keycode='langcode';
|
||||
if ($value == 'entity') $_POST[$keycode] = $conf->entity;
|
||||
if ($i) $sql.=",";
|
||||
@ -667,8 +668,6 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$showfield=1; // By defaut
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
@ -695,7 +694,7 @@ if ($resql)
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
|
||||
// Affiche nom du champ
|
||||
// Show fields
|
||||
if ($showfield)
|
||||
{
|
||||
if (! empty($tabhelp[$id][$value]))
|
||||
@ -813,6 +812,10 @@ if ($resql)
|
||||
$showfield=1;
|
||||
$align="left";
|
||||
$valuetoshow=$obj->{$fieldlist[$field]};
|
||||
if ($value == 'label' || $value == 'topic')
|
||||
{
|
||||
$valuetoshow = dol_escape_htmltag($valuetoshow);
|
||||
}
|
||||
if ($value == 'type_template')
|
||||
{
|
||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||
|
||||
@ -127,6 +127,15 @@ print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
|
||||
print '<td>';
|
||||
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -96,11 +96,11 @@ else
|
||||
|
||||
<tr>
|
||||
<td class="label1"><?php echo $langs->trans("Login"); ?></td>
|
||||
<td><input name="txtUsername" class="texte_login" type="text" value="<?php echo $usertxt; ?>" /></td>
|
||||
<td><input name="txtUsername" class="texte_login maxwidth150onsmartphoneimp" type="text" value="<?php echo $usertxt; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label1"><?php echo $langs->trans("Password"); ?></td>
|
||||
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
|
||||
<td><input name="pwdPassword" class="texte_login maxwidth150onsmartphoneimp" type="password" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
@ -157,7 +157,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -166,7 +166,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCheque").'</td>
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -175,7 +175,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -191,7 +191,7 @@ print "</tr>\n";
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<div align="center"><span class="bouton_login"><input class="button" name="sbmtConnexion" type="submit" value=<?php echo $langs->trans("Connection"); ?> /></span></div>
|
||||
<div align="center"><span class="bouton_login"><input class="button" name="sbmtConnexion" type="submit" value="<?php echo dol_escape_htmltag($langs->trans("Connection")); ?>" /></span></div>
|
||||
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
@ -36,7 +36,7 @@ $langs->load("categories");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$type = GETPOST('type', 'az09');
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
$removeelem = GETPOST('removeelem', 'int');
|
||||
$elemid = GETPOST('elemid', 'int');
|
||||
|
||||
|
||||
@ -512,6 +512,65 @@ if ($action == 'update')
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
// check if an event resource is already in use
|
||||
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') {
|
||||
$eventDateStart = $object->datep;
|
||||
$eventDateEnd = $object->datef;
|
||||
|
||||
$sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = 'dolresource'";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'";
|
||||
$sql .= " WHERE ac.id != " . $object->id;
|
||||
$sql .= " AND er.resource_id IN (";
|
||||
$sql .= " SELECT resource_id FROM " . MAIN_DB_PREFIX . "element_resources";
|
||||
$sql .= " WHERE element_id = " . $object->id;
|
||||
$sql .= " AND element_type = '" . $db->escape($object->element) . "'";
|
||||
$sql .= " AND busy = 1";
|
||||
$sql .= ")";
|
||||
$sql .= " AND er.busy = 1";
|
||||
$sql .= " AND (";
|
||||
|
||||
// event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end)
|
||||
$sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))";
|
||||
// event date end between ac.datep and ac.datep2
|
||||
if (!empty($eventDateEnd)) {
|
||||
$sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))";
|
||||
}
|
||||
// event date start before ac.datep and event date end after ac.datep2
|
||||
$sql .= " OR (";
|
||||
$sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'";
|
||||
if (!empty($eventDateEnd)) {
|
||||
$sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')";
|
||||
}
|
||||
$sql .= ")";
|
||||
|
||||
$sql .= ")";
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$object->error = $db->lasterror();
|
||||
$object->errors[] = $object->error;
|
||||
} else {
|
||||
if ($db->num_rows($resql) > 0) {
|
||||
// already in use
|
||||
$error++;
|
||||
$object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : ';
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$object->error .= '<br> - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']');
|
||||
}
|
||||
$object->errors[] = $object->error;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
@ -657,7 +657,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
|
||||
$this->contactid = $obj->fk_contact; // To have fetch_contact method working
|
||||
$this->fk_project = $obj->fk_project; // To have fetch_project method working
|
||||
$this->fk_project = $obj->fk_project; // To have fetch_projet method working
|
||||
|
||||
//$this->societe->id = $obj->fk_soc; // deprecated
|
||||
//$this->contact->id = $obj->fk_contact; // deprecated
|
||||
|
||||
@ -87,7 +87,7 @@ $week=GETPOST("week", "int")?GETPOST("week", "int"):date("W");
|
||||
$day=GETPOST("day", "int")?GETPOST("day", "int"):date("d");
|
||||
$pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3):GETPOST("projectid", "int", 3);
|
||||
$status=GETPOST("search_status", 'aZ09')?GETPOST("search_status", 'aZ09'):GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
|
||||
$type=GETPOST("search_type", 'az09')?GETPOST("search_type", 'az09'):GETPOST("type", 'az09');
|
||||
$type=GETPOST("search_type", 'aZ09')?GETPOST("search_type", 'aZ09'):GETPOST("type", 'aZ09');
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('search_actioncode', 'array'))
|
||||
@ -607,9 +607,7 @@ if ($resql)
|
||||
$event->fk_element=$obj->fk_element;
|
||||
$event->elementtype=$obj->elementtype;
|
||||
|
||||
$event->societe->id=$obj->fk_soc;
|
||||
$event->thirdparty_id=$obj->fk_soc;
|
||||
$event->contact->id=$obj->fk_contact;
|
||||
$event->contact_id=$obj->fk_contact;
|
||||
|
||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||
@ -1569,28 +1567,31 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
|
||||
|
||||
$thirdparty_id = ($event->thirdparty_id > 0 ? $event->thirdparty_id : ((is_object($event->societe) && $event->societe->id > 0) ? $event->societe->id : 0));
|
||||
$contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->cotact->id > 0) ? $event->contact->id : 0));
|
||||
|
||||
// If action related to company / contact
|
||||
$linerelatedto='';
|
||||
if (! empty($event->societe->id) && $event->societe->id > 0)
|
||||
if ($thirdparty_id > 0)
|
||||
{
|
||||
if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id]))
|
||||
if (! isset($cachethirdparties[$thirdparty_id]) || ! is_object($cachethirdparties[$thirdparty_id]))
|
||||
{
|
||||
$thirdparty=new Societe($db);
|
||||
$thirdparty->fetch($event->societe->id);
|
||||
$cachethirdparties[$event->societe->id]=$thirdparty;
|
||||
$thirdparty->fetch($thirdparty_id);
|
||||
$cachethirdparties[$thirdparty_id]=$thirdparty;
|
||||
}
|
||||
else $thirdparty=$cachethirdparties[$event->societe->id];
|
||||
else $thirdparty=$cachethirdparties[$thirdparty_id];
|
||||
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1, '', 0);
|
||||
}
|
||||
if (! empty($event->contact->id) && $event->contact->id > 0)
|
||||
if (! empty($contact_id) && $contact_id > 0)
|
||||
{
|
||||
if (! is_object($cachecontacts[$event->contact->id]))
|
||||
if (! is_object($cachecontacts[$contact_id]))
|
||||
{
|
||||
$contact=new Contact($db);
|
||||
$contact->fetch($event->contact->id);
|
||||
$cachecontacts[$event->contact->id]=$contact;
|
||||
$contact->fetch($contact_id);
|
||||
$cachecontacts[$contact_id]=$contact;
|
||||
}
|
||||
else $contact=$cachecontacts[$event->contact->id];
|
||||
else $contact=$cachecontacts[$contact_id];
|
||||
if ($linerelatedto) $linerelatedto.=' ';
|
||||
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1, '', 0);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -1110,7 +1110,27 @@ if ($resql)
|
||||
$bankaccount = $cachebankaccount[$objp->bankid];
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
|
||||
$backgroundcolor = "class='oddeven'";
|
||||
} else {
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) {
|
||||
$color = '#fca955';
|
||||
} else {
|
||||
$color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: ' . $color . ';"';
|
||||
} else {
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
|
||||
$color = '#7fdb86';
|
||||
} else {
|
||||
$color = '#' . $conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
|
||||
}
|
||||
$backgroundcolor = 'style="background-color: ' . $color . ';"';
|
||||
}
|
||||
}
|
||||
print '<tr class="oddeven" '.$backgroundcolor.'>';
|
||||
|
||||
// Ref
|
||||
if (! empty($arrayfields['b.rowid']['checked']))
|
||||
@ -1356,7 +1376,7 @@ if ($resql)
|
||||
// Debit
|
||||
if (! empty($arrayfields['b.debit']['checked']))
|
||||
{
|
||||
print '<td class="right">';
|
||||
print '<td class="nowrap right">';
|
||||
if ($objp->amount < 0)
|
||||
{
|
||||
print price($objp->amount * -1);
|
||||
@ -1370,7 +1390,7 @@ if ($resql)
|
||||
// Credit
|
||||
if (! empty($arrayfields['b.credit']['checked']))
|
||||
{
|
||||
print '<td class="right">';
|
||||
print '<td class="nowrap right">';
|
||||
if ($objp->amount > 0)
|
||||
{
|
||||
print price($objp->amount);
|
||||
|
||||
@ -323,7 +323,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if (! $objp->rappro && ! $bankline->getVentilExportCompta())
|
||||
{
|
||||
print $form->select_comptes($acct->id, 'accountid', 0, '', 0);
|
||||
$form->select_comptes($acct->id, 'accountid', 0, '', 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -4982,7 +4982,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Classify paid
|
||||
if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))
|
||||
if (($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
|
||||
)
|
||||
{
|
||||
|
||||
@ -321,7 +321,7 @@ if (! $resql)
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall && ! $page)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
|
||||
@ -384,6 +384,10 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
|
||||
{
|
||||
// Make substitution in email content
|
||||
if (! empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project))
|
||||
{
|
||||
$objecttmp->fetch_projet();
|
||||
}
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ', array_keys($listofqualifiedobj)) : $objecttmp->id);
|
||||
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref);
|
||||
|
||||
@ -113,8 +113,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
|
||||
$sendtosocid=0; // Thirdparty on object
|
||||
if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe','member','user','expensereport', 'contact')))
|
||||
$sendtosocid=0; // Id of related thirdparty
|
||||
if (method_exists($object, "fetch_thirdparty") && ! in_array($object->element, array('societe', 'member', 'user', 'expensereport', 'contact')))
|
||||
{
|
||||
$result=$object->fetch_thirdparty();
|
||||
if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok
|
||||
@ -124,7 +124,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
elseif ($object->element == 'member' || $object->element == 'user')
|
||||
{
|
||||
$thirdparty=$object;
|
||||
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
|
||||
if ($object->socid > 0) $sendtosocid=$object->socid;
|
||||
}
|
||||
elseif ($object->element == 'expensereport')
|
||||
{
|
||||
$tmpuser=new User($db);
|
||||
$tmpuser->fetch($object->fk_user_author);
|
||||
$thirdparty=$tmpuser;
|
||||
if ($object->socid > 0) $sendtosocid=$object->socid;
|
||||
}
|
||||
elseif ($object->element == 'societe')
|
||||
{
|
||||
@ -136,7 +143,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$contact=$object;
|
||||
if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id;
|
||||
}
|
||||
else dol_print_error('', 'Use actions_sendmails.in.php for an element/object that is not supported');
|
||||
else dol_print_error('', "Use actions_sendmails.in.php for an element/object '".$object->element."' that is not supported");
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
@ -162,6 +169,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
if ($receiver == '-1') $receiver=array();
|
||||
else $receiver=array($receiver);
|
||||
}
|
||||
|
||||
$tmparray=array();
|
||||
if (trim($_POST['sendto']))
|
||||
{
|
||||
@ -173,22 +181,23 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
foreach($receiver as $key=>$val)
|
||||
{
|
||||
// Recipient was provided from combo list
|
||||
if ($val == 'thirdparty') // Id of third party
|
||||
if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too)
|
||||
{
|
||||
$tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>';
|
||||
$tmparray[] = dol_string_nospecial($thirdparty->getFullName($langs), ' ', array(",")).' <'.$thirdparty->email.'>';
|
||||
}
|
||||
// Recipient was provided from combo list
|
||||
elseif ($val == 'contact') // Id of contact
|
||||
elseif ($val == 'contact') // Key selected means current contact
|
||||
{
|
||||
$tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>';
|
||||
$tmparray[] = dol_string_nospecial($contact->getFullName($langs), ' ', array(",")).' <'.$contact->email.'>';
|
||||
}
|
||||
elseif ($val) // Id du contact
|
||||
elseif ($val) // $val is the Id of a contact
|
||||
{
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
|
||||
$sendtoid[] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT))
|
||||
{
|
||||
$receiveruser=$_POST['receiveruser'];
|
||||
@ -222,16 +231,16 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
foreach($receivercc as $key=>$val)
|
||||
{
|
||||
// Recipient was provided from combo list
|
||||
if ($val == 'thirdparty') // Id of third party
|
||||
if ($val == 'thirdparty') // Key selected means currentthird party (may be usd for current member or current user too)
|
||||
{
|
||||
$tmparray[] = dol_string_nospecial($thirdparty->name, ' ', array(",")).' <'.$thirdparty->email.'>';
|
||||
}
|
||||
// Recipient was provided from combo list
|
||||
elseif ($val == 'contact') // Id of contact
|
||||
elseif ($val == 'contact') // Key selected means current contact
|
||||
{
|
||||
$tmparray[] = dol_string_nospecial($contact->name, ' ', array(",")).' <'.$contact->email.'>';
|
||||
}
|
||||
elseif ($val) // Id du contact
|
||||
elseif ($val) // $val is the Id of a contact
|
||||
{
|
||||
$tmparray[] = $thirdparty->contact_get_property((int) $val, 'email');
|
||||
//$sendtoid[] = $val; TODO Add also id of contact in CC ?
|
||||
@ -414,27 +423,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
// Two hooks are available into method $mailfile->sendfile, so dedicated code is no more required
|
||||
/*
|
||||
if (! empty($conf->dolimail->enabled))
|
||||
{
|
||||
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
|
||||
if ($mid)
|
||||
{
|
||||
// set imap flag answered if it is an answered mail
|
||||
$dolimail=new DoliMail($db);
|
||||
$dolimail->id = $mid;
|
||||
$res=$dolimail->set_prop($user, 'answered',1);
|
||||
}
|
||||
if ($imap==1)
|
||||
{
|
||||
// write mail to IMAP Server
|
||||
$movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile);
|
||||
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
||||
}
|
||||
}*/
|
||||
|
||||
// Initialisation of datas of object to call trigger
|
||||
if (is_object($object))
|
||||
{
|
||||
|
||||
@ -71,14 +71,14 @@ class box_actions extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
$societestatic = new Societe($db);
|
||||
$actionstatic = new ActionComm($db);
|
||||
$societestatic = new Societe($this->db);
|
||||
$actionstatic = new ActionComm($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo", $max));
|
||||
|
||||
@ -99,20 +99,20 @@ class box_actions extends ModeleBoxes
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if (! $user->rights->agenda->allactions->read) $sql.= " AND (a.fk_user_author = ".$user->id . " OR a.fk_user_action = ".$user->id . " OR a.fk_user_done = ".$user->id . ")";
|
||||
$sql.= " ORDER BY a.datec DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog("Box_actions::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$now=dol_now();
|
||||
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$line = 0;
|
||||
while ($line < $num) {
|
||||
$late = '';
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite = $db->jdate($objp->dp);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite = $this->db->jdate($objp->dp);
|
||||
$actionstatic->id = $objp->id;
|
||||
$actionstatic->label = $objp->label;
|
||||
$actionstatic->type_label = $objp->type_label;
|
||||
@ -164,12 +164,12 @@ class box_actions extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoActionsToDo"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -76,7 +76,7 @@ class box_activity extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -103,7 +103,7 @@ class box_activity extends ModeleBoxes
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$propalstatic=new Propal($db);
|
||||
$propalstatic=new Propal($this->db);
|
||||
|
||||
$cachedir = DOL_DATA_ROOT.'/propale/temp';
|
||||
$filename = '/boxactivity-propal'.$fileid;
|
||||
@ -119,27 +119,27 @@ class box_activity extends ModeleBoxes
|
||||
$sql.= " AND p.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " AND p.datep >= '".$db->idate($tmpdate)."'";
|
||||
$sql.= " AND p.datep >= '".$this->db->idate($tmpdate)."'";
|
||||
$sql.= " AND p.date_cloture IS NULL"; // just unclosed
|
||||
$sql.= " GROUP BY p.fk_statut";
|
||||
$sql.= " ORDER BY p.fk_statut DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$j=0;
|
||||
while ($j < $num) {
|
||||
$data[$j]=$db->fetch_object($result);
|
||||
$data[$j]=$this->db->fetch_object($result);
|
||||
$j++;
|
||||
}
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||
dol_filecache($cachedir, $filename, $data);
|
||||
}
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -190,7 +190,7 @@ class box_activity extends ModeleBoxes
|
||||
// list the summary of the orders
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$commandestatic=new Commande($db);
|
||||
$commandestatic=new Commande($this->db);
|
||||
|
||||
$langs->load("orders");
|
||||
|
||||
@ -209,24 +209,24 @@ class box_activity extends ModeleBoxes
|
||||
$sql.= " AND c.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
|
||||
$sql.= " AND c.date_commande >= '".$this->db->idate($tmpdate)."'";
|
||||
$sql.= " GROUP BY c.fk_statut";
|
||||
$sql.= " ORDER BY c.fk_statut DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$j=0;
|
||||
while ($j < $num) {
|
||||
$data[$j]=$db->fetch_object($result);
|
||||
$data[$j]=$this->db->fetch_object($result);
|
||||
$j++;
|
||||
}
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||
dol_filecache($cachedir, $filename, $data);
|
||||
}
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$data = dol_readcachefile($cachedir, $filename);
|
||||
@ -275,7 +275,7 @@ class box_activity extends ModeleBoxes
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$facturestatic=new Facture($db);
|
||||
$facturestatic=new Facture($this->db);
|
||||
|
||||
// part 1
|
||||
$cachedir = DOL_DATA_ROOT.'/facture/temp';
|
||||
@ -293,24 +293,24 @@ class box_activity extends ModeleBoxes
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND f.paye=1";
|
||||
$sql.= " AND f.datef >= '".$this->db->idate($tmpdate)."' AND f.paye=1";
|
||||
$sql.= " GROUP BY f.fk_statut";
|
||||
$sql.= " ORDER BY f.fk_statut DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$j=0;
|
||||
while ($j < $num) {
|
||||
$data[$j]=$db->fetch_object($result);
|
||||
$data[$j]=$this->db->fetch_object($result);
|
||||
$j++;
|
||||
}
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||
dol_filecache($cachedir, $filename, $data);
|
||||
}
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$data = dol_readcachefile($cachedir, $filename);
|
||||
@ -373,24 +373,24 @@ class box_activity extends ModeleBoxes
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " WHERE f.entity IN (".getEntity('invoice').')';
|
||||
$sql.= " AND f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND f.paye=0";
|
||||
$sql.= " AND f.datef >= '".$this->db->idate($tmpdate)."' AND f.paye=0";
|
||||
$sql.= " GROUP BY f.fk_statut";
|
||||
$sql.= " ORDER BY f.fk_statut DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$j=0;
|
||||
while ($j < $num) {
|
||||
$data[$j]=$db->fetch_object($result);
|
||||
$data[$j]=$this->db->fetch_object($result);
|
||||
$j++;
|
||||
}
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||
dol_filecache($cachedir, $filename, $data);
|
||||
}
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$data = dol_readcachefile($cachedir, $filename);
|
||||
|
||||
@ -71,13 +71,13 @@ class box_birthdays extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 20)
|
||||
{
|
||||
global $user, $langs, $db;
|
||||
global $user, $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
$userstatic=new User($db);
|
||||
$userstatic=new User($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleUserBirthdaysOfMonth"));
|
||||
|
||||
@ -89,23 +89,23 @@ class box_birthdays extends ModeleBoxes
|
||||
$sql.= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql.= " AND MONTH(u.birth) = ".date('m');
|
||||
$sql.= " ORDER BY u.birth ASC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$userstatic->id = $objp->rowid;
|
||||
$userstatic->firstname = $objp->firstname;
|
||||
$userstatic->lastname = $objp->lastname;
|
||||
$userstatic->email = $objp->email;
|
||||
$dateb=$db->jdate($objp->birth);
|
||||
$dateb=$this->db->jdate($objp->birth);
|
||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
@ -129,13 +129,13 @@ class box_birthdays extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql)
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,42 +71,42 @@ class box_birthdays_members extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 20)
|
||||
{
|
||||
global $user, $langs, $db;
|
||||
global $user, $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$memberstatic=new Adherent($db);
|
||||
$memberstatic=new Adherent($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleMemberNextBirthdays"));
|
||||
|
||||
if ($user->rights->adherent->lire)
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname";
|
||||
$sql.= ", u.birth";
|
||||
$sql.= ", u.birth";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
||||
$sql.= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND u.statut = 1";
|
||||
$sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')";
|
||||
$sql.= " AND u.statut = 1";
|
||||
$sql.= " AND date_format(u.birth, '%m-%d') >= date_format(curdate(), '%m-%d')";
|
||||
$sql.= " ORDER BY date_format(u.birth, '%m-%d') ASC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$memberstatic->id = $objp->rowid;
|
||||
$memberstatic->firstname = $objp->firstname;
|
||||
$memberstatic->lastname = $objp->lastname;
|
||||
$memberstatic->email = $objp->email;
|
||||
$dateb=$db->jdate($objp->birth);
|
||||
$dateb=$this->db->jdate($objp->birth);
|
||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
@ -130,13 +130,13 @@ class box_birthdays_members extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql)
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ class box_bookmarks extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
@ -92,18 +92,18 @@ class box_bookmarks extends ModeleBoxes
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b";
|
||||
$sql.= " WHERE fk_user = ".$user->id;
|
||||
$sql.= " AND b.entity = ".$conf->entity;
|
||||
$sql.= $db->order("position", "ASC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->order("position", "ASC");
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="left" width="16"',
|
||||
@ -133,12 +133,12 @@ class box_bookmarks extends ModeleBoxes
|
||||
);
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -74,13 +74,13 @@ class box_clients extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$thirdpartystatic=new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers", $max));
|
||||
|
||||
@ -103,20 +103,20 @@ class box_clients extends ModeleBoxes
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = $user->societe_id";
|
||||
$sql.= " ORDER BY s.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
@ -149,13 +149,13 @@ class box_clients extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedCustomers"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql)
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,16 +71,16 @@ class box_commandes extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$commandestatic = new Commande($db);
|
||||
$societestatic = new Societe($db);
|
||||
$userstatic = new User($db);
|
||||
$commandestatic = new Commande($this->db);
|
||||
$societestatic = new Societe($this->db);
|
||||
$userstatic = new User($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders", $max));
|
||||
|
||||
@ -110,18 +110,18 @@ class box_commandes extends ModeleBoxes
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||
else $sql.= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$date=$db->jdate($objp->date_commande);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$date=$this->db->jdate($objp->date_commande);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$commandestatic->id = $objp->rowid;
|
||||
$commandestatic->ref = $objp->ref;
|
||||
$commandestatic->ref_client = $objp->ref_client;
|
||||
@ -174,12 +174,12 @@ class box_commandes extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedOrders"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -77,7 +77,7 @@ class box_comptes extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -97,19 +97,19 @@ class box_comptes extends ModeleBoxes
|
||||
$sql.= " AND clos = 0";
|
||||
//$sql.= " AND courant = 1";
|
||||
$sql.= " ORDER BY label";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
$solde_total = array();
|
||||
|
||||
$account_static = new Account($db);
|
||||
$account_static = new Account($this->db);
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$account_static->id = $objp->rowid;
|
||||
$account_static->ref = $objp->ref;
|
||||
@ -160,12 +160,12 @@ class box_comptes extends ModeleBoxes
|
||||
$line++;
|
||||
}
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -73,7 +73,7 @@ class box_contacts extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
@ -93,21 +93,21 @@ class box_contacts extends ModeleBoxes
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND sp.fk_soc = ".$user->societe_id;
|
||||
$sql.= " ORDER BY sp.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$contactstatic=new Contact($db);
|
||||
$societestatic=new Societe($db);
|
||||
$contactstatic=new Contact($this->db);
|
||||
$societestatic=new Societe($this->db);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
|
||||
$contactstatic->id=$objp->id;
|
||||
$contactstatic->lastname=$objp->lastname;
|
||||
@ -161,12 +161,12 @@ class box_contacts extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedContacts"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -70,7 +70,7 @@ class box_contracts extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -80,11 +80,12 @@ class box_contracts extends ModeleBoxes
|
||||
|
||||
if ($user->rights->contrat->lire)
|
||||
{
|
||||
$contractstatic=new Contrat($db);
|
||||
$thirdpartytmp=new Societe($db);
|
||||
$contractstatic=new Contrat($this->db);
|
||||
$thirdpartytmp=new Societe($this->db);
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
|
||||
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
|
||||
$sql.= ", c.ref_customer, c.ref_supplier";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||
@ -93,12 +94,12 @@ class box_contracts extends ModeleBoxes
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY c.date_contrat DESC, c.ref DESC ";
|
||||
else $sql.= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
@ -107,16 +108,18 @@ class box_contracts extends ModeleBoxes
|
||||
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$dateterm=$db->jdate($objp->fin_validite);
|
||||
$dateclose=$db->jdate($objp->date_cloture);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$dateterm=$this->db->jdate($objp->fin_validite);
|
||||
$dateclose=$this->db->jdate($objp->date_cloture);
|
||||
$late = '';
|
||||
|
||||
$contractstatic->statut=$objp->fk_statut;
|
||||
$contractstatic->id=$objp->rowid;
|
||||
$contractstatic->ref=$objp->ref;
|
||||
$contractstatic->ref_customer = $objp->ref_customer;
|
||||
$contractstatic->ref_supplier = $objp->ref_supplier;
|
||||
$result=$contractstatic->fetch_lines();
|
||||
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
@ -165,12 +168,12 @@ class box_contracts extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedContracts"),
|
||||
);
|
||||
|
||||
$db->free($resql);
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -69,15 +69,15 @@ class box_factures extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$facturestatic = new Facture($db);
|
||||
$societestatic = new Societe($db);
|
||||
$facturestatic = new Facture($this->db);
|
||||
$societestatic = new Societe($this->db);
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
@ -105,22 +105,22 @@ class box_factures extends ModeleBoxes
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
else $sql.= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)';
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite = $db->jdate($objp->datelimite);
|
||||
$date = $db->jdate($objp->df);
|
||||
$datem = $db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite = $this->db->jdate($objp->datelimite);
|
||||
$date = $this->db->jdate($objp->df);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
@ -129,7 +129,7 @@ class box_factures extends ModeleBoxes
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
$facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite);
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
@ -185,12 +185,12 @@ class box_factures extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedInvoices"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -70,15 +70,15 @@ class box_factures_fourn extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
|
||||
$facturestatic = new FactureFournisseur($db);
|
||||
$thirdpartytmp = new Fournisseur($db);
|
||||
$facturestatic = new FactureFournisseur($this->db);
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array(
|
||||
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills", $max)
|
||||
@ -87,7 +87,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql.= " s.code_fournisseur,";
|
||||
$sql.= " s.code_fournisseur, s.email,";
|
||||
$sql.= " s.logo,";
|
||||
$sql.= " f.rowid as facid, f.ref, f.ref_supplier,";
|
||||
$sql.= " f.total_ht,";
|
||||
@ -106,21 +106,21 @@ class box_factures_fourn extends ModeleBoxes
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
else $sql.= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)';
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite=$db->jdate($objp->datelimite);
|
||||
$date=$db->jdate($objp->df);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite=$this->db->jdate($objp->datelimite);
|
||||
$date=$this->db->jdate($objp->df);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
@ -133,6 +133,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->email = $objp->email;
|
||||
$thirdpartytmp->fournisseur = 1;
|
||||
$thirdpartytmp->code_fournisseur = $objp->code_fournisseur;
|
||||
$thirdpartytmp->logo = $objp->logo;
|
||||
@ -173,7 +174,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
'text' => dol_print_date($date, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($db);
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid=$fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
@ -190,12 +191,12 @@ class box_factures_fourn extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoModifiedSupplierBills"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -69,14 +69,14 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$facturestatic=new FactureFournisseur($db);
|
||||
$facturestatic=new FactureFournisseur($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp=new Fournisseur($db);
|
||||
$thirdpartytmp=new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidSupplierBills", $max));
|
||||
|
||||
@ -99,24 +99,24 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY datelimite DESC, f.ref_supplier DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateDue').': %s)';
|
||||
|
||||
$facturestatic = new FactureFournisseur($db);
|
||||
$facturestatic = new FactureFournisseur($this->db);
|
||||
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite=$db->jdate($objp->datelimite);
|
||||
$date=$db->jdate($objp->df);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite=$this->db->jdate($objp->datelimite);
|
||||
$date=$this->db->jdate($objp->df);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
@ -160,7 +160,7 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
'text' => dol_print_date($datelimite, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($db);
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid=$fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
@ -177,12 +177,12 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoUnpaidSupplierBills"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -72,15 +72,15 @@ class box_factures_imp extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$facturestatic = new Facture($db);
|
||||
$societestatic = new Societe($db);
|
||||
$facturestatic = new Facture($this->db);
|
||||
$societestatic = new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $max));
|
||||
|
||||
@ -111,12 +111,12 @@ class box_factures_imp extends ModeleBoxes
|
||||
$sql.= " f.type, f.amount, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
||||
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
$sql.= " ORDER BY datelimite ASC, f.ref ASC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
@ -124,8 +124,8 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite=$db->jdate($objp->datelimite);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datelimite=$this->db->jdate($objp->datelimite);
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
@ -133,7 +133,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
$facturestatic->date_lim_reglement = $this->db->jdate($objp->datelimite);
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
@ -180,14 +180,14 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoUnpaidCustomerBills"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,12 +70,13 @@ class box_ficheinter extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 10)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
$ficheinterstatic=new Fichinter($db);
|
||||
$ficheinterstatic=new Fichinter($this->db);
|
||||
$companystatic = new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastFicheInter", $max));
|
||||
|
||||
@ -85,7 +86,7 @@ class box_ficheinter extends ModeleBoxes
|
||||
$sql.= " f.datec,";
|
||||
$sql.= " f.date_valid as datev,";
|
||||
$sql.= " f.tms as datem,";
|
||||
$sql.= " s.nom as name, s.rowid as socid, s.client";
|
||||
$sql.= " s.nom as name, s.rowid as socid, s.client, s.email as semail";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (! $user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f";
|
||||
@ -94,42 +95,40 @@ class box_ficheinter extends ModeleBoxes
|
||||
if (! $user->rights->societe->client->voir && !$user->societe_id) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY f.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this).'::loadBox', LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
$now=dol_now();
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
|
||||
$ficheinterstatic->statut=$objp->fk_statut;
|
||||
$ficheinterstatic->id=$objp->rowid;
|
||||
$ficheinterstatic->ref=$objp->ref;
|
||||
|
||||
$companystatic->id = $objp->socid;
|
||||
$companystatic->name = $objp->name;
|
||||
$companystatic->email = $objp->semail;
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => '',
|
||||
'text' => $ficheinterstatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="left" width="16"',
|
||||
'logo' => 'company',
|
||||
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => '',
|
||||
'text' => dol_trunc($objp->name, 40),
|
||||
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
|
||||
'text' => $companystatic->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
@ -148,14 +147,14 @@ class box_ficheinter extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$i][] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedInterventions"));
|
||||
|
||||
$db->free($resql);
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,15 +70,15 @@ class box_fournisseurs extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$thirdpartystatic=new Societe($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp=new Fournisseur($db);
|
||||
$thirdpartytmp=new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers", $max));
|
||||
|
||||
@ -94,19 +94,19 @@ class box_fournisseurs extends ModeleBoxes
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY s.tms DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->code_client = $objp->code_client;
|
||||
@ -136,12 +136,12 @@ class box_fournisseurs extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedSuppliers"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -76,13 +76,13 @@ class box_goodcustomers extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$thirdpartystatic=new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleGoodCustomers", $max));
|
||||
|
||||
@ -90,25 +90,25 @@ class box_goodcustomers extends ModeleBoxes
|
||||
{
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.logo, s.code_client, s.code_fournisseur, s.client, s.fournisseur, s.tms as datem, s.status as status,";
|
||||
$sql.= " count(*) as nbfact, sum(". $db->ifsql('f.paye=1', '1', '0').") as nbfactpaye";
|
||||
$sql.= " count(*) as nbfact, sum(". $this->db->ifsql('f.paye=1', '1', '0').") as nbfactpaye";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('societe').')';
|
||||
$sql.= ' AND s.rowid = f.fk_soc';
|
||||
$sql.= " GROUP BY s.rowid, s.nom, s.logo, s.code_client, s.code_fournisseur, s.client, s.fournisseur, s.tms, s.status";
|
||||
$sql.= $db->order("nbfact", "DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->order("nbfact", "DESC");
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$thirdpartystatic->id = $objp->rowid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
@ -145,13 +145,13 @@ class box_goodcustomers extends ModeleBoxes
|
||||
|
||||
if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedCustomers"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,14 +65,14 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$refreshaction='refresh_'.$this->boxcode;
|
||||
|
||||
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
//$facturestatic=new Facture($db);
|
||||
//$facturestatic=new Facture($this->db);
|
||||
|
||||
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
|
||||
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
|
||||
|
||||
@ -65,7 +65,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
|
||||
@ -65,14 +65,14 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$refreshaction='refresh_'.$this->boxcode;
|
||||
|
||||
//include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
//$commandestatic=new Commande($db);
|
||||
//$commandestatic=new Commande($this->db);
|
||||
|
||||
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
|
||||
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
|
||||
|
||||
@ -65,7 +65,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
|
||||
@ -65,14 +65,14 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$refreshaction='refresh_'.$this->boxcode;
|
||||
|
||||
//include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
//$propalstatic=new Propal($db);
|
||||
//$propalstatic=new Propal($this->db);
|
||||
|
||||
$startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
|
||||
if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
|
||||
|
||||
@ -47,11 +47,14 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
$langs->load("boxes");
|
||||
$this->db = $db;
|
||||
|
||||
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedTicket");
|
||||
}
|
||||
@ -64,7 +67,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
@ -72,8 +75,8 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
|
||||
$text = $langs->trans("BoxLastModifiedTicketDescription", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit' => dol_strlen($text)
|
||||
'text' => $text,
|
||||
'limit' => dol_strlen($text)
|
||||
);
|
||||
|
||||
$this->info_box_contents[0][0] = array(
|
||||
@ -99,20 +102,20 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
}
|
||||
|
||||
$sql.= " ORDER BY t.tms DESC, t.rowid DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
$now=gmmktime();
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$dateterm=$db->jdate($objp->fin_validite);
|
||||
$dateclose=$db->jdate($objp->date_cloture);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$dateterm=$this->db->jdate($objp->fin_validite);
|
||||
$dateclose=$this->db->jdate($objp->date_cloture);
|
||||
$late = '';
|
||||
|
||||
$ticket = new Ticket($this->db);
|
||||
@ -157,7 +160,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
// Date creation
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($db->idate($objp->datec), 'dayhour')
|
||||
'text' => dol_print_date($this->db->idate($objp->datec), 'dayhour')
|
||||
);
|
||||
$r++;
|
||||
|
||||
@ -177,7 +180,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
$this->info_box_contents[$i][0] = array('td' => 'class="center"','text'=>$langs->trans("BoxLastModifiedTicketNoRecordedTickets"));
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
|
||||
@ -46,11 +46,14 @@ class box_last_ticket extends ModeleBoxes
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
$this->db = $db;
|
||||
|
||||
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastTicket");
|
||||
}
|
||||
@ -63,7 +66,7 @@ class box_last_ticket extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
@ -100,20 +103,20 @@ class box_last_ticket extends ModeleBoxes
|
||||
//$sql.= " AND t.fk_statut > 9";
|
||||
|
||||
$sql .= " ORDER BY t.datec DESC, t.rowid DESC ";
|
||||
$sql .= $db->plimit($max, 0);
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
$now = gmmktime();
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$datec = $db->jdate($objp->datec);
|
||||
$dateterm = $db->jdate($objp->fin_validite);
|
||||
$dateclose = $db->jdate($objp->date_cloture);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$dateterm = $this->db->jdate($objp->fin_validite);
|
||||
$dateclose = $this->db->jdate($objp->date_cloture);
|
||||
$late = '';
|
||||
|
||||
$ticket = new Ticket($this->db);
|
||||
@ -156,7 +159,7 @@ class box_last_ticket extends ModeleBoxes
|
||||
// Date creation
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => dol_print_date($db->idate($objp->datec), 'dayhour'),
|
||||
'text' => dol_print_date($this->db->idate($objp->datec), 'dayhour'),
|
||||
);
|
||||
$r++;
|
||||
|
||||
@ -176,7 +179,7 @@ class box_last_ticket extends ModeleBoxes
|
||||
$this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text' => $langs->trans("BoxLastTicketNoRecordedTickets"));
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array('td' => 'class="left"',
|
||||
|
||||
@ -68,7 +68,7 @@ class box_lastlogin extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$textHead = $langs->trans("BoxLoginInformation");
|
||||
$this->info_box_head = array(
|
||||
|
||||
@ -76,13 +76,13 @@ class box_members extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$memberstatic=new Adherent($db);
|
||||
$memberstatic=new Adherent($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max));
|
||||
|
||||
@ -95,19 +95,19 @@ class box_members extends ModeleBoxes
|
||||
$sql.= " WHERE a.entity IN (".getEntity('member').")";
|
||||
$sql.= " AND a.fk_adherent_type = t.rowid";
|
||||
$sql.= " ORDER BY a.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
|
||||
$memberstatic->lastname=$objp->lastname;
|
||||
$memberstatic->firstname=$objp->firstname;
|
||||
@ -142,7 +142,7 @@ class box_members extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $memberstatic->LibStatut($objp->status, $objp->subscription, $db->jdate($objp->date_end_subscription), 3),
|
||||
'text' => $memberstatic->LibStatut($objp->status, $objp->subscription, $this->db->jdate($objp->date_end_subscription), 3),
|
||||
);
|
||||
|
||||
$line++;
|
||||
@ -154,12 +154,12 @@ class box_members extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedCustomers"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -75,12 +75,12 @@ class box_produits extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf, $hookmanager;
|
||||
global $user, $langs, $conf, $hookmanager;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$productstatic=new Product($db);
|
||||
$productstatic=new Product($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastProducts", $max));
|
||||
|
||||
@ -98,18 +98,18 @@ class box_produits extends ModeleBoxes
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
}
|
||||
$sql.= $db->order('p.datec', 'DESC');
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->order('p.datec', 'DESC');
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
|
||||
// Multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
|
||||
@ -120,10 +120,10 @@ class box_produits extends ModeleBoxes
|
||||
$sqld.= " AND lang='". $langs->getDefaultLang() ."'";
|
||||
$sqld.= " LIMIT 1";
|
||||
|
||||
$resultd = $db->query($sqld);
|
||||
$resultd = $this->db->query($sqld);
|
||||
if ($resultd)
|
||||
{
|
||||
$objtp = $db->fetch_object($resultd);
|
||||
$objtp = $this->db->fetch_object($resultd);
|
||||
if (isset($objtp->label) && $objtp->label != '')
|
||||
$objp->label = $objtp->label;
|
||||
}
|
||||
@ -202,12 +202,12 @@ class box_produits extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedProducts"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -77,19 +77,19 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf, $hookmanager;
|
||||
global $user, $langs, $conf, $hookmanager;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
$productstatic=new Product($db);
|
||||
$productstatic=new Product($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleProductsAlertStock", $max));
|
||||
|
||||
if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,";
|
||||
$sql.= " SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").") as total_stock";
|
||||
$sql.= " SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") as total_stock";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
|
||||
@ -104,19 +104,19 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$sql.=$hookmanager->resPrint;
|
||||
}
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity";
|
||||
$sql.= " HAVING SUM(".$db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte";
|
||||
$sql.= $db->order('p.seuil_stock_alerte', 'DESC');
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= " HAVING SUM(".$this->db->ifsql("s.reel IS NULL", "0", "s.reel").") < p.seuil_stock_alerte";
|
||||
$sql.= $this->db->order('p.seuil_stock_alerte', 'DESC');
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$line = 0;
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$price = '';
|
||||
$price_base_type = '';
|
||||
|
||||
@ -129,10 +129,10 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$sqld.= " AND lang='". $langs->getDefaultLang() ."'";
|
||||
$sqld.= " LIMIT 1";
|
||||
|
||||
$resultd = $db->query($sqld);
|
||||
$resultd = $this->db->query($sqld);
|
||||
if ($resultd)
|
||||
{
|
||||
$objtp = $db->fetch_object($resultd);
|
||||
$objtp = $this->db->fetch_object($resultd);
|
||||
if (isset($objtp->label) && $objtp->label != '')
|
||||
$objp->label = $objtp->label;
|
||||
}
|
||||
@ -214,14 +214,14 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoTooLowStockProducts"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ class box_project extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -102,15 +102,15 @@ class box_project extends ModeleBoxes
|
||||
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
|
||||
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
//$sql.= $db->plimit($max, 0);
|
||||
//$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$i = 0;
|
||||
while ($i < min($num, $max)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$projectstatic->id = $objp->rowid;
|
||||
$projectstatic->ref = $objp->ref;
|
||||
@ -132,9 +132,9 @@ class box_project extends ModeleBoxes
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project').')';
|
||||
$sql.=" AND p.rowid = ".$objp->rowid;
|
||||
$resultTask = $db->query($sql);
|
||||
$resultTask = $this->db->query($sql);
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
$objTask = $this->db->fetch_object($resultTask);
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => $objTask->nb." ".$langs->trans("Tasks"),
|
||||
|
||||
@ -71,14 +71,14 @@ class box_propales extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$propalstatic=new Propal($db);
|
||||
$societestatic = new Societe($db);
|
||||
$propalstatic=new Propal($this->db);
|
||||
$societestatic = new Societe($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."Propals", $max));
|
||||
|
||||
@ -95,23 +95,23 @@ class box_propales extends ModeleBoxes
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY p.datep DESC, p.ref DESC ";
|
||||
else $sql.= " ORDER BY p.tms DESC, p.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$line = 0;
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$date=$db->jdate($objp->dp);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$dateterm=$db->jdate($objp->fin_validite);
|
||||
$dateclose=$db->jdate($objp->date_cloture);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$date=$this->db->jdate($objp->dp);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$dateterm=$this->db->jdate($objp->fin_validite);
|
||||
$dateclose=$this->db->jdate($objp->date_cloture);
|
||||
$propalstatic->id = $objp->rowid;
|
||||
$propalstatic->ref = $objp->ref;
|
||||
$propalstatic->total_ht = $objp->total_ht;
|
||||
@ -164,12 +164,12 @@ class box_propales extends ModeleBoxes
|
||||
'text'=>$langs->trans("NoRecordedProposals"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -76,11 +76,11 @@ class box_prospect extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$thirdpartystatic=new Client($db);
|
||||
$thirdpartystatic=new Client($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedProspects", $max));
|
||||
|
||||
@ -100,20 +100,20 @@ class box_prospect extends ModeleBoxes
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY s.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec=$this->db->jdate($objp->datec);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->code_client = $objp->code_client;
|
||||
@ -153,12 +153,12 @@ class box_prospect extends ModeleBoxes
|
||||
);
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
$this->db->free($resql);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength' => 500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -71,22 +71,22 @@ class box_services_contracts extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxLastProductsInContract", $max));
|
||||
|
||||
if ($user->rights->service->lire && $user->rights->contrat->lire)
|
||||
{
|
||||
$contractstatic=new Contrat($db);
|
||||
$contractlinestatic=new ContratLigne($db);
|
||||
$thirdpartytmp = new Societe($db);
|
||||
$productstatic = new Product($db);
|
||||
$contractstatic=new Contrat($this->db);
|
||||
$contractlinestatic=new ContratLigne($this->db);
|
||||
$thirdpartytmp = new Societe($this->db);
|
||||
$productstatic = new Product($this->db);
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql.= " c.rowid, c.ref, c.statut as contract_status, c.ref_customer, c.ref_supplier,";
|
||||
@ -100,21 +100,21 @@ class box_services_contracts extends ModeleBoxes
|
||||
$sql.= ")";
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= $db->order("c.tms", "DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->order("c.tms", "DESC");
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
$now=dol_now();
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$db->jdate($objp->datem);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem=$this->db->jdate($objp->datem);
|
||||
|
||||
$contractlinestatic->id=$objp->cdid;
|
||||
$contractlinestatic->fk_contrat=$objp->rowid;
|
||||
@ -149,10 +149,10 @@ class box_services_contracts extends ModeleBoxes
|
||||
$sqld.= " AND lang='". $langs->getDefaultLang() ."'";
|
||||
$sqld.= " LIMIT 1";
|
||||
|
||||
$resultd = $db->query($sqld);
|
||||
$resultd = $this->db->query($sqld);
|
||||
if ($resultd)
|
||||
{
|
||||
$objtp = $db->fetch_object($resultd);
|
||||
$objtp = $this->db->fetch_object($resultd);
|
||||
if ($objtp->label != '') $contractlinestatic->label = $objtp->label;
|
||||
}
|
||||
}
|
||||
@ -222,14 +222,14 @@ class box_services_contracts extends ModeleBoxes
|
||||
}
|
||||
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'class="center"','text'=>$langs->trans("NoContractedProducts"));
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength' => 500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ class box_services_expired extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -88,19 +88,19 @@ class box_services_expired extends ModeleBoxes
|
||||
$sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$db->idate($now)."'";
|
||||
$sql.= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$this->db->idate($now)."'";
|
||||
$sql.= " AND c.entity = ".$conf->entity;
|
||||
$sql.= " AND c.fk_soc=s.rowid AND cd.fk_contrat=c.rowid AND c.statut > 0";
|
||||
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
|
||||
$sql.= " ORDER BY date_line ASC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -111,7 +111,7 @@ class box_services_expired extends ModeleBoxes
|
||||
{
|
||||
$late='';
|
||||
|
||||
$objp = $db->fetch_object($resql);
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
|
||||
$thirdpartytmp->name = $objp->name;
|
||||
$thirdpartytmp->id = $objp->socid;
|
||||
@ -129,7 +129,7 @@ class box_services_expired extends ModeleBoxes
|
||||
$contract->ref_customer = $objp->ref_customer;
|
||||
$contract->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
$dateline=$db->jdate($objp->date_line);
|
||||
$dateline=$this->db->jdate($objp->date_line);
|
||||
if (($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late=img_warning($langs->trans("Late"));
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
@ -168,14 +168,14 @@ class box_services_expired extends ModeleBoxes
|
||||
);
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,15 +69,15 @@ class box_supplier_orders extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$supplierorderstatic=new CommandeFournisseur($db);
|
||||
$supplierorderstatic=new CommandeFournisseur($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
$thirdpartytmp = new Fournisseur($db);
|
||||
$thirdpartytmp = new Fournisseur($this->db);
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierOrders", $max));
|
||||
|
||||
@ -100,18 +100,18 @@ class box_supplier_orders extends ModeleBoxes
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||
else $sql.= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$date=$db->jdate($objp->date_commande);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$date=$this->db->jdate($objp->date_commande);
|
||||
$datem=$this->db->jdate($objp->tms);
|
||||
|
||||
$supplierorderstatic->id = $objp->rowid;
|
||||
$supplierorderstatic->ref = $objp->ref;
|
||||
@ -158,12 +158,12 @@ class box_supplier_orders extends ModeleBoxes
|
||||
'text' => $langs->trans("NoSupplierOrder"),
|
||||
);
|
||||
|
||||
$db->free($result);
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'text' => ($db->error().' sql='.$sql),
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,15 +75,15 @@ class box_task extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$this->max=$max;
|
||||
include_once DOL_DOCUMENT_ROOT."/projet/class/task.class.php";
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/project.lib.php";
|
||||
$projectstatic = new Project($this->db);
|
||||
$taskstatic=new Task($db);
|
||||
$form= new Form($db);
|
||||
$taskstatic=new Task($this->db);
|
||||
$form= new Form($this->db);
|
||||
$cookie_name='boxfilter_task';
|
||||
$boxcontent='';
|
||||
|
||||
@ -160,13 +160,13 @@ class box_task extends ModeleBoxes
|
||||
|
||||
|
||||
$sql.= " ORDER BY pt.datee ASC, pt.dateo ASC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
$sql.= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
$result = $this->db->query($sql);
|
||||
$i = 0;
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
while ($objp = $db->fetch_object($result)) {
|
||||
$num = $this->db->num_rows($result);
|
||||
while ($objp = $this->db->fetch_object($result)) {
|
||||
|
||||
$taskstatic->id=$objp->rowid;
|
||||
$taskstatic->ref=$objp->ref;
|
||||
|
||||
@ -7631,18 +7631,20 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
// Delete cascade first
|
||||
foreach($this->childtablesoncascade as $table)
|
||||
{
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->errors[]=$this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (! empty($this->childtablesoncascade)) {
|
||||
foreach($this->childtablesoncascade as $table)
|
||||
{
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->errors[]=$this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
if (! $notrigger) {
|
||||
@ -7816,4 +7818,35 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* copy related categories to another object
|
||||
*
|
||||
* @param int $fromId Id object source
|
||||
* @param int $toId Id object cible
|
||||
* @param string $type Type of category ('product', ...)
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
public function cloneCategories($fromId, $toId, $type = '')
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
if (empty($type)) $type = $this->table_element;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$categorystatic = new Categorie($this->db);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type] . " (fk_categorie, fk_product)";
|
||||
$sql.= " SELECT fk_categorie, $toId FROM ".MAIN_DB_PREFIX."categorie_" . $categorystatic->MAP_CAT_TABLE[$type];
|
||||
$sql.= " WHERE fk_product = '".$fromId."'";
|
||||
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
$this->db->rollback();die($sql);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,33 +87,9 @@ class Events // extends CommonObject
|
||||
array('id'=>'USER_NEW_PASSWORD', 'test'=>1),
|
||||
array('id'=>'USER_ENABLEDISABLE', 'test'=>1),
|
||||
array('id'=>'USER_DELETE', 'test'=>1),
|
||||
/* array('id'=>'USER_SETINGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY
|
||||
array('id'=>'USER_REMOVEFROMGROUP', 'test'=>1), deprecated. Replace with USER_MODIFY */
|
||||
array('id'=>'GROUP_CREATE', 'test'=>1),
|
||||
array('id'=>'GROUP_MODIFY', 'test'=>1),
|
||||
array('id'=>'GROUP_DELETE', 'test'=>1),
|
||||
/* array('id'=>'ACTION_CREATE', 'test'=>$conf->societe->enabled),
|
||||
array('id'=>'COMPANY_CREATE', 'test'=>$conf->societe->enabled),
|
||||
array('id'=>'CONTRACT_VALIDATE', 'test'=>$conf->contrat->enabled),
|
||||
array('id'=>'PROPAL_VALIDATE', 'test'=>$conf->propal->enabled),
|
||||
array('id'=>'PROPAL_CLOSE_SIGNED', 'test'=>$conf->propal->enabled),
|
||||
array('id'=>'PROPAL_CLOSE_REFUSED', 'test'=>$conf->propal->enabled),
|
||||
array('id'=>'PROPAL_SENTBYMAIL', 'test'=>$conf->propal->enabled),
|
||||
array('id'=>'ORDER_VALIDATE', 'test'=>$conf->commande->enabled),
|
||||
array('id'=>'ORDER_SENTBYMAIL', 'test'=>$conf->commande->enabled),
|
||||
array('id'=>'BILL_VALIDATE', 'test'=>$conf->facture->enabled),
|
||||
array('id'=>'BILL_PAYED', 'test'=>$conf->facture->enabled),
|
||||
array('id'=>'BILL_CANCEL', 'test'=>$conf->facture->enabled),
|
||||
array('id'=>'BILL_SENTBYMAIL', 'test'=>$conf->facture->enabled),
|
||||
array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled),
|
||||
array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled),
|
||||
array('id'=>'MEMBER_CREATE', 'test'=>$conf->adherent->enabled),
|
||||
array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled),
|
||||
array('id'=>'MEMBER_SUBSCRIPTION', 'test'=>$conf->adherent->enabled),
|
||||
array('id'=>'MEMBER_MODIFY', 'test'=>$conf->adherent->enabled),
|
||||
array('id'=>'MEMBER_RESILIATE', 'test'=>$conf->adherent->enabled),
|
||||
array('id'=>'MEMBER_DELETE', 'test'=>$conf->adherent->enabled),
|
||||
*/
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -959,9 +959,10 @@ class ExtraFields
|
||||
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
|
||||
* @param int $objectid Current object id
|
||||
* @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data
|
||||
* @param string $mode 1=Used for search filters
|
||||
* @return string
|
||||
*/
|
||||
public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '')
|
||||
public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '', $mode = 0)
|
||||
{
|
||||
global $conf,$langs,$form;
|
||||
|
||||
@ -1116,13 +1117,20 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'boolean')
|
||||
{
|
||||
$checked='';
|
||||
if (!empty($value)) {
|
||||
$checked=' checked value="1" ';
|
||||
} else {
|
||||
$checked=' value="1" ';
|
||||
if (empty($mode))
|
||||
{
|
||||
$checked='';
|
||||
if (!empty($value)) {
|
||||
$checked=' checked value="1" ';
|
||||
} else {
|
||||
$checked=' value="1" ';
|
||||
}
|
||||
$out='<input type="checkbox" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$out.=$form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
|
||||
}
|
||||
$out='<input type="checkbox" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam?$moreparam:'').'>';
|
||||
}
|
||||
elseif ($type == 'price')
|
||||
{
|
||||
|
||||
@ -88,11 +88,12 @@ class Translate
|
||||
|
||||
if (empty($srclang) || $srclang == 'auto')
|
||||
{
|
||||
// $_SERVER['HTTP_ACCEPT_LANGUAGE'] can be 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7,it;q=0.6' but can contains also malicious content
|
||||
$langpref=empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])?'':$_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
||||
$langpref=preg_replace("/;([^,]*)/i", "", $langpref);
|
||||
$langpref=preg_replace("/;([^,]*)/i", "", $langpref); // Remove the 'q=x.y,' part
|
||||
$langpref=str_replace("-", "_", $langpref);
|
||||
$langlist=preg_split("/[;,]/", $langpref);
|
||||
$codetouse=$langlist[0];
|
||||
$codetouse=preg_replace('/[^_a-zA-Z]/', '', $langlist[0]);
|
||||
}
|
||||
else $codetouse=$srclang;
|
||||
|
||||
|
||||
@ -323,6 +323,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date)
|
||||
* 0 =Input date is local date using PHP server timezone
|
||||
* @return int Date as a timestamp
|
||||
* 19700101020000 -> 7200 with gm=1
|
||||
* 19700101000000 -> 0 with gm=1
|
||||
*
|
||||
* @see dol_print_date(), dol_mktime(), dol_getdate()
|
||||
*/
|
||||
|
||||
@ -4499,7 +4499,9 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
* 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
|
||||
* Numeric = Nb of digits for rounding
|
||||
* @param int $alreadysqlnb Put 1 if you know that content is already universal format number
|
||||
* @return string Amount with universal numeric format (Example: '99.99999') or unchanged text if conversion fails. If amount is null or '', it returns ''.
|
||||
* @return string Amount with universal numeric format (Example: '99.99999').
|
||||
* If conversion fails, it return text unchanged if $rounding = '' or '0' if $rounding is defined.
|
||||
* If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined..
|
||||
*
|
||||
* @see price() Opposite function of price2num
|
||||
*/
|
||||
@ -5921,11 +5923,13 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray['__REF_SUPPLIER__'] = '__REF_SUPPLIER__';
|
||||
$substitutionarray['__EXTRAFIELD_XXX__'] = '__EXTRAFIELD_XXX__';
|
||||
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
|
||||
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
|
||||
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = '__THIRDPARTY_NAME_ALIAS__';
|
||||
$substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__';
|
||||
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
|
||||
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
|
||||
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = '__THIRDPARTY_NAME_ALIAS__';
|
||||
$substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__';
|
||||
}
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
|
||||
@ -5933,15 +5937,19 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
|
||||
$substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__';
|
||||
}
|
||||
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
||||
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
||||
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
|
||||
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
||||
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
||||
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
|
||||
}
|
||||
if (! empty($conf->contrat->enabled))
|
||||
{
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service';
|
||||
}
|
||||
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable';
|
||||
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable';
|
||||
$substitutionarray['__SECUREKEYPAYMENT__'] = 'Security key (if key is not unique per record)';
|
||||
@ -6019,7 +6027,13 @@ $substitutionarray=array_merge($substitutionarray, array(
|
||||
$substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:'');
|
||||
}
|
||||
|
||||
if (is_object($object->projet) && $object->projet->id > 0)
|
||||
if (is_object($object->project) && $object->project->id > 0)
|
||||
{
|
||||
$substitutionarray['__PROJECT_ID__'] = (is_object($object->project)?$object->project->id:'');
|
||||
$substitutionarray['__PROJECT_REF__'] = (is_object($object->project)?$object->project->ref:'');
|
||||
$substitutionarray['__PROJECT_NAME__'] = (is_object($object->project)?$object->project->title:'');
|
||||
}
|
||||
if (is_object($object->projet) && $object->projet->id > 0) // Deprecated, for backward compatibility
|
||||
{
|
||||
$substitutionarray['__PROJECT_ID__'] = (is_object($object->projet)?$object->projet->id:'');
|
||||
$substitutionarray['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
@ -7291,7 +7305,7 @@ function printCommonFooter($zone = 'private')
|
||||
{
|
||||
print "\n";
|
||||
print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n";
|
||||
print 'jQuery(".menuhider").click(function(event) {';
|
||||
print 'jQuery("li.menuhider").click(function(event) {';
|
||||
print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n";
|
||||
print ' console.log("We click on .menuhider");'."\n";
|
||||
print ' $("body").toggleClass("sidebar-collapse")'."\n";
|
||||
|
||||
@ -86,6 +86,11 @@ function holiday_admin_prepare_head()
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'holiday_admin');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/holiday_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'holiday_admin', 'remove');
|
||||
|
||||
return $head;
|
||||
|
||||
@ -271,14 +271,19 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
||||
// Show logo company
|
||||
if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
|
||||
$mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
|
||||
if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
|
||||
}
|
||||
elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
|
||||
}
|
||||
else
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
|
||||
}
|
||||
$title=$langs->trans("GoIntoSetupToChangeLogo");
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
|
||||
@ -43,7 +43,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
*/
|
||||
function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '')
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name;
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
global $dolibarr_main_db_name;
|
||||
|
||||
$mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]);
|
||||
$leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]);
|
||||
@ -55,22 +56,23 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
|
||||
$usemenuhider = 1;
|
||||
|
||||
// Show/Hide vertical menu
|
||||
// Show/Hide vertical menu. The hamburger icon for .menuhider action.
|
||||
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$showmode=1;
|
||||
$classname = 'class="tmenu menuhider"';
|
||||
$idsel='menu';
|
||||
|
||||
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
|
||||
$menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '<span class="fa fa-bars"></span>' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
|
||||
}
|
||||
|
||||
$menu_arr = array();
|
||||
|
||||
// Home
|
||||
$menu_arr[] = array(
|
||||
'name' => 'Home',
|
||||
'link' => '/index.php?mainmenu=home&leftmenu=home',
|
||||
'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)? ' <span class="fa fa-home"></span> ' : "Home") ,
|
||||
'title' => (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '<span class="fa fa-home"></span>' : "Home") ,
|
||||
'level' => 0,
|
||||
'enabled' => $showmode = 1,
|
||||
'target' => $atarget,
|
||||
@ -473,8 +475,35 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
$menu->liste = dol_sort_array($menu->liste, 'position');
|
||||
|
||||
// Output menu entries
|
||||
// Show logo company
|
||||
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
|
||||
$mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
|
||||
if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
|
||||
}
|
||||
elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
|
||||
}
|
||||
else
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
|
||||
}
|
||||
$title=$langs->trans("GoIntoSetupToChangeLogo");
|
||||
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1);
|
||||
|
||||
print '<div class="center backgroundforcompanylogo"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
|
||||
|
||||
print_end_menu_entry(4);
|
||||
}
|
||||
|
||||
if (empty($noout)) {
|
||||
foreach($menu->liste as $menkey => $menuval) {
|
||||
foreach($menu->liste as $menuval) {
|
||||
print_start_menu_entry($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
|
||||
print_text_menu_entry($menuval['titre'], $menuval['enabled'], (($menuval['url']!='#' && !preg_match('/^(http:\/\/|https:\/\/)/i', $menuval['url'])) ? DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
|
||||
print_end_menu_entry($menuval['enabled']);
|
||||
@ -615,30 +644,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
|
||||
$usemenuhider = 0;
|
||||
|
||||
// Show logo company
|
||||
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
|
||||
}
|
||||
else
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
}
|
||||
$title=$langs->trans("GoIntoSetupToChangeLogo");
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair blockvmenulogo">'."\n";
|
||||
print '<div class="menu_titre" id="menu_titre_logo"></div>';
|
||||
print '<div class="menu_top" id="menu_top_logo"></div>';
|
||||
print '<div class="menu_contenu" id="menu_contenu_logo">';
|
||||
print '<div class="center"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n";
|
||||
print '</div>';
|
||||
print '<div class="menu_end" id="menu_end_logo"></div>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page
|
||||
{
|
||||
print "\n";
|
||||
|
||||
@ -38,7 +38,7 @@ class modExpenseReport extends DolibarrModules
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $user; // Required by some include code
|
||||
|
||||
$this->db = $db;
|
||||
$this->numero = 770;
|
||||
@ -200,8 +200,13 @@ class modExpenseReport extends DolibarrModules
|
||||
$this->export_alias_array[$r]=array('d.rowid'=>"idtrip",'d.type'=>"type",'d.note_private'=>'note_private','d.note_public'=>'note_public','u.lastname'=>'name','u.firstname'=>'firstname','u.login'=>'login');
|
||||
$this->export_dependencies_array[$r]=array('expensereport_line'=>'ed.rowid','type_fees'=>'tf.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
|
||||
$keyforselect='expensereport'; $keyforelement='expensereport'; $keyforaliasextra='extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expensereport as d, '.MAIN_DB_PREFIX.'user as u,';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expensereport as d';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'expensereport_extrafields as extra on d.rowid = extra.fk_object';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'user as u,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expensereport_det as ed LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as tf ON ed.fk_c_type_fees = tf.id';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON ed.fk_projet = p.rowid';
|
||||
$this->export_sql_end[$r] .=' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid';
|
||||
|
||||
@ -202,13 +202,13 @@ class modHoliday extends DolibarrModules
|
||||
$this->export_permission[$r]=array(array("holiday","read_all"));
|
||||
$this->export_fields_array[$r]=array(
|
||||
'd.rowid'=>"LeaveId",'d.fk_type'=>'TypeOfLeaveId','t.code'=>'TypeOfLeaveCode','t.label'=>'TypeOfLeaveLabel','d.fk_user'=>'UserID',
|
||||
'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay',
|
||||
'u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>"Login",'d.date_debut'=>'DateStart','d.date_fin'=>'DateEnd','d.halfday'=>'HalfDay','none.num_open_days'=>'NbUseDaysCP',
|
||||
'd.date_valid'=>'DateApprove','d.fk_validator'=>"UserForApprovalID",'ua.lastname'=>"UserForApprovalLastname",'ua.firstname'=>"UserForApprovalFirstname",
|
||||
'ua.login'=>"UserForApprovalLogin",'d.description'=>'Description','d.statut'=>'Status'
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array(
|
||||
'd.rowid'=>"Numeric",'t.code'=>'Text', 't.label'=>'Text','d.fk_user'=>'Numeric',
|
||||
'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date',
|
||||
'u.lastname'=>'Text','u.firstname'=>'Text','u.login'=>"Text",'d.date_debut'=>'Date','d.date_fin'=>'Date','none.num_open_days'=>'NumericCompute',
|
||||
'd.date_valid'=>'Date','d.fk_validator'=>"Numeric",'ua.lastname'=>"Text",'ua.firstname'=>"Text",
|
||||
'ua.login'=>"Text",'d.description'=>'Text','d.statut'=>'Numeric'
|
||||
);
|
||||
@ -216,10 +216,15 @@ class modHoliday extends DolibarrModules
|
||||
'u.lastname'=>'user','u.firstname'=>'user','u.login'=>'user','ua.lastname'=>'user','ua.firstname'=>'user','ua.login'=>'user'
|
||||
);
|
||||
$this->export_alias_array[$r]=array('d.rowid'=>"idholiday");
|
||||
$this->export_special_array[$r] = array('none.num_open_days'=>'getNumOpenDays');
|
||||
$this->export_dependencies_array[$r]=array(); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
|
||||
$keyforselect='holiday'; $keyforelement='holiday'; $keyforaliasextra='extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'holiday as d';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'holiday_extrafields as extra on d.rowid = extra.fk_object';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_holiday_types as t ON t.rowid = d.fk_type';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua ON ua.rowid = d.fk_validator,';
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'user as u';
|
||||
|
||||
@ -316,17 +316,21 @@ class modStock extends DolibarrModules
|
||||
$this->import_fields_array[$r]=array('e.ref'=>"LocationSummary*",
|
||||
'e.description'=>"DescWareHouse",'e.lieu'=>"LieuWareHouse",
|
||||
'e.address'=>"Address",'e.zip'=>'Zip','e.fk_pays'=>'CountryCode',
|
||||
'e.statut'=>'Status'
|
||||
'e.statut'=>'Status',
|
||||
'e.fk_parent'=>'ParentWarehouse'
|
||||
);
|
||||
|
||||
$this->import_convertvalue_array[$r]=array(
|
||||
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry')
|
||||
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
|
||||
'e.fk_parent'=>array('rule'=>'fetchidfromref','classfile'=>'/product/stock/class/entrepot.class.php','class'=>'Entrepot','method'=>'fetch','element'=>'ref')
|
||||
);
|
||||
$this->import_regex_array[$r]=array('e.statut'=>'^[0|1]');
|
||||
$this->import_examplevalues_array[$r]=array('e.ref'=>"ALM001",
|
||||
'e.description'=>"Central Warehouse",'e.lieu'=>"Central",
|
||||
'e.address'=>"Route 66",'e.zip'=>'28080','e.fk_pays'=>'US',
|
||||
'e.statut'=>'1');
|
||||
'e.statut'=>'1',
|
||||
'e.fk_parent'=>''
|
||||
);
|
||||
|
||||
// Import stocks
|
||||
$r++;
|
||||
|
||||
@ -22,28 +22,28 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
|
||||
if (! empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) {
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key];
|
||||
|
||||
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
||||
$tmpkey=preg_replace('/'.$search_options_pattern.'/', '', $key);
|
||||
if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]))
|
||||
{
|
||||
$crit=$val;
|
||||
$searchclass='';
|
||||
if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
|
||||
if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
|
||||
print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="'.$search_options_pattern.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options[$search_options_pattern.$tmpkey]).'">';
|
||||
}
|
||||
elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
|
||||
{
|
||||
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
|
||||
$morecss='';
|
||||
if ($typeofextrafield == 'sellist') $morecss='maxwidth200';
|
||||
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss);
|
||||
}
|
||||
elseif (in_array($typeofextrafield, array('datetime','timestamp')))
|
||||
{
|
||||
// TODO
|
||||
// Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
|
||||
}
|
||||
else
|
||||
{
|
||||
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
|
||||
$morecss='';
|
||||
if ($typeofextrafield == 'sellist') $morecss='maxwidth200';
|
||||
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,10 +25,18 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array
|
||||
{
|
||||
$sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'";
|
||||
}
|
||||
elseif (in_array($typ, array('boolean')))
|
||||
{
|
||||
if ($crit !== '-1' && $crit !== '') {
|
||||
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."'";
|
||||
if ($crit == '0') $sql.=" OR ".$extrafieldsobjectprefix.$tmpkey." IS NULL";
|
||||
$sql.= ")";
|
||||
}
|
||||
}
|
||||
elseif ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0') && (! in_array($typ, array('link')) || $crit != '-1'))
|
||||
{
|
||||
$mode_search=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric
|
||||
if (in_array($typ, array('int','double','real'))) $mode_search=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist','link')) && $crit != '0' && $crit != '-1') $mode_search=2; // Search on a foreign key int
|
||||
if (in_array($typ, array('chkbxlst','checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text
|
||||
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
|
||||
|
||||
@ -161,6 +161,8 @@ if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false;
|
||||
$type = 'application/octet-stream';
|
||||
if (GETPOST('type', 'alpha')) $type=GETPOST('type', 'alpha');
|
||||
else $type=dol_mimetype($original_file);
|
||||
// Security: Force to octet-stream if file is a dangerous file
|
||||
if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream';
|
||||
|
||||
// Security: Delete string ../ into $original_file
|
||||
$original_file = str_replace("../", "/", $original_file);
|
||||
@ -217,7 +219,7 @@ if (! $accessallowed)
|
||||
}
|
||||
|
||||
// Security:
|
||||
// On interdit les remontees de repertoire ainsi que les pipe dans les noms de fichiers.
|
||||
// We refuse directory transversal change and pipes in file names
|
||||
if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $fullpath_original_file))
|
||||
{
|
||||
dol_syslog("Refused to deliver file ".$fullpath_original_file);
|
||||
@ -229,6 +231,7 @@ if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $full
|
||||
clearstatcache();
|
||||
|
||||
$filename = basename($fullpath_original_file);
|
||||
$filename = preg_replace('/\.noexe$/i', '', $filename);
|
||||
|
||||
// Output file on browser
|
||||
dol_syslog("document.php download $fullpath_original_file filename=$filename content-type=$type");
|
||||
|
||||
@ -40,12 +40,13 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'users', 'trips'));
|
||||
|
||||
$action=GETPOST('action', 'aZ09');
|
||||
$massaction=GETPOST('massaction', 'alpha');
|
||||
$show_files=GETPOST('show_files', 'int');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'expensereportlist';
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'expensereportlist';
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
@ -136,17 +137,17 @@ $arrayfields=array(
|
||||
'd.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
|
||||
}
|
||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
if (! empty($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
|
||||
}
|
||||
}
|
||||
|
||||
$canedituser=(! empty($user->admin) || $user->rights->user->user->creer);
|
||||
|
||||
$object = new ExpenseReport($db);
|
||||
$objectuser = new User($db);
|
||||
|
||||
|
||||
@ -161,12 +162,13 @@ $parameters=array('socid'=>$socid);
|
||||
$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');
|
||||
|
||||
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')) // Both test must be present to be compatible with all browsers
|
||||
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_ref="";
|
||||
$search_user="";
|
||||
@ -176,7 +178,6 @@ if (empty($reshook))
|
||||
$search_status="";
|
||||
$month_start="";
|
||||
$year_start="";
|
||||
$day ="";
|
||||
$month_end="";
|
||||
$year_end="";
|
||||
$day_end = "";
|
||||
@ -258,9 +259,9 @@ $title = $langs->trans("ListOfTrips");
|
||||
llxHeader('', $title);
|
||||
|
||||
$max_year = 5;
|
||||
$min_year = 5;
|
||||
$min_year = 10;
|
||||
|
||||
// Récupération de l'ID de l'utilisateur
|
||||
// Get current user id
|
||||
$user_id = $user->id;
|
||||
|
||||
if ($id > 0)
|
||||
@ -340,15 +341,15 @@ if ($resql)
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($sall) $param.="&sall=".$sall;
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
if ($search_user) $param.="&search_user=".$search_user;
|
||||
if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht;
|
||||
if ($search_amount_ttc) $param.="&search_amount_ttc=".$search_amount_ttc;
|
||||
if ($search_status >= 0) $param.="&search_status=".$search_status;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($sall) $param.="&sall=".urlencode($sall);
|
||||
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
|
||||
if ($search_user) $param.="&search_user=".urlencode($search_user);
|
||||
if ($search_amount_ht) $param.="&search_amount_ht=".urlencode($search_amount_ht);
|
||||
if ($search_amount_ttc) $param.="&search_amount_ttc=".urlencode($search_amount_ttc);
|
||||
if ($search_status >= 0) $param.="&search_status=".urlencode($search_status);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
@ -503,7 +504,7 @@ if ($resql)
|
||||
|
||||
$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);
|
||||
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
@ -606,7 +607,7 @@ if ($resql)
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre middle">';
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@ -757,6 +758,7 @@ if ($resql)
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Date creation
|
||||
if (! empty($arrayfields['d.date_create']['checked']))
|
||||
{
|
||||
@ -801,10 +803,9 @@ if ($resql)
|
||||
}
|
||||
else
|
||||
{
|
||||
$colspan=1;
|
||||
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||
|
||||
print '<tr>'.'<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
$colspan=1;
|
||||
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
// Show total line
|
||||
|
||||
@ -540,7 +540,7 @@ class Export
|
||||
public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$indice=0;
|
||||
asort($array_selected);
|
||||
@ -634,6 +634,14 @@ class Export
|
||||
$alias=str_replace(array('.', '-','(',')'), '_', $key);
|
||||
if ($obj->$alias < 0) $obj->$alias='0';
|
||||
}
|
||||
// Operation GETNUMOPENDAYS (for Holiday module)
|
||||
elseif ($this->array_export_special[$indice][$key]=='getNumOpenDays')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
//$alias=$this->array_export_alias[$indice][$key];
|
||||
$alias=str_replace(array('.', '-','(',')'), '_', $key);
|
||||
$obj->$alias=num_open_day(dol_stringtotime($obj->d_date_debut, 1), dol_stringtotime($obj->d_date_fin, 1), 0, 1, $obj->d_halfday, $mysoc->country_code);
|
||||
}
|
||||
// Operation INVOICEREMAINTOPAY
|
||||
elseif ($this->array_export_special[$indice][$key]=='getRemainToPay')
|
||||
{
|
||||
|
||||
@ -605,9 +605,9 @@ if ($object->id > 0)
|
||||
$sql2.= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql2.= " AND c.entity IN (".getEntity('commande_fournisseur').")";
|
||||
$sql2.= ' AND s.rowid = '.$object->id;
|
||||
// Show orders with status validated, shipping started and delivered (even if any order we can bill)
|
||||
// Show orders with status validated, shipping started and delivered (even if any order we can bill).
|
||||
//$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")";
|
||||
$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")";
|
||||
$sql2.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/orderstoinvoice.php
|
||||
$sql2.= " AND c.billed = 0";
|
||||
// Find order that are not already invoiced
|
||||
// just need to check received status because we have the billed status now
|
||||
|
||||
@ -207,7 +207,7 @@ class ProductFournisseur extends Product
|
||||
/**
|
||||
* Modify the purchase price for a supplier
|
||||
*
|
||||
* @param int $qty Min quantity for which price is valid
|
||||
* @param float $qty Min quantity for which price is valid
|
||||
* @param float $buyprice Purchase price for the quantity min
|
||||
* @param User $user Object user user made changes
|
||||
* @param string $price_base_type HT or TTC
|
||||
@ -230,7 +230,7 @@ class ProductFournisseur extends Product
|
||||
* @param string $desc_fourn Custom description for product_fourn_price
|
||||
* @param string $barcode Barcode
|
||||
* @param int $fk_barcode_type Barcode type
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '')
|
||||
{
|
||||
@ -272,11 +272,10 @@ class ProductFournisseur extends Product
|
||||
|
||||
$buyprice=price2num($buyprice, 'MU');
|
||||
$charges=price2num($charges, 'MU');
|
||||
$qty=price2num($qty);
|
||||
$error=0;
|
||||
|
||||
$qty=price2num($qty, 'MS');
|
||||
$unitBuyPrice = price2num($buyprice/$qty, 'MU');
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
$newvat = $tva_tx;
|
||||
@ -298,6 +297,12 @@ class ProductFournisseur extends Product
|
||||
if (empty($localtax1)) $localtax1=0; // If = '' then = 0
|
||||
if (empty($localtax2)) $localtax2=0; // If = '' then = 0
|
||||
|
||||
// Check parameters
|
||||
if ($buyprice != '' && ! is_numeric($buyprice))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if ($this->product_fourn_price_id > 0)
|
||||
@ -331,7 +336,7 @@ class ProductFournisseur extends Product
|
||||
$sql.= " SET fk_user = " . $user->id." ,";
|
||||
$sql.= " ref_fourn = '" . $this->db->escape($ref_fourn) . "',";
|
||||
$sql.= " desc_fourn = '" . $this->db->escape($desc_fourn) . "',";
|
||||
$sql.= " price = ".price2num($buyprice).",";
|
||||
$sql.= " price = ".$buyprice.",";
|
||||
$sql.= " quantity = ".$qty.",";
|
||||
$sql.= " remise_percent = ".$remise_percent.",";
|
||||
$sql.= " remise = ".$remise.",";
|
||||
|
||||
@ -450,7 +450,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
|
||||
$sql .= ' AND c.fk_soc = s.rowid';
|
||||
|
||||
// Show orders with status validated, shipping started and delivered (well any order we can bill)
|
||||
$sql .= " AND c.fk_statut IN (5)";
|
||||
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY.")"; // Must match filter in htdocs/fourn/card.php
|
||||
$sql .= " AND c.billed = 0";
|
||||
|
||||
// Find order that are not already invoiced
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -402,6 +402,8 @@ class Holiday extends CommonObject
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -558,6 +560,7 @@ class Holiday extends CommonObject
|
||||
$sql.= " cp.fk_user,";
|
||||
$sql.= " cp.fk_type,";
|
||||
$sql.= " cp.date_create,";
|
||||
$sql.= " cp.tms as date_update,";
|
||||
$sql.= " cp.description,";
|
||||
$sql.= " cp.date_debut,";
|
||||
$sql.= " cp.date_fin,";
|
||||
@ -623,6 +626,7 @@ class Holiday extends CommonObject
|
||||
$tab_result[$i]['fk_user'] = $obj->fk_user;
|
||||
$tab_result[$i]['fk_type'] = $obj->fk_type;
|
||||
$tab_result[$i]['date_create'] = $this->db->jdate($obj->date_create);
|
||||
$tab_result[$i]['date_update'] = $this->db->jdate($obj->date_update);
|
||||
$tab_result[$i]['description'] = $obj->description;
|
||||
$tab_result[$i]['date_debut'] = $this->db->jdate($obj->date_debut);
|
||||
$tab_result[$i]['date_fin'] = $this->db->jdate($obj->date_fin);
|
||||
|
||||
@ -251,7 +251,7 @@ if ($object->id)
|
||||
}
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCreateCP').'</td>';
|
||||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
if ($object->statut == 3) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@ $allowinstall = 0;
|
||||
$allowupgrade = false;
|
||||
$checksok = 1;
|
||||
|
||||
$setuplang=GETPOST("selectlang", 'az09', 3)?GETPOST("selectlang", 'az09', 3):$langs->getDefaultLang();
|
||||
$setuplang=GETPOST("selectlang", 'aZ09', 3)?GETPOST("selectlang", 'aZ09', 3):$langs->getDefaultLang();
|
||||
$langs->setDefaultLang($setuplang);
|
||||
|
||||
$langs->load("install");
|
||||
|
||||
@ -113,12 +113,13 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167);
|
||||
-- actions not enabled by default (no constant created for that) when we enable module agenda
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142);
|
||||
-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...)
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152);
|
||||
|
||||
@ -70,7 +70,7 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-KONEGIE', 0, 41, '', 0, 6, 1, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-26OKT', 0, 41, '', 0, 10, 26, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-TOUSSAINT', 0, 41, '', 0, 11, 1, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12 8, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-IMMACULE', 0, 41, '', 0, 12, 8, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-24DEC', 0, 41, '', 0, 12, 24, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1);
|
||||
|
||||
@ -36,36 +36,36 @@
|
||||
delete from llx_c_tva;
|
||||
|
||||
-- ARGENTINA (id country=23)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (231, 23, '21','0','IVA standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (231, 23, '0','0','IVA Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (232, 23,'10.5','0','IVA reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (233, 23, '0','0','IVA Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (233, 23, '21','0','IVA standard rate',1);
|
||||
|
||||
-- AUSTRALIA (id country=28)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '10','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT standard rate',1);
|
||||
|
||||
-- AUSTRIA (id country=41)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '20','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT standard rate',1);
|
||||
|
||||
-- BRASIL (id country=56)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT reduced rate',1);
|
||||
|
||||
-- BULGARIA (id country=59)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '20','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT standard rate',1);
|
||||
|
||||
-- BELGIUM (id country=2)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '21','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT reduced rate', 1);
|
||||
|
||||
-- CANADA (id country=14)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '7','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Province',1);
|
||||
--insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Quebec',1);
|
||||
--insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (144, 14,'5','0','7','1','GST/TPS and PST/TVQ rate for British Columbia',1);
|
||||
@ -73,72 +73,73 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ
|
||||
|
||||
|
||||
-- CAMEROUN (id country=24)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '19.25','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT standard rate',1);
|
||||
|
||||
-- CHILE (id country=67)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '19','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT standard rate',1);
|
||||
|
||||
-- CHINA (id country=9)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '17','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT reduced rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT super reduced rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT standard rate',1);
|
||||
|
||||
-- CYPRUS (id country=78)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '19','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT Rate 9',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT Rate 5',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT standard rate',1);
|
||||
|
||||
-- DANMERK (id country=80)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '25','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT standard rate',1);
|
||||
|
||||
-- FRANCE (id country=1)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 16, 1, '2.1','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '10','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
|
||||
-- GERMANY (id country=5)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '19.0','0','allgemeine Ust.',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '0','0','No VAT', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 52, 5, '7.0','0','ermäßigte USt.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 53, 5, '0.0','0','keine USt.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 54, 5, '5.5','0','USt. Forst', 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 55, 5, '10.7','0','USt. Landwirtschaft', 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 56, 5, '19.0','0','allgemeine Ust.',1);
|
||||
|
||||
-- GREECE (id country=102)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2462, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2463, 102, 0, 0, '0', 0, '0', 0, 'Μηδενικό Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2464, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2465, 102, 6.5, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2466, 102, 16, 0, '0', 0, '0', 0, 'Νήσων κανονικός Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2467, 102, 9, 0, '0', 0, '0', 0, 'Νήσων μειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2468, 102, 5, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1021, 102, 0, 0, '0', 0, '0', 0, 'Μηδενικό Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1022, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1023, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1024, 102, 6.5, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1025, 102, 16, 0, '0', 0, '0', 0, 'Νήσων κανονικός Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1026, 102, 9, 0, '0', 0, '0', 0, 'Νήσων μειωμένος Φ.Π.Α.', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1027, 102, 5, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1);
|
||||
|
||||
-- ICELAND (id country=116)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1161, 116,'25.5','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1161, 116, '0','0','VAT rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116, '0','0','VAT rate 0',1);
|
||||
|
||||
-- INDIA (id country=117)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '0','0','VAT Rate 0', 0);
|
||||
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1178, 117, 'C+S-5', 0, 2.5, '1', 2.5, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1179, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1180, 117, 'C+S-12', 0, 6, '1', 6, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1181, 117, 'I-12' , 12, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1172, 117, 'C+S-5' , 0, 2.5, '1', 2.5, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1173, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1174, 117, 'C+S-12', 0, 6, '1', 6, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1175, 117, 'I-12' , 12, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'C+S-18', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'I-18' , 18, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1182, 117, 'C+S-28', 0, 14, '1', 14, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1183, 117, 'I-28' , 28, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'I-18' , 18, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1178, 117, 'C+S-28', 0, 14, '1', 14, '1', 0, 'CGST+SGST - Same state sales', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1179, 117, 'I-28' , 28, 0, '0', 0, '0', 0, 'IGST', 1);
|
||||
|
||||
-- IRELAND (id country=8)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 81, 8, '0','0','VAT Rate 0',1);
|
||||
@ -148,165 +149,165 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 8
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT reduced rate',1);
|
||||
|
||||
-- ITALY (id country=3)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '22','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT standard rate',1);
|
||||
|
||||
-- IVORY COST (id country=21)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (211, 21, '0','0',0,0,0,0,'IVA Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1);
|
||||
|
||||
-- JAPAN (id country=123)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT Rate 5',1);
|
||||
|
||||
-- LUXEMBOURG (id country=140)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '17','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT intermediary rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT super-reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '17','0','VAT standard rate',1);
|
||||
|
||||
-- MONACO (id country=27)
|
||||
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);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT reduced rate (France hors DOM-TOM)',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT reduced rate',1);
|
||||
|
||||
-- MAROCO (id country=12)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '20','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT super-reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT standard rate',1);
|
||||
|
||||
-- MALTA (id country=148)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '18','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT super-reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT standard rate',1);
|
||||
|
||||
-- NEDERLAND (id country=17)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 171, 17, '19','0','Algemeen BTW tarief',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 171, 17, '0','0','0 BTW tarief', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 172, 17, '6','0','Verlaagd BTW tarief', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 173, 17, '0','0','0 BTW tarief', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 173, 17, '19','0','Algemeen BTW tarief',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 174, 17, '21','0','Algemeen BTW tarief (vanaf 1 oktober 2012)',0);
|
||||
|
||||
-- NEW ZEALAND (id country=166)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT standard rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1663, 166, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- NIGERIA (id country=169)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT standard rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1693, 169, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- NORWAY (id country=173)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '25','0','VAT standard rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT standard rate', 1);
|
||||
|
||||
-- PANAMA (id country=178)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1781, 178, '7','0','ITBMS standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1782, 178, '0','0','ITBMS Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1781, 178, '0','0','ITBMS Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1782, 178, '7','0','ITBMS standard rate',1);
|
||||
|
||||
-- PERU (id country=181)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '18','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1812, 181, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT standard rate',1);
|
||||
|
||||
-- POLAND (id country=184)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '23','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT standard rate',1);
|
||||
|
||||
-- PORTUGAL (id country=25)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '23','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT reduced rate',1);
|
||||
|
||||
-- ROMANIA (id country=188)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '19','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '0','0','VAT Rate 0', 1);
|
||||
|
||||
-- SAUDI ARABIA (id country=26)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT Rate 5', 1);
|
||||
|
||||
-- SAN SALVADOR (id country=86)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 861, 86, '13', '0', 'IVA 13', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 862, 86, '0', '0', 'SIN IVA', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 861, 86, '0', '0', 'SIN IVA', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 862, 86, '13', '0', 'IVA 13', 1);
|
||||
|
||||
-- SENEGAL (id country=22)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '18', '0', 'VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '0', '0', 'VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT standard rate',1);
|
||||
|
||||
-- SLOVAKIA (id country=201)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '19', '0', 'VAT standard rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT reduced rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '19', '0', 'VAT standard rate', 1);
|
||||
|
||||
-- SLOVENIA (id country=202)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '22', '0', 'VAT standard rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT reduced rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT standard rate', 1);
|
||||
|
||||
-- SOUTH AFRICA (id country=205)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '15', '0', 'VAT standard rate', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2053, 205, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT Rate 0', 1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT standard rate', 1);
|
||||
|
||||
-- SPAIN (id country=4)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4,'21','0','5.2','3','-19:-15:-9','5','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0', '0','3','-19:-15:-9','5','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT standard rate',1);
|
||||
|
||||
-- SWEDEN (id country=20)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '25','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT standard rate',1);
|
||||
|
||||
-- SWITZERLAND (id country=6)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '7.7','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.7','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '7.7','0','VAT standard rate',1);
|
||||
|
||||
-- SRI LANKA (id country=207)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2071, 207, '0','0','VAT 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2072, 207, '15','0','VAT 15%', 1);
|
||||
|
||||
-- TAIWAN (id country=213)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2131, 213, '5','0','VAT 5%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '0','0','VAT 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2131, 213, '0','0','VAT 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '5','0','VAT 5%',1);
|
||||
|
||||
-- TUNISIA (id country=10)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '0','0','VAT Rate 0', 1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0, 0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '6','0','VAT 6%', 1, 1, '4', 0, 0);
|
||||
|
||||
-- UKRAINE (id country=226)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '20','0','VAT standart rate',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2262,226, '0','0','VAT Rate 0',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT Rate 0',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2262,226, '20','0','VAT standart rate',1);
|
||||
|
||||
-- UNITED OF KINGDOM (id country=7)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '20','0','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT standard rate before 2011',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT reduced rate', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '0','0','VAT Rate 0', 1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT standard rate',1);
|
||||
|
||||
-- UNITED STATES (id country=11)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1);
|
||||
@ -325,35 +326,40 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (24
|
||||
|
||||
-- MAURITANIA (id country=151)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT Rate 14',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT Rate 14',1);
|
||||
|
||||
-- MAURITIUS (id country=152)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT Rate 0',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT Rate 15',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT Rate 15',1);
|
||||
|
||||
-- HONDURAS (id country=114)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1141,114, '0','0','No ISV',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1142,114, '12','0','ISV 12%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1142,114, '12','0','ISV 12%',1);
|
||||
|
||||
-- MEXIQUE (id country=154)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1541,154, '0','0','No VAT',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1542,154, '16','0','VAT 16%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1542,154, '16','0','VAT 16%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1);
|
||||
|
||||
-- BARBADOS (id country=46)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 461, 46, '0','0','No VAT',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1);
|
||||
|
||||
-- SOUTH AFRICA (id country=205)
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1);
|
||||
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1);
|
||||
|
||||
-- VENEZUELA (id country=232)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2323,232, '8','0','VAT 8%',1);
|
||||
|
||||
|
||||
|
||||
-- Example of code to insert a vat rate 0 for each country
|
||||
--delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1')
|
||||
--insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -33,6 +33,23 @@ ALTER TABLE llx_account_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL
|
||||
ALTER TABLE llx_expensereport ADD COLUMN paid smallint default 0 NOT NULL;
|
||||
UPDATE llx_expensereport set paid = 1 WHERE fk_statut = 6 and paid = 0;
|
||||
|
||||
|
||||
-- For v11
|
||||
|
||||
create table llx_holiday_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_holiday_extrafields ADD INDEX idx_holiday_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_societe_rib MODIFY label varchar(200);
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300);
|
||||
|
||||
create table llx_entrepot_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
@ -468,6 +468,12 @@ UPDATE llx_accounting_bookkeeping set date_creation = tms where date_creation IS
|
||||
-- UPDATE llx_facturedet_rec set label = NULL WHERE label IS NOT NULL;
|
||||
|
||||
|
||||
-- Note to make all deposit as payed when there is already a discount generated from it.
|
||||
--drop table tmp_invoice_deposit_mark_as_available;
|
||||
--create table tmp_invoice_deposit_mark_as_available as select * from llx_facture as f where f.type = 3 and f.paye = 0 and f.rowid in (select fk_facture_source from llx_societe_remise_except);
|
||||
--update llx_facture set paye = 1 where rowid in (select rowid from tmp_invoice_deposit_mark_as_available);
|
||||
|
||||
|
||||
|
||||
-- Note to migrate from old counter aquarium to new one
|
||||
-- drop table tmp;
|
||||
|
||||
21
htdocs/install/mysql/tables/llx_holiday_extrafields.key.sql
Normal file
21
htdocs/install/mysql/tables/llx_holiday_extrafields.key.sql
Normal file
@ -0,0 +1,21 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ===================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_holiday_extrafields ADD INDEX idx_holiday_extrafields (fk_object);
|
||||
|
||||
26
htdocs/install/mysql/tables/llx_holiday_extrafields.sql
Normal file
26
htdocs/install/mysql/tables/llx_holiday_extrafields.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- ========================================================================
|
||||
|
||||
create table llx_holiday_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -24,7 +24,7 @@ create table llx_societe_rib
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
type varchar(32) DEFAULT 'ban' NOT NULL, -- 'ban' or 'paypal' or 'card' or 'stripe'
|
||||
label varchar(30),
|
||||
label varchar(200),
|
||||
fk_soc integer NOT NULL,
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
|
||||
@ -42,7 +42,7 @@ error_reporting(0);
|
||||
@set_time_limit(120);
|
||||
error_reporting($err);
|
||||
|
||||
$setuplang=GETPOST("selectlang", 'az09', 3)?GETPOST("selectlang", 'az09', 3):'auto';
|
||||
$setuplang=GETPOST("selectlang", 'aZ09', 3)?GETPOST("selectlang", 'aZ09', 3):'auto';
|
||||
$langs->setDefaultLang($setuplang);
|
||||
|
||||
$langs->loadLangs(array("admin","install","other"));
|
||||
|
||||
@ -1060,7 +1060,7 @@ BackgroundImageLogin=Background image
|
||||
PermanentLeftSearchForm=Permanent search form on left menu
|
||||
DefaultLanguage=Default language
|
||||
EnableMultilangInterface=Enable multilanguage support
|
||||
EnableShowLogo=Show logo on left menu
|
||||
EnableShowLogo=Show the company logo in the menu
|
||||
CompanyInfo=Company/Organization
|
||||
CompanyIds=Company/Organization identities
|
||||
CompanyName=Name
|
||||
@ -1908,6 +1908,7 @@ ResourceSetup=Configuration of Resource module
|
||||
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
|
||||
DisabledResourceLinkUser=Disable feature to link a resource to users
|
||||
DisabledResourceLinkContact=Disable feature to link a resource to contacts
|
||||
EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event
|
||||
ConfirmUnactivation=Confirm module reset
|
||||
OnMobileOnly=On small screen (smartphone) only
|
||||
DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both)
|
||||
|
||||
@ -169,3 +169,7 @@ FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make d
|
||||
AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation
|
||||
CashControl=POS cash fence
|
||||
NewCashFence=New cash fence
|
||||
BankColorizeMovement=Colorize movements
|
||||
BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements
|
||||
BankColorizeMovementName1=Background color for debit movement
|
||||
BankColorizeMovementName2=Background color for credit movement
|
||||
|
||||
@ -8,7 +8,6 @@ NotActiveModCP=You must enable the module Leave to view this page.
|
||||
AddCP=Make a leave request
|
||||
DateDebCP=Start date
|
||||
DateFinCP=End date
|
||||
DateCreateCP=Creation date
|
||||
DraftCP=Draft
|
||||
ToReviewCP=Awaiting approval
|
||||
ApprovedCP=Approved
|
||||
|
||||
@ -153,6 +153,7 @@ RowMaterial=Raw Material
|
||||
ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b>?
|
||||
CloneContentProduct=Clone all main information of product/service
|
||||
ClonePricesProduct=Clone prices
|
||||
CloneCategoriesProduct=Clone tags/categories linked
|
||||
CloneCompositionProduct=Clone virtual product/service
|
||||
CloneCombinationsProduct=Clone product variants
|
||||
ProductIsUsed=This product is used
|
||||
|
||||
@ -34,3 +34,6 @@ IdResource=Id resource
|
||||
AssetNumber=Serial number
|
||||
ResourceTypeCode=Resource type code
|
||||
ImportDataset_resource_1=Resources
|
||||
|
||||
ErrorResourcesAlreadyInUse=Some resources are in use
|
||||
ErrorResourceUseInEvent=%s use in %s event
|
||||
@ -1907,6 +1907,7 @@ ResourceSetup=Configuration du module Ressource
|
||||
UseSearchToSelectResource=Utilisez un champ avec auto-complétion pour choisir les ressources (plutôt qu'une liste déroulante).
|
||||
DisabledResourceLinkUser=Désactiver la fonctionnalité pour lier une ressource aux utilisateurs
|
||||
DisabledResourceLinkContact=Désactiver la fonctionnalité pour lier une ressource aux contacts/adresses
|
||||
EnableResourceUsedInEventCheck=Activer la fonctionnalité de vérification d'une ressource déjà réservée lors d'un évènement
|
||||
ConfirmUnactivation=Confirmer réinitialisation du module
|
||||
OnMobileOnly=Sur petit écran (smartphone) uniquement
|
||||
DisableProspectCustomerType=Désactiver le type de tiers "Prospect + Client" (le tiers doit donc être un client potentiel ou un client, mais ne peut pas être les deux)
|
||||
|
||||
@ -153,6 +153,8 @@ RowMaterial=Matière première
|
||||
ConfirmCloneProduct=Êtes-vous sûr de vouloir cloner le produit ou service <b>%s</b> ?
|
||||
CloneContentProduct=Cloner les informations générales du produit/service
|
||||
ClonePricesProduct=Cloner les prix
|
||||
CloneCategoriesProduct=Cloner les catégories associées
|
||||
CloneCompositionProduct=Cloner le produits packagés
|
||||
CloneCompositionProduct=Cloner les produits virtuels
|
||||
CloneCombinationsProduct=Cloner les variantes
|
||||
ProductIsUsed=Ce produit est utilisé
|
||||
|
||||
@ -34,3 +34,6 @@ IdResource=id ressource
|
||||
AssetNumber=Numéro de série
|
||||
ResourceTypeCode=Code de type de ressource
|
||||
ImportDataset_resource_1=Ressources
|
||||
|
||||
ErrorResourcesAlreadyInUse=Des ressources sont déjà occupées
|
||||
ErrorResourceUseInEvent=%s occupée dans l'événement %s
|
||||
@ -1,4 +1,4 @@
|
||||
# Dolibarr language file - Source file is en_US - admin
|
||||
VATManagement=Gestion TSS
|
||||
VATIsUsedDesc=Le taux de TSS proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :<br>Si vendeur non assujetti à TSS, TSS par défaut=0. Fin de règle.<br>Si le (pays vendeur= pays acheteur) alors TSS par défaut=TSS du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TSS par défaut=0 (La TSS doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TSS par défaut=TSS du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TSS par défaut=0. Fin de règle.<br>Sinon TSS proposée par défaut=0. Fin de règle.<br>
|
||||
VATIsNotUsedDesc=Le taux de TSS proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
|
||||
VATManagement=Gestion TGC
|
||||
VATIsUsedDesc=Le taux de TGC proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :<br>Si vendeur non assujetti à TGC, TGC par défaut=0. Fin de règle.<br>Si le (pays vendeur= pays acheteur) alors TGC par défaut=TGC du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TGC par défaut=0 (La TGC doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TGC par défaut=TGC du produit vendu. Fin de règle.<br>Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TGC par défaut=0. Fin de règle.<br>Sinon TGC proposée par défaut=0. Fin de règle.<br>
|
||||
VATIsNotUsedDesc=Le taux de TGC proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés.
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# Dolibarr language file - Source file is en_US - companies
|
||||
VATIsUsed=Assujetti à la TSS
|
||||
VATIsNotUsed=Non assujetti à la TSS
|
||||
VATIsUsed=Assujetti à la TGC
|
||||
VATIsNotUsed=Non assujetti à la TGC
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
# Dolibarr language file - Source file is en_US - compta
|
||||
VATToPay=TSS ventes
|
||||
VATReceived=TSS collectée
|
||||
VATToCollect=TSS achats
|
||||
VATSummary=Balance de TSS
|
||||
VATPaid=TSS payée
|
||||
VATCollected=TSS récupérée
|
||||
PaymentVat=Règlement TSS
|
||||
VATPayment=Règlement TSS
|
||||
VATPayments=Règlements TSS
|
||||
ShowVatPayment=Affiche paiement TSS
|
||||
RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TSS.<br>- Il se base sur la date de règlement de ces factures, charges et TSS.
|
||||
VATReportByCustomersInInputOutputMode=Rapport par client des TSS collectées et payées (TSS sur encaissement)
|
||||
VATReportByQuartersInInputOutputMode=Rapport par taux des TSS collectées et payées (TSS sur encaissement)
|
||||
SeeVATReportInInputOutputMode=Voir le rapport <b>%sTSS encaissement%s</b> pour mode de calcul standard
|
||||
SeeVATReportInDueDebtMode=Voir le rapport <b>%sTSS sur débit%s</b> pour mode de calcul avec option sur les débits
|
||||
RulesVATInServices=- Pour les services, le rapport inclut les TSS des règlements effectivement reçus ou émis en se basant sur la date du règlement.
|
||||
RulesVATInProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture.
|
||||
RulesVATDueServices=- Pour les services, le rapport inclut les TSS des factures dues, payées ou non en se basant sur la date de facture.
|
||||
RulesVATDueProducts=- Pour les biens matériels, il inclut les TSS des factures en se basant sur la date de facture.
|
||||
CalculationRuleDesc=Pour calculer le total de TSS, il existe 2 modes:<br>Le mode 1 consiste à arrondir la TSS de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
|
||||
VATToPay=TGC ventes
|
||||
VATReceived=TGC collectée
|
||||
VATToCollect=TGC achats
|
||||
VATSummary=Balance de TGC
|
||||
VATPaid=TGC payée
|
||||
VATCollected=TGC récupérée
|
||||
PaymentVat=Règlement TGC
|
||||
VATPayment=Règlement TGC
|
||||
VATPayments=Règlements TGC
|
||||
ShowVatPayment=Affiche paiement TGC
|
||||
RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TGC.<br>- Il se base sur la date de règlement de ces factures, charges et TGC.
|
||||
VATReportByCustomersInInputOutputMode=Rapport par client des TGC collectées et payées (TGC sur encaissement)
|
||||
VATReportByQuartersInInputOutputMode=Rapport par taux des TGC collectées et payées (TGC sur encaissement)
|
||||
SeeVATReportInInputOutputMode=Voir le rapport <b>%sTGC encaissement%s</b> pour mode de calcul standard
|
||||
SeeVATReportInDueDebtMode=Voir le rapport <b>%sTGC sur débit%s</b> pour mode de calcul avec option sur les débits
|
||||
RulesVATInServices=- Pour les services, le rapport inclut les TGC des règlements effectivement reçus ou émis en se basant sur la date du règlement.
|
||||
RulesVATInProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture.
|
||||
RulesVATDueServices=- Pour les services, le rapport inclut les TGC des factures dues, payées ou non en se basant sur la date de facture.
|
||||
RulesVATDueProducts=- Pour les biens matériels, il inclut les TGC des factures en se basant sur la date de facture.
|
||||
CalculationRuleDesc=Pour calculer le total de TGC, il existe 2 modes:<br>Le mode 1 consiste à arrondir la TGC de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
|
||||
|
||||
@ -3,7 +3,7 @@ DIRECTION=ltr
|
||||
FONTFORPDF=helvetica
|
||||
FONTSIZEFORPDF=10
|
||||
SeparatorDecimal=,
|
||||
SeparatorThousand=None
|
||||
SeparatorThousand=Space
|
||||
FormatDateShort=%d/%m/%Y
|
||||
FormatDateShortInput=%d/%m/%Y
|
||||
FormatDateShortJava=dd/MM/yyyy
|
||||
@ -20,7 +20,7 @@ FormatDateHourSecShort=%d/%m/%Y %H:%M:%S
|
||||
FormatDateHourTextShort=%d %b %Y %H:%M
|
||||
FormatDateHourText=%d %B %Y %H:%M
|
||||
ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'.
|
||||
AmountVAT=Montant TSS
|
||||
TotalVAT=Total TSS
|
||||
VAT=TSS
|
||||
VATRate=Taux TSS
|
||||
AmountVAT=Montant TGC
|
||||
TotalVAT=Total TGC
|
||||
VAT=TGC
|
||||
VATRate=Taux TGC
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user