Merge remote-tracking branch 'upstream/develop' into 10.0_intracommreport

This commit is contained in:
Alexandre SPANGARO 2019-06-23 21:47:34 +02:00
commit 4a84dcaa62
1377 changed files with 18041 additions and 12920 deletions

View File

@ -1,4 +1,7 @@
# .scrutinizer.yml
build:
- php-scrutinizer-run
imports:
- javascript
- php

View File

@ -164,12 +164,6 @@ before_script:
echo
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
echo
echo "Enabling Memcached for PHP <= 5.4"
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
echo
@ -350,6 +344,9 @@ script:
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?

View File

@ -114,6 +114,7 @@ NEW: Option in workflow module to set a reception billed on validate supplier bi
NEW: Autocompletion on lists should be available on mobile applications.
NEW: Add mass action to close several members.
NEW: Add hidden option ADD_UNSPLASH_LOGIN_BACKGROUND for random background
NEW: Add hidden option to be ready for BREXIT
For Developers:
NEW: Module "DebugBar" is available as a stable module.

View File

@ -1,7 +1,7 @@
#----------------------------------------------------------------------------
# \file dolibarr.pl
# \brief Dolibarr script install for Virtualmin Pro
# \author (c)2009-2018 Regis Houssin <regis.houssin@inodbox.com>
# \author (c)2009-2019 Regis Houssin <regis.houssin@inodbox.com>
#----------------------------------------------------------------------------
@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "9.0.0", "8.0.3", "7.0.4", "6.0.8", "5.0.7" );
return ( "10.0.0", "9.0.3", "8.0.5", "7.0.5", "6.0.8" );
}
sub script_dolibarr_release
@ -390,6 +390,7 @@ sub script_dolibarr_check_latest
{
local ($ver) = @_;
local @vers = &osdn_package_versions("dolibarr",
$ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 7.0 ? "dolibarr\\-(7\\.0\\.[0-9\\.]+)\\.tgz" :

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
@ -462,8 +462,6 @@ $linkback='';
print load_fiche_titre($titre, $linkback, 'title_accountancy');
print "<br>\n";
// Confirmation de la suppression de la ligne
if ($action == 'delete')

View File

@ -412,7 +412,7 @@ $titlepicto='title_setup';
print load_fiche_titre($titre, $linkback, $titlepicto);
print $langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'<br><br>';
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
// Confirmation de la suppression de la ligne
if ($action == 'delete')

View File

@ -21,9 +21,8 @@
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting expert module
*/
require '../../main.inc.php';
// Class
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
@ -89,7 +88,7 @@ llxHeader();
$linkback = '';
print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy');
print $langs->trans("DefaultClosureDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("DefaultClosureDesc").'</span><br>';
print '<br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';

View File

@ -78,7 +78,6 @@ $list_account = array (
$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
if (GETPOST('change_chart', 'alpha'))
{
$chartofaccounts = GETPOST('chartofaccounts', 'int');
@ -132,7 +131,7 @@ llxHeader();
$linkback = '';
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
print $langs->trans("DefaultBindingDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("DefaultBindingDesc").'</span><br>';
print '<br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';

View File

@ -76,6 +76,7 @@ $model_option = array (
),
);
/*
* Actions
*/
@ -138,6 +139,7 @@ $form = new Form($db);
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print ' function initfields()'."\n";
@ -195,7 +197,6 @@ print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Options') . '</td>';
print "</tr>\n";
$num = count($main_option);
if ($num) {
foreach ($main_option as $key) {
@ -236,7 +237,7 @@ if (! $conf->use_javascript_ajax) {
} else {
print '<td>';
$listmodelcsv = AccountancyExport::getType();
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0);
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '</td>';
}

View File

@ -323,7 +323,7 @@ if ($result)
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
print '<br>';
print $langs->trans("InitAccountancyDesc") . '<br>';
print '<span class="opacitymedium">'.$langs->trans("InitAccountancyDesc") . '</span><br>';
print '<br>';
// Select mode

View File

@ -626,7 +626,7 @@ if ($action == 'create')
}
else
{
print '<input type="text" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'">';
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'">';
}
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . (GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation). '"></td>';
@ -683,7 +683,7 @@ if ($action == 'create')
}
else
{
print '<input type="text" name="subledger_account" value="">';
print '<input type="text" class="maxwidth150" name="subledger_account" value="">';
}
print '</td>';
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';

View File

@ -309,8 +309,10 @@ if ($action == 'delbookkeeping') {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
Header("Location: list.php");
exit();
// Make a redirect to avoid to launch the delete later after a back button
header("Location: list.php".($param?'?'.$param:''));
exit;
}
}
if ($action == 'delbookkeepingyearconfirm') {
@ -334,14 +336,14 @@ if ($action == 'delbookkeepingyearconfirm') {
{
setEventMessages("RecordDeleted", null, 'mesgs');
}
Header("Location: list.php");
// Make a redirect to avoid to launch the delete later after a back button
header("Location: list.php".($param?'?'.$param:''));
exit;
}
else
{
setEventMessages("NoRecordDeleted", null, 'warnings');
Header("Location: list.php");
exit;
}
}
if ($action == 'delmouvconfirm') {
@ -358,7 +360,7 @@ if ($action == 'delmouvconfirm') {
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
Header("Location: list.php?noreset=1".($param?'&'.$param:''));
header("Location: list.php?noreset=1".($param?'&'.$param:''));
exit;
}
}
@ -481,7 +483,7 @@ if ($action == 'delbookkeepingyear') {
'default' => $deljournal
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
print $formconfirm;
}
@ -510,7 +512,7 @@ if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
} else {
$newcardbutton ='<a href="'.$_SERVER['PHP_SELF'].'?action=setreexport&value=1'.($param?'&'.$param:'').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
}
$newcardbutton.= $langs->trans("IncludeDocsAlreadyExported");
$newcardbutton.= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
@ -581,7 +583,7 @@ if (! empty($arrayfields['t.subledger_account']['checked']))
}
else
{
print '<input type="text" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.'">';
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_start" value="'.$search_accountancy_aux_code_start.'">';
}
print '</div>';
print '<div class="nowrap">';
@ -594,7 +596,7 @@ if (! empty($arrayfields['t.subledger_account']['checked']))
}
else
{
print '<input type="text" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.'">';
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code_end" value="'.$search_accountancy_aux_code_end.'">';
}
print '</div>';
print '</td>';
@ -817,8 +819,8 @@ if ($num > 0)
// Action column
print '<td class="nowraponall center">';
if(empty($line->date_export)) {
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num=' . urlencode($line->piece_num) . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_edit() . '</a>&nbsp;';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . urlencode($line->piece_num) . $param . '&page=' . $page . ($sortfield ? '&sortfield='.$sortfield : '') . ($sortorder ? '&sortorder='.$sortorder : '') . '">' . img_delete() . '</a>';
}
print '</td>';
if (! $i) $totalarray['nbfield']++;

View File

@ -348,7 +348,7 @@ while ($i < min($num, $limit))
$colspan = 9;
print "<tr>";
print '<td colspan="'.$colspan.'" style="font-weight:bold; border-bottom: 1pt solid black;">';
if (! empty($line->numero_compte) && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte);
if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte);
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
print '</td>';
print '</tr>';

View File

@ -39,19 +39,18 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
class AccountancyExport
{
// Type of export. Used into $conf->global->ACCOUNTING_EXPORT_MODELCSV
public static $EXPORT_TYPE_NORMAL = 1; // CSV
public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV
public static $EXPORT_TYPE_CEGID = 2;
public static $EXPORT_TYPE_COALA = 3;
public static $EXPORT_TYPE_BOB50 = 4;
public static $EXPORT_TYPE_CIEL = 5;
public static $EXPORT_TYPE_QUADRATUS = 6;
public static $EXPORT_TYPE_EBP = 7;
public static $EXPORT_TYPE_COGILOG = 8;
public static $EXPORT_TYPE_AGIRIS = 9;
public static $EXPORT_TYPE_FEC = 11;
public static $EXPORT_TYPE_OPENCONCERTO = 12;
public static $EXPORT_TYPE_SAGE50_SWISS = 13;
public static $EXPORT_TYPE_CONFIGURABLE = 1; // CSV
public static $EXPORT_TYPE_AGIRIS = 10;
public static $EXPORT_TYPE_EBP = 15;
public static $EXPORT_TYPE_CEGID = 20;
public static $EXPORT_TYPE_COGILOG = 25;
public static $EXPORT_TYPE_COALA = 30;
public static $EXPORT_TYPE_BOB50 = 35;
public static $EXPORT_TYPE_CIEL = 40;
public static $EXPORT_TYPE_SAGE50_SWISS = 45;
public static $EXPORT_TYPE_QUADRATUS = 60;
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_FEC = 1000;
/**
@ -94,8 +93,7 @@ class AccountancyExport
{
global $langs;
return array (
//self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
$listofexporttypes = array(
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
@ -106,9 +104,13 @@ class AccountancyExport
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
);
ksort($listofexporttypes, SORT_NUMERIC);
return $listofexporttypes;
}
/**
@ -120,7 +122,6 @@ class AccountancyExport
private static function getFormatCode($type)
{
$formatcode = array (
//self::$EXPORT_TYPE_NORMAL => 'csv',
self::$EXPORT_TYPE_CONFIGURABLE => 'csv',
self::$EXPORT_TYPE_CEGID => 'cegid',
self::$EXPORT_TYPE_COALA => 'coala',
@ -131,8 +132,8 @@ class AccountancyExport
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
self::$EXPORT_TYPE_FEC => 'fec',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
);
return $formatcode[$type];
@ -149,13 +150,13 @@ class AccountancyExport
return array (
'param' => array(
/*self::$EXPORT_TYPE_NORMAL => array(
'label' => $langs->trans('Modelcsv_normal'),
self::$EXPORT_TYPE_CONFIGURABLE => array(
'label' => $langs->trans('Modelcsv_configurable'),
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
),*/
),
self::$EXPORT_TYPE_CEGID => array(
'label' => $langs->trans('Modelcsv_CEGID'),
),
@ -182,25 +183,18 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => array(
'label' => $langs->trans('Modelcsv_agiris'),
),
self::$EXPORT_TYPE_CONFIGURABLE => array(
'label' => $langs->trans('Modelcsv_configurable'),
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
self::$EXPORT_TYPE_OPENCONCERTO => array(
'label' => $langs->trans('Modelcsv_openconcerto'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_SAGE50_SWISS => array(
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_FEC => array(
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_OPENCONCERTO => array(
'label' => $langs->trans('Modelcsv_openconcerto'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_SAGE50_SWISS => array(
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
),
'cr'=> array (
'1' => $langs->trans("Unix"),
@ -233,11 +227,9 @@ class AccountancyExport
switch ($conf->global->ACCOUNTING_EXPORT_MODELCSV) {
case self::$EXPORT_TYPE_NORMAL :
case self::$EXPORT_TYPE_CONFIGURABLE :
$this->exportConfigurable($TData);
break;
case self::$EXPORT_TYPE_NORMAL :
case self::$EXPORT_TYPE_CEGID :
$this->exportCegid($TData);
break;
@ -918,9 +910,10 @@ class AccountancyExport
}
/**
* trunc
*
* @param string $str data
* @param integer $size data
* @param string $str String
* @param integer $size Data to trunc
* @return string
*/
public static function trunc($str, $size)
@ -929,10 +922,11 @@ class AccountancyExport
}
/**
* toAnsi
*
* @param unknown $str Original string to encode and optionaly truncate
* @param integer $size truncate string after $size characters
* @return string String encoded in Windows-1251 charset
* @param string $str Original string to encode and optionaly truncate
* @param integer $size Truncate string after $size characters
* @return string String encoded in Windows-1251 charset
*/
public static function toAnsi($str, $size = -1)
{

View File

@ -67,11 +67,11 @@ class Lettering extends BookKeeping
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) ";
$sql .= " WHERE ( ";
if (! empty($object->code_compta))
if ($object->code_compta != "")
$sql .= " bk.subledger_account = '" . $object->code_compta . "' ";
if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur))
if ($object->code_compta != "" && $object->code_compta_fournisseur != "")
$sql .= " OR ";
if (! empty($object->code_compta_fournisseur))
if ($object->code_compta_fournisseur != "")
$sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' ";
$sql .= " ) AND (bk.date_lettering ='' OR bk.date_lettering IS NULL) ";
@ -99,13 +99,13 @@ class Lettering extends BookKeeping
$sql .= " AND facf.entity = ".$conf->entity;
$sql .= " AND code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4 AND entity=".$conf->entity.") ";
$sql .= " AND ( ";
if (! empty($object->code_compta)) {
if ($object->code_compta != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta . "' ";
}
if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) {
if ($object->code_compta != "" && $object->code_compta_fournisseur != "") {
$sql .= " OR ";
}
if (! empty($object->code_compta_fournisseur)) {
if ($object->code_compta_fournisseur != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' ";
}
$sql .= " ) ";
@ -127,13 +127,13 @@ class Lettering extends BookKeeping
$sql .= " WHERE bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=3 AND entity=".$conf->entity.") ";
$sql .= " AND facf.entity = ".$conf->entity;
$sql .= " AND ( ";
if (! empty($object->code_compta)) {
if ($object->code_compta != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta . "' ";
}
if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) {
if ($object->code_compta != "" && $object->code_compta_fournisseur != "") {
$sql .= " OR ";
}
if (! empty($object->code_compta_fournisseur)) {
if ($object->code_compta_fournisseur != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' ";
}
$sql .= ") ";
@ -159,13 +159,13 @@ class Lettering extends BookKeeping
$sql .= " AND bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4 AND entity=".$conf->entity.") ";
$sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy
$sql .= " AND ( ";
if (! empty($object->code_compta)) {
if ($object->code_compta != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta . "' ";
}
if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) {
if ($object->code_compta != "" && $object->code_compta_fournisseur != "") {
$sql .= " OR ";
}
if (! empty($object->code_compta_fournisseur)) {
if ($object->code_compta_fournisseur != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' ";
}
$sql .= " ) ";
@ -187,13 +187,13 @@ class Lettering extends BookKeeping
$sql .= " WHERE code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=2 AND entity=".$conf->entity.") ";
$sql .= " AND fac.entity IN (".getEntity('invoice', 0).")";// We don't share object for accountancy
$sql .= " AND ( ";
if (! empty($object->code_compta)) {
if ($object->code_compta != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta . "' ";
}
if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) {
if ($object->code_compta != "" && $object->code_compta_fournisseur != "") {
$sql .= " OR ";
}
if (! empty($object->code_compta_fournisseur)) {
if ($object->code_compta_fournisseur != "") {
$sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' ";
}
$sql .= " ) ";

View File

@ -211,10 +211,10 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -289,10 +289,10 @@ if ($resql) {
print '</td>';
for($i = 2; $i <= 12; $i++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -348,9 +348,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right"><b>' . price($row[13]) . '</b></td>';
print '<td class="nowrap right"><b>' . price($row[13]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -401,9 +401,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price(price2num($row[$i])) . '</td>';
print '<td class="nowrap right">' . price(price2num($row[$i])) . '</td>';
}
print '<td class="right"><b>' . price(price2num($row[13])) . '</b></td>';
print '<td class="nowrap right"><b>' . price(price2num($row[13])) . '</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -385,7 +385,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';
print '<td class="nowrap right">' . price($objp->total_ht) . '</td>';
print '<td class="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';

View File

@ -92,9 +92,6 @@ if (! $user->rights->accounting->bind->write)
$hookmanager->initHooks(array('accountancycustomerlist'));
$formaccounting = new FormAccounting($db);
$accounting = new AccountingAccount($db);
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
@ -384,11 +381,11 @@ if ($result) {
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
print '<td class="liste_titre">';
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
@ -444,29 +441,50 @@ if ($result) {
$isBuyerInEEC = isInEEC($objp);
$suggestedaccountingaccountbydefaultfor = '';
if ($objp->type_l == 1) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
if ($objp->aarowid == '') {
$objp->aarowid_suggest = $aarowid_s;
}
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = '';
} else {
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = 'eec';
} else { // Foreign sale
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = 'export';
}
}
} elseif ($objp->type_l == 0) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
if ($objp->aarowid == '') {
$objp->aarowid_suggest = $aarowid_p;
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = '';
} else {
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = 'eec';
} else {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : '');
$suggestedaccountingaccountbydefaultfor = 'export';
}
}
}
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
$suggestedaccountingaccountfor = '';
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_sell_p = $objp->code_sell;
$objp->aarowid_suggest = $objp->aarowid;
$suggestedaccountingaccountfor = '';
} else {
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
$objp->code_sell_p = $objp->code_sell_intra;
$objp->aarowid_suggest = $objp->aarowid_intra;
$suggestedaccountingaccountfor = 'eec';
} else { // Foreign sale
$objp->code_sell_p = $objp->code_sell_export;
$objp->aarowid_suggest = $objp->aarowid_export;
$suggestedaccountingaccountfor = 'export';
}
}
@ -477,8 +495,8 @@ if ($result) {
}
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) $code_sell_p_notset = 'color:red';
// $objp->code_sell_p is now code of product/service
// $objp->code_sell_l is now default code of product/service
// $objp->code_sell_p is now code of product/service
print '<tr class="oddeven">';
@ -492,7 +510,7 @@ if ($result) {
// Ref Product
print '<td>';
if ($product_static->id)
if ($product_static->id > 0)
print $product_static->getNomUrl(1);
if ($objp->product_label) print '<br>'.$objp->product_label;
print '</td>';
@ -503,7 +521,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="right">';
print '<td class="nowrap right">';
print price($objp->total_ht);
print '</td>';
@ -514,7 +532,7 @@ if ($result) {
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
print '</td>';
print '<td class="center">';
print '<td>';
$labelcountry=($objp->country_code && ($langs->trans("Country".$objp->country_code)!="Country".$objp->country_code))?$langs->trans("Country".$objp->country_code):$objp->country_label;
print $labelcountry;
print '</td>';
@ -523,17 +541,27 @@ if ($result) {
// Current account
print '<td class="center" style="' . $code_sell_p_notset . '">';
print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("Unknown"));
if ($objp->product_id > 0)
$s = (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")).': ';
$shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp.= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp.= $langs->trans("SaleExport");
$s.= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("NotDefined"));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0)
{
print '<br>';
print (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")) . ' = ' . (empty($objp->code_sell_p) ? $langs->trans("Unknown") : length_accountg($objp->code_sell_p));
$s = (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")).': ';
$shelp = '';
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s.= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';
// Suggested accounting account
print '<td>';
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
print '</td>';
// Column with checkbox

View File

@ -203,10 +203,10 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -276,10 +276,10 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -331,9 +331,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right"><b>' . price($row[13]) . '</b></td>';
print '<td class="nowrap right"><b>' . price($row[13]) . '</b></td>';
print '</tr>';
}

View File

@ -319,7 +319,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
print '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';
print '<td class="nowrap right">' . price($objp->total_ht) . '</td>';
print '<td class="center">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';

View File

@ -376,7 +376,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
print '</td>';
print '<td class="right">';
print '<td class="nowrap right">';
print price($objp->price);
print '</td>';

View File

@ -107,8 +107,6 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
$idpays = $mysoc->country_id;
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,";
@ -154,6 +152,9 @@ $paymentloanstatic = new PaymentLoan($db);
$accountLinestatic=new AccountLine($db);
$paymentsubscriptionstatic = new Subscription($db);
$tmppayment = new Paiement($db);
$tmpinvoice = new Facture($db);
$accountingaccount = new AccountingAccount($db);
// Get code of finance journal
@ -171,8 +172,8 @@ if ($result) {
//print $sql;
// Variables
$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
$account_customer = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
$account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
$account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
$account_employee = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
$account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word
$account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
@ -185,13 +186,14 @@ if ($result) {
$tabbq = array ();
$tabtp = array ();
$tabtype = array ();
$tabmoreinfo = array();
// Loop on each line into llx_bank table. For each line, we should get:
// one line tabpay = line into bank
// one line for bank record = tabbq
// one line for thirdparty record = tabtp
$i = 0;
while ( $i < $num )
while ($i < $num)
{
$obj = $db->fetch_object($result);
@ -215,10 +217,10 @@ if ($result) {
// Set accountancy code for bank
$compta_bank = $obj->account_number;
// Set accountancy code for thirdparty
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
$compta_soc = 'NotDefined';
if ($lineisapurchase > 0)
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
if ($lineisasale > 0)
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
@ -257,10 +259,12 @@ if ($result) {
//var_dump($i);
//var_dump($tabpay);
//var_dump($tabcompany);
// By default
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
$tabtype[$obj->rowid] = 'unknown';
$tabmoreinfo[$obj->rowid] = array();
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
@ -285,6 +289,10 @@ if ($result) {
}
}
if ($links[$key]['type'] == 'withdraw') {
$tabmoreinfo[$obj->rowid]['withdraw']=1;
}
if ($links[$key]['type'] == 'payment') {
$paymentstatic->id = $links[$key]['url_id'];
$paymentstatic->ref = $links[$key]['url_id'];
@ -411,8 +419,30 @@ if ($result) {
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
// If not links were found to know amount on thirdparty, we init it.
if (empty($tabtp[$obj->rowid])) $tabtp[$obj->rowid]['NotDefined']= $tabbq[$obj->rowid][$compta_bank];
// If no links were found to know the amount on thirdparty, we try to guess it.
// This may happens on bank entries without the links lines to 'company'.
if (empty($tabtp[$obj->rowid]) && ! empty($tabmoreinfo[$obj->rowid]['withdraw'])) // If we dont find 'company' link because it is an old 'withdraw' record
{
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'payment') {
// Get thirdparty
$tmppayment->fetch($links[$key]['url_id']);
$arrayofamounts = $tmppayment->getAmountsArray();
foreach($arrayofamounts as $invoiceid => $amount)
{
$tmpinvoice->fetch($invoiceid);
$tmpinvoice->fetch_thirdparty();
if ($tmpinvoice->thirdparty->code_compta)
{
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
}
}
}
}
}
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
if (empty($tabtp[$obj->rowid])) $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
// Check account number is ok
/*if ($action == 'writebookkeeping') // Make test now in such a case
@ -441,11 +471,12 @@ if ($result) {
dol_print_error($db);
}
/*
var_dump($tabpay);
/*var_dump($tabpay);
var_dump($tabcompany);
var_dump($tabbq);
var_dump($tabtp);
*/
var_dump($tabtype);*/
// Write bookkeeping
if (! $error && $action == 'writebookkeeping') {
@ -561,15 +592,15 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->date_create = $now;
if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
$bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp
$bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
$bookkeeping->label_compte = $accountingaccount->label;
} elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
} elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
$bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp
$bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
@ -701,6 +732,7 @@ if (! $error && $action == 'writebookkeeping') {
$totalcredit += $bookkeeping->credit;
$result = $bookkeeping->create($user);
if ($result < 0) {
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
{
@ -931,18 +963,18 @@ if (empty($action) || $action == 'view') {
if ($obj->nb > 0)
{
print '<br>'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>');
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>');
}
}
else dol_print_error($db);
// Button to write into Ledger
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
|| empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
@ -950,8 +982,8 @@ if (empty($action) || $action == 'view') {
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
@ -1071,7 +1103,6 @@ if (empty($action) || $action == 'view') {
if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
$accounttoshow = length_accounta($account_ledger);
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
{
@ -1104,6 +1135,7 @@ if (empty($action) || $action == 'view') {
print "</td>";
// Subledger account
print "<td>";
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary'))) // Type of payment with subledger
{
$accounttoshowsubledger = length_accounta($k);
@ -1115,7 +1147,14 @@ if (empty($action) || $action == 'view') {
var_dump($tabtype[$key]);
var_dump($tabbq[$key]);*/
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").'</span>';
if (! empty($tabcompany[$key]['code_compta']))
{
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
}
else
{
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
}
}
else print $accounttoshowsubledger;
}

View File

@ -87,15 +87,11 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
$idpays = $mysoc->country_id;
$sql = "SELECT er.rowid, er.ref, er.date_debut as de,";
$sql .= " erd.rowid as erdid, erd.comments, erd.total_ht, erd.total_tva, erd.total_localtax1, erd.total_localtax2, erd.tva_tx, erd.total_ttc, erd.fk_code_ventilation, erd.vat_src_code, ";
$sql .= " u.rowid as uid, u.firstname, u.lastname, u.accountancy_code as user_accountancy_account,";
$sql .= " f.accountancy_code, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
//$sql .= " ct.accountancy_code_buy as account_tva";
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
//$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON erd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
$sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
@ -444,10 +440,10 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ($taber as $key => $val) {
$date = dol_print_date($val["date"], 'day');
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
// Fees
foreach ($tabht[$key] as $k => $mt) {
$accountingaccount = new AccountingAccount($db);
@ -474,7 +470,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print "\n";
}
}
// Third party
foreach ($tabttc[$key] as $k => $mt) {
print '"' . $date . '"' . $sep;
@ -510,7 +506,7 @@ if (empty($action) || $action == 'view') {
// Button to write into Ledger
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
@ -585,7 +581,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accountg($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("FeeAccountNotDefined").'</span>';
}
@ -615,7 +611,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
}
@ -624,7 +620,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "<td>";
$accountoshow = length_accounta($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("UserAccountNotDefined").'</span>';
}
@ -652,7 +648,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accountg($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("VATAccountNotDefined").'</span>';
}

View File

@ -92,8 +92,6 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
$idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
@ -745,11 +743,11 @@ if (empty($action) || $action == 'view') {
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
print '<br>';
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {

View File

@ -95,8 +95,6 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
$idpays = $mysoc->country_id;
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
@ -146,7 +144,7 @@ if ($result) {
$num = $db->num_rows($result);
// Variables
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined';
$cptcli = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "")) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined';
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : 'NotDefined';
$i = 0;
@ -679,14 +677,14 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
// Button to write into Ledger
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<br>';
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
@ -813,7 +811,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
}
@ -822,7 +820,7 @@ if (empty($action) || $action == 'view') {
// Subledger account
print "<td>";
$accountoshow = length_accounta($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
}
@ -849,7 +847,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accountg($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("ProductNotDefined").'</span>';
}
@ -884,7 +882,7 @@ if (empty($action) || $action == 'view') {
// Account
print "<td>";
$accountoshow = length_accountg($k);
if (empty($accountoshow) || $accountoshow == 'NotDefined')
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'.'</span>';
}

View File

@ -203,10 +203,10 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -274,10 +274,10 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right">' . price($row[13]) . '</td>';
print '<td class="right"><b>' . price($row[14]) . '</b></td>';
print '<td class="nowrap right">' . price($row[13]) . '</td>';
print '<td class="nowrap right"><b>' . price($row[14]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
@ -329,9 +329,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td class="right">' . price($row[$i]) . '</td>';
print '<td class="nowrap right">' . price($row[$i]) . '</td>';
}
print '<td class="right"><b>' . price($row[13]) . '</b></td>';
print '<td class="nowrap right"><b>' . price($row[13]) . '</b></td>';
print '</tr>';
}
$db->free($resql);

View File

@ -396,7 +396,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="right">' . price($objp->total_ht) . '</td>';
print '<td class="nowrap right">' . price($objp->total_ht) . '</td>';
print '<td class="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';

View File

@ -332,8 +332,8 @@ if ($result) {
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
if ($search_country) $param .= "&search_country=" . urlencode($search_country);
if ($search_tvaintra) $param .= "&search_tvaintra=" . urlencode($search_tvaintra);
if ($search_country) $param.="&search_country=".urlencode($search_country);
if ($search_tvaintra) $param.="&search_tvaintra=".urlencode($search_tvaintra);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@ -382,11 +382,11 @@ if ($result) {
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
print '<td class="liste_titre">';
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1);
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth150', 'code2', 1, 0, 1);
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="' . dol_escape_htmltag($search_tvaintra) . '"></td>';
@ -418,7 +418,7 @@ if ($result) {
print "</tr>\n";
$facturefourn_static = new FactureFournisseur($db);
$productfourn_static = new ProductFournisseur($db);
$product_static = new Product($db);
while ($i < min($num_lines, $limit)) {
$objp = $db->fetch_object($result);
@ -430,10 +430,10 @@ if ($result) {
$objp->code_buy_p = '';
$objp->aarowid_suggest = '';
$productfourn_static->ref = $objp->product_ref;
$productfourn_static->id = $objp->product_id;
$productfourn_static->type = $objp->type;
$productfourn_static->label = $objp->product_label;
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
$product_static->label = $objp->product_label;
$facturefourn_static->ref = $objp->ref;
$facturefourn_static->id = $objp->facid;
@ -479,8 +479,8 @@ if ($result) {
// Ref product
print '<td>';
if ($productfourn_static->id)
print $productfourn_static->getNomUrl(1);
if ($product_static->id > 0)
print $product_static->getNomUrl(1);
if ($objp->product_label) print '<br>'.$objp->product_label;
print '</td>';
@ -491,7 +491,7 @@ if ($result) {
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
print '</td>';
print '<td class="right">';
print '<td class="nowrap right">';
print price($objp->total_ht);
print '</td>';
@ -502,26 +502,38 @@ if ($result) {
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
print '</td>';
print '<td class="center">';
// Country
print '<td>';
$labelcountry=($objp->country_code && ($langs->trans("Country".$objp->country_code)!="Country".$objp->country_code))?$langs->trans("Country".$objp->country_code):$objp->country_label;
print $labelcountry;
print '</td>';
// VAT Num
print '<td>' . $objp->tva_intra . '</td>';
// Current account
print '<td class="center" style="' . $code_buy_p_notset . '">';
print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("Unknown"));
$s = (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")).': ';
$shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp.= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp.= $langs->trans("SaleExport");
$s.= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("NotDefined"));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0)
{
print '<br>';
print (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")) . ' = ' . (empty($objp->code_buy_p) ? $langs->trans("Unknown") : length_accountg($objp->code_buy_p));
print '<br>';
$s = (($objp->type_l == 1)?$langs->trans("ThisService"):$langs->trans("ThisProduct")).': ';
$shelp = '';
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s.= (empty($objp->code_buy_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_buy_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';
// Suggested accounting account
print '<td>';
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
print '</td>';
// Column with checkbox

View File

@ -11,6 +11,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -2403,7 +2404,7 @@ class Adherent extends CommonObject
$this->country_id = 1;
$this->country_code = 'FR';
$this->country = 'France';
$this->morphy = 1;
$this->morphy = 'mor';
$this->email = 'specimen@specimen.com';
$this->skype = 'skypepseudo';
$this->twitter = 'twitterpseudo';
@ -2460,7 +2461,8 @@ class Adherent extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Initialise tableau info (tableau des attributs LDAP)
*
* @return array Tableau info des attributs

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -29,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('membersindex'));
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
@ -435,6 +441,9 @@ print "</div>";
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardMembers', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -81,7 +81,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;
while ($i <= $endyear)
{
@ -96,7 +95,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfSubscriptions"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NbOfSubscriptions"));
@ -116,7 +114,6 @@ $mesg = $px2->isGraphKo();
if (! $mesg)
{
$px2->SetData($data);
$px2->SetPrecisionY(0);
$i=$startyear;
while ($i <= $endyear)
{
@ -131,7 +128,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfSubscriptions"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfSubscriptions"));

View File

@ -75,13 +75,27 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
activateModulesRequiredByCountry($mysoc->country_code);
}
$db->begin();
$tmparray=getState(GETPOST('state_id', 'int'), 'all', $db, $langs, 0);
if (! empty($tmparray['id']))
{
$mysoc->state_id =$tmparray['id'];
$mysoc->state_code =$tmparray['code'];
$mysoc->state_label=$tmparray['label'];
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity);
$s=$mysoc->state_id.':'.$mysoc->state_code.':'.$mysoc->state_label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", $s, 'chaine', 0, '', $conf->entity);
}
else
{
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity);
}
$db->begin();
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity);
@ -375,7 +389,13 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE, $mysoc->country_code, 'state_id');
$state_id=0;
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE))
{
$tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
$state_id=$tmp[0];
}
$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id');
print '</td></tr>'."\n";
@ -764,8 +784,12 @@ else
if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>';
else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT);
else print '&nbsp;';
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE))
{
$tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
$state_id=$tmp[0];
print getState($state_id, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT);
}
print '</td></tr>';

View File

@ -1030,10 +1030,9 @@ if ($id)
if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION))
{
print info_admin($langs->trans("VATIsUsedIsOff", $langs->transnoentities("Setup"), $langs->transnoentities("CompanyFoundation")));
print "<br>\n";
}
print "<br>\n";
// Form to add a new line
if ($tabname[$id])
{

View File

@ -27,6 +27,7 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "stocks"));
@ -77,6 +78,10 @@ llxHeader('', $langs->trans("StockSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup');
$head = stock_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock');
$form=new Form($db);

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/admin/system/database-tables.php
* \brief Page d'infos des tables de la base
* \brief Page with information on database tables
*/
require '../../main.inc.php';
@ -134,7 +134,7 @@ else
print '<td align="right">'.$obj->Auto_increment.'</td>';
print '<td align="right">'.$obj->Check_time.'</td>';
print '<td align="right">'.$obj->Collation;
if (isset($obj->Collation) && ($obj->Collation == "utf8mb4_general_ci" || $obj->Collation == "utf8mb4_unicode_ci"))
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci"))))
{
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
}

View File

@ -4,6 +4,7 @@
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Neil Orley <neil.orley@oeris.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
*
*
* This program is free software; you can redistribute it and/or modify
@ -706,6 +707,127 @@ class Setup extends DolibarrApi
return $list;
}
/**
* Get the list of shipping methods.
*
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
*
* @url GET dictionary/shipping_methods
*
* @return array List of shipping methods
*
* @throws 400 RestException
* @throws 200 OK
*/
public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
$sql = "SELECT rowid as id, code, libelle as label, description, tracking, module";
$sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
$sql.= " WHERE t.entity IN (".getEntity('c_shipment_mode').")";
$sql.= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(400, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
//$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
return $list;
}
/**
* Get the list of measuring units.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number (starting from zero)
* @param int $active Payment term is active or not {@min 0} {@max 1}
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
* @return List of events types
*
* @url GET dictionary/units
*
* @throws RestException
*/
public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
//TODO link with multicurrency module
$sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql.= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(503, 'Error when retrieving list of measuring units: '.$this->db->lasterror());
}
return $list;
}
/**
* Get the list of tickets categories.

View File

@ -163,9 +163,9 @@ class Asset extends CommonObject
*/
//public $class_element_line = 'Assetline';
/**
* @var array Array of child tables (child tables to delete before deleting a record)
* @var array List of child tables. To test if we can delete object.
*/
//protected $childtables=array('assetdet');
//protected $childtables=array();
/**
* @var AssetLine[] Array of subtable lines
*/

View File

@ -39,6 +39,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
/**
* Empty header
*
* @ignore
* @return void
*/
function llxHeader()
@ -48,9 +49,11 @@ function llxHeader()
print '<title>Asterisk redirection from Dolibarr...</title>'."\n";
print '</head>'."\n";
}
/**
* Empty footer
*
* @ignore
* @return void
*/
function llxFooter()

View File

@ -41,12 +41,6 @@ class BOM extends CommonObject
*/
public $table_element = 'bom_bom';
/**
* @var string Name of subtable if this object has sub lines
*/
public $table_element_line = 'bom_bomline';
public $fk_element = 'fk_bom';
/**
* @var int Does bom support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
@ -134,27 +128,32 @@ class BOM extends CommonObject
/**
* @var int Name of subtable line
*/
//public $table_element_line = 'bomdet';
public $table_element_line = 'bom_bomline';
/**
* @var int Field with ID of parent key if this field has a parent
*/
//public $fk_element = 'fk_bom';
public $fk_element = 'fk_bom';
/**
* @var int Name of subtable class that manage subtable lines
*/
//public $class_element_line = 'BillOfMaterialsline';
public $class_element_line = 'BOMLine';
/**
* @var array Array of child tables (child tables to delete before deleting a record)
* @var array List of child tables. To test if we can delete object.
*/
//protected $childtables=array('bomdet');
//protected $childtables=array();
/**
* @var BillOfMaterialsLine[] Array of subtable lines
* @var array List of child tables. To know object to delete on cascade.
*/
//public $lines = array();
protected $childtablesoncascade=array('bom_bomline');
/**
* @var BOMLine[] Array of subtable lines
*/
public $lines = array();
@ -165,7 +164,7 @@ class BOM extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs, $user;
global $conf, $langs;
$this->db = $db;
@ -184,11 +183,11 @@ class BOM extends CommonObject
// Translate some data of arrayofkeyval
foreach($this->fields as $key => $val)
{
if (is_array($this->fields['status']['arrayofkeyval']))
if (is_array($this->fields[$key]['arrayofkeyval']))
{
foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2)
foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2)
{
$this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2);
$this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2);
}
}
}
@ -1066,7 +1065,7 @@ class BOMLine extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs, $user;
global $conf, $langs;
$this->db = $db;
@ -1085,11 +1084,11 @@ class BOMLine extends CommonObject
// Translate some data of arrayofkeyval
foreach($this->fields as $key => $val)
{
if (is_array($this->fields['status']['arrayofkeyval']))
if (is_array($this->fields[$key]['arrayofkeyval']))
{
foreach($this->fields['status']['arrayofkeyval'] as $key2 => $val2)
foreach($this->fields[$key]['arrayofkeyval'] as $key2 => $val2)
{
$this->fields['status']['arrayofkeyval'][$key2]=$langs->trans($val2);
$this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2);
}
}
}

View File

@ -86,7 +86,7 @@ class Categories extends DolibarrApi
throw new RestException(404, 'category not found');
}
if ( ! DolibarrApi::_checkAccessToResource('category', $this->category->id)) {
if ( ! DolibarrApi::_checkAccessToResource('categorie', $this->category->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}

View File

@ -97,15 +97,13 @@ if ($page == -1 || $page == null) { $page = 0 ; }
$offset = $limit * $page ;
if (! $sortorder)
{
$sortorder="DESC";
if ($status == 'todo') $sortorder="DESC";
//if ($status == 'done') $sortorder="DESC";
$sortorder="DESC,DESC";
if ($status == 'todo') $sortorder="DESC,DESC";
}
if (! $sortfield)
{
$sortfield="a.datep";
if ($status == 'todo') $sortfield="a.datep";
//if ($status == 'done') $sortfield="a.datep2";
$sortfield="a.datep,a.id";
if ($status == 'todo') $sortfield="a.datep,a.id";
}
// Security check
@ -500,7 +498,7 @@ if ($resql)
if (! empty($arrayfields['a.label']['checked'])) print_liste_field_titre($arrayfields['a.label']['label'], $_SERVER["PHP_SELF"], "a.label", $param, "", "", $sortfield, $sortorder);
if (! empty($arrayfields['a.note']['checked'])) print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder);
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep", $param, '', 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['a.datep']['checked'])) print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['a.datep2']['checked'])) print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
if (! empty($arrayfields['a.fk_contact']['checked'])) print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "a.fk_contact", $param, "", "", $sortfield, $sortorder);

View File

@ -1186,33 +1186,34 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
}
$ids1='';$ids2='';
if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',', array_keys($cases1[$h]));
if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',', array_keys($cases2[$h]));
$ids1='';
$ids2='';
if (is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',', array_keys($cases1[$h]));
if (is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',', array_keys($cases2[$h]));
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
else echo '<td class="'.$style.' cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
if (count($cases1[$h]) == 1) // only 1 event
if (is_array($cases1[$h]) && count($cases1[$h]) == 1) // only 1 event
{
$output = array_slice($cases1[$h], 0, 1);
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color'];
}
elseif (count($cases1[$h]) > 1)
elseif (is_array($cases1[$h]) && count($cases1[$h]) > 1)
{
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
$color1='222222';
}
if (count($cases2[$h]) == 1) // only 1 event
if (is_array($cases2[$h]) && count($cases2[$h]) == 1) // only 1 event
{
$output = array_slice($cases2[$h], 0, 1);
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color'];
}
elseif (count($cases2[$h]) > 1)
elseif (is_array($cases2[$h]) && count($cases2[$h]) > 1)
{
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
$color2='222222';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -37,6 +38,11 @@ if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn
if (! $user->rights->societe->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('commercialindex'));
// Load translation files required by the page
$langs->loadLangs(array("commercial", "propal"));
@ -897,6 +903,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardCommercials', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('mailingindex'));
// Load translation files required by the page
$langs->loadLangs(array('commercial', 'orders'));
@ -207,6 +213,9 @@ if ($langs->file_exists("html/spam.html", 0)) {
print '<br>';
}
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -27,6 +28,11 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('proposalindex'));
// Load translation files required by the page
$langs->loadLangs(array('propal', 'companies'));
@ -540,6 +546,9 @@ if (! empty($conf->propal->enabled))
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardPropals', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -162,6 +162,8 @@ $arrayfields=array(
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'p.total_ht_invoiced'=>array('label'=>$langs->trans("AmountInvoicedHT"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'p.total_invoiced'=>array('label'=>$langs->trans("AmountInvoicedTTC"), 'checked'=>0, 'enabled'=>$conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
@ -644,6 +646,18 @@ if ($resql)
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
print '</td>';
}
if (! empty($arrayfields['p.total_ht_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['p.total_invoiced']['checked']))
{
// Amount invoiced
print '<td class="liste_titre right">';
print '</td>';
}
if (! empty($arrayfields['u.login']['checked']))
{
// Author
@ -709,6 +723,8 @@ if ($resql)
if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_ht_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_ht_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['p.total_invoiced']['checked'])) print_liste_field_titre($arrayfields['p.total_invoiced']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
// Extra fields
@ -933,6 +949,48 @@ if ($resql)
if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
$totalarray['totalttc'] += $obj->total_ttc;
}
// Amount invoiced
if(! empty($arrayfields['p.total_ht_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ht;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalhtinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalhtinvoiced'] += $totalInvoiced;
}
// Amount invoiced
if(! empty($arrayfields['p.total_invoiced']['checked'])) {
$totalInvoiced = 0;
$p = new Propal($db);
$TInvoiceData = $p->InvoiceArrayList($obj->rowid);
if(! empty($TInvoiceData)) {
foreach($TInvoiceData as $invoiceData) {
$invoice = new Facture($db);
$invoice->fetch($invoiceData->facid);
if(! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) && $invoice->type == Facture::TYPE_DEPOSIT) continue;
$totalInvoiced += $invoice->total_ttc;
}
}
print '<td class="right">'.price($totalInvoiced)."</td>\n";
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalinvoicedfield']=$totalarray['nbfield'];
$totalarray['totalinvoiced'] += $totalInvoiced;
}
$userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login;
@ -1059,6 +1117,8 @@ if ($resql)
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
elseif ($totalarray['totalhtinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalhtinvoiced']).'</td>';
elseif ($totalarray['totalinvoicedfield'] == $i) print '<td class="right">'.price($totalarray['totalinvoiced']).'</td>';
elseif ($totalarray['totalizable']) {
$printed = false;
foreach ($totalarray['totalizable'] as $totalizable) {

View File

@ -110,7 +110,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -125,7 +124,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfProposals"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfProposalsByMonth"));
@ -152,7 +150,6 @@ $mesg = $px2->isGraphKo();
if (! $mesg)
{
$px2->SetData($data);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -167,7 +164,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfProposals"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));
@ -209,7 +205,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -31,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (!$user->rights->commande->lire) accessforbidden();
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('ordersindex'));
// Load translation files required by the page
$langs->loadLangs(array('orders', 'bills'));
@ -478,6 +484,8 @@ if (! empty($conf->commande->enabled))
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardOrders', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();

View File

@ -119,7 +119,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -134,7 +133,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfOrder"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -178,7 +176,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfOrders"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
@ -220,7 +217,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -384,7 +384,6 @@ else
$px1->setBgColor('onglet');
$px1->setBgColorGrid(array(255,255,255));
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->draw($file, $fileurl);
$show1 = $px1->show();
@ -471,7 +470,6 @@ else
$px2->setBgColor('onglet');
$px2->setBgColorGrid(array(255,255,255));
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->draw($file, $fileurl);
$show2 = $px2->show();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
@ -45,6 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
@ -366,6 +367,7 @@ $formaccounting = new FormAccounting($db);
$companystatic=new Societe($db);
$bankaccountstatic=new Account($db);
$banktransferstatic=new BonPrelevement($db);
$societestatic=new Societe($db);
$userstatic=new User($db);
$chargestatic=new ChargeSociales($db);
@ -1135,7 +1137,13 @@ if ($resql)
$cachebankaccount=array();
foreach($links as $key=>$val)
{
if ($links[$key]['type']=='payment')
if ($links[$key]['type']=='withdraw')
{
$banktransferstatic->id=$links[$key]['url_id'];
$banktransferstatic->ref=$links[$key]['label'];
print ' '.$banktransferstatic->getNomUrl(0);
}
elseif ($links[$key]['type']=='payment')
{
$paymentstatic->id=$links[$key]['url_id'];
$paymentstatic->ref=$links[$key]['url_id']; // FIXME This is id, not ref of payment

View File

@ -252,7 +252,6 @@ else
$px1->setBgColor('onglet');
$px1->setBgColorGrid(array(255,255,255));
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->draw($file, $fileurl);
$show1=$px1->show();
@ -389,7 +388,6 @@ else
$px2->setBgColorGrid(array(255,255,255));
$px2->SetHideXGrid(true);
//$px2->SetHorizTickIncrement(30.41); // 30.41 jours/mois en moyenne
$px2->SetPrecisionY(0);
$px2->draw($file, $fileurl);
$show2=$px2->show();
@ -503,7 +501,6 @@ else
$px3->SetType(array('linesnopoint','linesnopoint','linesnopoint'));
$px3->setBgColor('onglet');
$px3->setBgColorGrid(array(255,255,255));
$px3->SetPrecisionY(0);
$px3->draw($file, $fileurl);
$show3=$px3->show();
@ -633,7 +630,6 @@ else
$px4->setBgColor('onglet');
$px4->setBgColorGrid(array(255,255,255));
$px4->SetHorizTickIncrement(1);
$px4->SetPrecisionY(0);
$px4->draw($file, $fileurl);
$show4=$px4->show();
@ -742,7 +738,6 @@ else
$px5->setBgColor('onglet');
$px5->setBgColorGrid(array(255,255,255));
$px5->SetHorizTickIncrement(1);
$px5->SetPrecisionY(0);
$px5->draw($file, $fileurl);
$show5=$px5->show();

View File

@ -293,9 +293,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
}else print "<td></td>";
}
print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { print "<td class=\"right\">".price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td class=\"right\">".price($total_ttc)."</td>"; };
print '<td class="right">'.price($solde).'</td>';
if ($obj->total_ttc < 0) { print '<td class="nowrap right">'.price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print '<td>&nbsp;</td><td class="nowrap right">'.price($total_ttc)."</td>"; };
print '<td class="nowrap right">'.price($solde).'</td>';
print "</tr>";
}

View File

@ -382,7 +382,7 @@ if ($action == 'create')
}
else
{
print '<input type="text" name="subledger_account" value="'.$subledger_account.'">';
print '<input type="text" class="maxwidth200" name="subledger_account" value="'.$subledger_account.'">';
}
print '</td></tr>';
}

View File

@ -3,8 +3,9 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -34,6 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('specialexpensesindex'));
// Load translation files required by the page
$langs->loadLangs(array('compta', 'bills'));
@ -568,6 +575,9 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
print '</form>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardSpecialBills', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -107,7 +107,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -121,7 +120,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("Number"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberByMonth"));
@ -155,7 +153,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("Amount"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountTotal"));
@ -197,7 +194,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -1295,7 +1295,6 @@ if (empty($reshook))
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
}
$amount_to_diff = 0;
foreach ($TTotalByTva as $tva => &$total)
{
$coef = $total / $srcobject->total_ttc; // Calc coef

View File

@ -1298,6 +1298,7 @@ if ($resql)
$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->creer;
$title = '';
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}

View File

@ -103,7 +103,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -117,7 +116,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -152,7 +150,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfBills"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
@ -194,7 +191,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -2,10 +2,11 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -63,6 +64,7 @@ if ($user->societe_id > 0)
$max=3;
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('invoiceindex'));
/*
@ -1080,6 +1082,9 @@ if ($resql)
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardAccountancy', $parameters, $object); // Note that $action and $object may have been modified by hook
// End of page
llxFooter();
$db->close();

View File

@ -123,7 +123,7 @@ if ($result)
{
$num = $db->num_rows($result);
// les variables
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)?$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef"));
$cptfour = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "")?$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)?$conf->global->ACCOUNTING_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
$tabfac = array();
@ -139,7 +139,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
// contrôles
$compta_soc = (! empty($obj->code_compta_fournisseur)?$obj->code_compta_fournisseur:$cptfour);
$compta_soc = (($obj->code_compta_fournisseur != "")?$obj->code_compta_fournisseur:$cptfour);
$compta_prod = $obj->accountancy_code_buy;
if (empty($compta_prod))
{

View File

@ -146,7 +146,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
// les variables
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)?$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef"));
$cptcli = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "")?$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER:$langs->trans("CodeNotDef"));
$compta_soc = (! empty($obj->code_compta)?$obj->code_compta:$cptcli);
$compta_prod = $obj->accountancy_code_sell;
if (empty($compta_prod))

View File

@ -991,16 +991,16 @@ class Paiement extends CommonObject
}
/**
* Retourne la liste des factures sur lesquels porte le paiement
* Return list of invoices the payment is related to.
*
* @param string $filter Critere de filtre
* @return array Tableau des id de factures
* @param string $filter Filter
* @return int|array <0 if KO or array of invoice id
*/
public function getBillsArray($filter = '')
{
$sql = 'SELECT fk_facture';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f';
$sql.= ' WHERE pf.fk_facture = f.rowid AND fk_paiement = '.$this->id;
$sql = 'SELECT pf.fk_facture';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f'; // We keep link on invoice to allow use of some filters on invoice
$sql.= ' WHERE pf.fk_facture = f.rowid AND pf.fk_paiement = '.$this->id;
if ($filter) $sql.= ' AND '.$filter;
$resql = $this->db->query($sql);
if ($resql)
@ -1026,6 +1026,40 @@ class Paiement extends CommonObject
}
}
/**
* Return list of amounts of payments.
*
* @return int|array Array of amount of payments
*/
public function getAmountsArray()
{
$sql = 'SELECT pf.fk_facture, pf.amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
$sql.= ' WHERE pf.fk_paiement = '.$this->id;
$resql = $this->db->query($sql);
if ($resql)
{
$i=0;
$num=$this->db->num_rows($resql);
$amounts = array();
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$amounts[$obj->fk_facture]=$obj->amount;
$i++;
}
return $amounts;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this).'::getAmountsArray Error '.$this->error.' -', LOG_DEBUG);
return -1;
}
}
/**
* Return next reference of customer invoice not already used (or last reference)
* according to numbering module defined into constant FACTURE_ADDON

View File

@ -1174,28 +1174,72 @@ class BonPrelevement extends CommonObject
/**
* Returns clickable name (with picto)
*
* @param int $withpicto link with picto
* @param string $option link target
* @return string URL of target
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string URL of target
*/
public function getNomUrl($withpicto = 0, $option = '')
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $langs;
global $conf, $langs, $hookmanager;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result='';
$label = $langs->trans("ShowWithdraw").': '.$this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$label = '<u>' . $langs->trans("ShowWithdraw") . '</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
if ($option == 'xxx')
$url = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id;
if ($option != 'nolink')
{
$link = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
$result.=$link.$this->ref.$linkend;
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowMyObject");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
/*
$hookmanager->initHooks(array('myobjectdao'));
$parameters=array('id'=>$this->id);
$reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
*/
}
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
$result .= $linkend;
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action,$hookmanager;
$hookmanager->initHooks(array('myobjectdao'));
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
$reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint;
else $result .= $hookmanager->resPrint;
return $result;
}

View File

@ -943,7 +943,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
print "</td>";
print '<td class="borderrightlight right">&nbsp;';
print '<td class="borderrightlight nowrap right">&nbsp;';
if ($modecompta == 'BOOKKEEPING')
{
if (isset($encaiss[$case]))
@ -978,8 +978,8 @@ print '</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$nbcols+=2;
print '<td class="right">'.(isset($totsorties[$annee])?price(price2num($totsorties[$annee], 'MT')):'&nbsp;').'</td>';
print '<td class="right" style="border-right: 1px solid #DDD">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee], 'MT')):'&nbsp;').'</td>';
print '<td class="nowrap right">'.(isset($totsorties[$annee])?price(price2num($totsorties[$annee], 'MT')):'&nbsp;').'</td>';
print '<td class="nowrap right" style="border-right: 1px solid #DDD">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee], 'MT')):'&nbsp;').'</td>';
}
print "</tr>\n";

View File

@ -83,7 +83,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -97,7 +96,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("Number"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberByMonth"));
@ -131,7 +129,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("Amount"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountTotal"));
@ -163,7 +160,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));

View File

@ -9,6 +9,7 @@
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -520,6 +521,7 @@ class Contact extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Initialise tableau info (tableau des attributs LDAP)
*

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
@ -28,6 +29,11 @@ require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('contractindex'));
// Load translation files required by the page
$langs->loadLangs(array('products', 'companies', 'contracts'));
@ -609,6 +615,8 @@ else
//print '</td></tr></table>';
print '</div></div></div>';
$parameters = array('user' => $user);
$reshook = $hookmanager->executeHooks('dashboardContracts', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();

View File

@ -422,7 +422,7 @@ class box_activity extends ModeleBoxes
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency),
);
$this->info_box_contents[$line][4] = array(

View File

@ -146,7 +146,7 @@ class box_commandes extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);

View File

@ -151,7 +151,7 @@ class box_factures_fourn_imp extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);

View File

@ -161,7 +161,7 @@ class box_factures_imp extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'td' => 'class="nowrap right"',
'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency),
);

View File

@ -143,7 +143,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -157,7 +156,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -183,7 +181,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px2->SetData($data2);
unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -197,7 +194,6 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));

View File

@ -140,7 +140,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -154,7 +153,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
@ -180,7 +178,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px2->SetData($data2);
unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -194,7 +191,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));

View File

@ -141,7 +141,6 @@ class box_graph_orders_permonth extends ModeleBoxes
{
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -155,7 +154,6 @@ class box_graph_orders_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfOrders"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -179,7 +177,6 @@ class box_graph_orders_permonth extends ModeleBoxes
{
$px2->SetData($data2);
unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -193,7 +190,6 @@ class box_graph_orders_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfOrdersHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));

View File

@ -140,7 +140,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -154,7 +153,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfOrders"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
@ -178,7 +176,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
{
$px2->SetData($data2);
unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -192,7 +189,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfOrdersHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));

View File

@ -171,7 +171,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data1);
if ($nocolor) $px1->SetDataColor(array(array(220,220,220)));
$px1->SetPrecisionY(0);
$px1->SetLegend($legend);
$px1->setShowLegend(0);
$px1->setShowPointValue($showpointvalue);
@ -182,7 +181,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px1->SetYLabel($langs->trans("NumberOfBills"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
//$px1->mode='depth';
$px1->SetType(array('pie'));
@ -231,7 +229,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data2);
if ($nocolor) $px2->SetDataColor(array(array(220,220,220)));
$px2->SetPrecisionY(0);
$px2->SetLegend($legend);
$px2->setShowLegend(0);
$px2->setShowPointValue($showpointvalue);
@ -242,7 +239,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px2->SetYLabel($langs->trans("AmountOfBillsHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
//$px2->mode='depth';
$px2->SetType(array('pie'));
@ -292,7 +288,6 @@ class box_graph_product_distribution extends ModeleBoxes
unset($data3);
if ($nocolor) $px3->SetDataColor(array(array(220,220,220)));
$px3->SetPrecisionY(0);
$px3->SetLegend($legend);
$px3->setShowLegend(0);
$px3->setShowPointValue($showpointvalue);
@ -303,7 +298,6 @@ class box_graph_product_distribution extends ModeleBoxes
//$px3->SetYLabel($langs->trans("AmountOfBillsHT"));
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
$px3->SetPrecisionY(0);
$px3->SetCssPrefix("cssboxes");
//$px3->mode='depth';
$px3->SetType(array('pie'));

View File

@ -141,7 +141,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px1->SetType($datatype1);
$px1->SetData($data1);
unset($data1);
$px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -155,7 +154,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px1->SetYLabel($langs->trans("NumberOfProposals"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
$px1->SetPrecisionY(0);
$px1->SetCssPrefix("cssboxes");
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfProposalsByMonth"));
@ -182,7 +180,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px2->SetType($datatype2);
$px2->SetData($data2);
unset($data2);
$px2->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@ -196,7 +193,6 @@ class box_graph_propales_permonth extends ModeleBoxes
$px2->SetYLabel($langs->trans("AmountOfProposalsHT"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
$px2->SetPrecisionY(0);
$px2->SetCssPrefix("cssboxes");
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfProposalsByMonthHT"));

View File

@ -47,8 +47,8 @@ class Ccountry // extends CommonObject
*/
public $errors = array();
//var $element='ccountry'; //!< Id that identify managed objects
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored
public $element='ccountry'; //!< Id that identify managed objects
public $table_element='c_country'; //!< Name of table without prefix where object is stored
/**
* @var int ID
@ -65,7 +65,9 @@ class Ccountry // extends CommonObject
public $active;
public $fields=array(
'label' => array('type'=>'varchar(250)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>15, 'notnull'=>-1, 'showoncombobox'=>'1')
);
/**

View File

@ -7490,7 +7490,7 @@ abstract class CommonObject
$this->db->begin();
if ($forcechilddeletion)
if ($forcechilddeletion) // Force also delete of childtables that should lock deletion in standard case when option force is off
{
foreach($this->childtables as $table)
{
@ -7518,6 +7518,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 (! $error) {
if (! $notrigger) {
// Call triggers

View File

@ -25,6 +25,10 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
// TODO Remove this class (used in Expensereportik and ExpenseReportRule
/**
* CoreObject
*/
class CoreObject extends CommonObject
{
public $withChild = true;
@ -175,7 +179,7 @@ class CoreObject extends CommonObject
*/
public function fetchChild()
{
if($this->withChild && !empty($this->childtables) && !empty($this->fk_element))
if ($this->withChild && !empty($this->childtables) && !empty($this->fk_element))
{
foreach($this->childtables as &$childTable)
{

View File

@ -47,14 +47,20 @@ class DolGraph
public $data; // Data of graph: array(array('abs1',valA1,valB1), array('abs2',valA2,valB2), ...)
public $title; // Title of graph
public $cssprefix=''; // To add into css styles
/**
* @var int|string Width of graph. It can be a numeric for pixels or a string like '100%'
*/
public $width=380;
/**
* @var int Height of graph
*/
public $height=200;
public $MaxValue=0;
public $MinValue=0;
public $SetShading=0;
public $PrecisionY=-1;
public $horizTickIncrement=-1;
public $SetNumXTicks=-1;
public $labelInterval=-1;
@ -108,7 +114,6 @@ class DolGraph
if (! $isgdinstalled)
{
$this->error="Error: PHP GD module is not available. It is required to build graphics.";
return -1;
}
}
@ -134,11 +139,11 @@ class DolGraph
*
* @param float $which_prec Precision
* @return boolean
* @deprecated
*/
public function SetPrecisionY($which_prec)
{
// phpcs:enable
$this->PrecisionY = $which_prec;
return true;
}
@ -883,6 +888,7 @@ class DolGraph
private function draw_jflot($file, $fileurl)
{
// phpcs:enable
global $langs;
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',', $this->type)." this->MaxValue=".$this->MaxValue);

View File

@ -131,9 +131,9 @@ class EmailSenderProfile extends CommonObject
*/
//public $class_element_line = 'EmailSenderProfileline';
/**
* @var array Array of child tables (child tables to delete before deleting a record)
* @var array List of child tables. To test if we can delete object.
*/
//protected $childtables=array('emailsenderprofiledet');
//protected $childtables=array();
/**
* @var EmailSenderProfileLine[] Array of subtable lines
*/

View File

@ -5234,10 +5234,12 @@ class Form
* @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
* @param string $addplusone Add a link "+1 hour". Value must be name of another selectDate field.
* @param datetime $adddateof Add a link "Date of invoice" using the following date.
* @param string $openinghours Specify hour strat and hour end for the select ex 8,20
* @param int $stepminutes Specify step for minutes between 1 and 30
* @return string Html for selectDate
* @see form_date(), select_month(), select_year(), select_dayofweek()
*/
public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '')
public function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '', $openinghours = '', $stepminutes = 1)
{
global $conf,$langs;
@ -5248,6 +5250,7 @@ class Form
if ($m == '') $m=0;
$emptydate=0;
$emptyhours=0;
if ($stepminutes<=0 || $stepminutes>30) $stepminutes = 1;
if ($empty == 1) { $emptydate=1; $emptyhours=1; }
if ($empty == 2) { $emptydate=0; $emptyhours=1; }
$orig_set_time=$set_time;
@ -5468,10 +5471,18 @@ class Form
if ($h)
{
$hourstart = 0;
$hourend = 24;
if ($openinghours != '') {
$openinghours = explode(',', $openinghours);
$hourstart = $openinghours[0];
$hourend = $openinghours[1];
if ($hourend<$hourstart) $hourend = $hourstart;
}
// Show hour
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'hour':'').'" id="'.$prefix.'hour" name="'.$prefix.'hour">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++)
for ($hour = $hourstart; $hour < $hourend; $hour++)
{
if (strlen($hour) < 2) $hour = "0" . $hour;
$retstring.='<option value="'.$hour.'"'.(($hour == $shour)?' selected':'').'>'.$hour.(empty($conf->dol_optimize_smallscreen)?'':'H').'</option>';
@ -5485,7 +5496,7 @@ class Form
// Show minutes
$retstring.='<select'.($disabled?' disabled':'').' class="flat valignmiddle maxwidth50 '.($fullday?$fullday.'min':'').'" id="'.$prefix.'min" name="'.$prefix.'min">';
if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++)
for ($min = 0; $min < 60 ; $min+=$stepminutes)
{
if (strlen($min) < 2) $min = "0" . $min;
$retstring.='<option value="'.$min.'"'.(($min == $smin)?' selected':'').'>'.$min.(empty($conf->dol_optimize_smallscreen)?'':'').'</option>';

View File

@ -21,7 +21,7 @@
/**
* \file htdocs/core/class/html.formaccounting.class.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief File of class with all html predefined components
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
@ -392,7 +392,7 @@ class FormAccounting extends Form
$resql = $this->db->query($sql);
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
if (!empty($obj->code_compta_fournisseur)) {
if ($obj->code_compta_fournisseur != "") {
$aux_account[$obj->code_compta_fournisseur] = $obj->code_compta_fournisseur.' ('.$obj->nom.')';
}
}

View File

@ -211,13 +211,13 @@ class FormCompany
* The key of the list is the code (there can be several entries for a given code but in this case, the country field differs).
* Thus the links with the departments are done on a department independently of its name.
*
* @param string $selected Code state preselected (mus be state id)
* @param int $selected Code state preselected (mus be state id)
* @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show
* @param string $htmlname Id of department. If '', we want only the string with <option>
* @return string String with HTML select
* @see select_country()
*/
public function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id')
public function select_state($selected = 0, $country_codeid = 0, $htmlname = 'state_id')
{
// phpcs:enable
global $conf,$langs,$user;

View File

@ -160,10 +160,10 @@ abstract class DoliDB implements Database
}
/**
* Annulation d'une transaction et retour aux anciennes valeurs
* Cancel a transaction and go back to initial data values
*
* @param string $log Add more log to default log line
* @return resource|int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
* @return resource|int 1 if cancelation is ok or transaction not open, 0 if error
*/
public function rollback($log = '')
{

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,10 +20,28 @@
/**
* \file htdocs/core/lib/accounting.lib.php
* \ingroup Advanced accountancy
* \ingroup Accountancy (Double entries)
* \brief Library of accountancy functions
*/
/**
* Check if a value is empty with some options
*
* @author Michael - https://www.php.net/manual/fr/function.empty.php#90767
* @param mixed $var Value to test
* @param int|null $allow_false Setting this to true will make the function consider a boolean value of false as NOT empty. This parameter is false by default.
* @param int|null $allow_ws Setting this to true will make the function consider a string with nothing but white space as NOT empty. This parameter is false by default.
* @return boolean True of False
*/
function is_empty($var, $allow_false = false, $allow_ws = false)
{
if (!isset($var) || is_null($var) || ($allow_ws == false && trim($var) == "" && !is_bool($var)) || ($allow_false === false && is_bool($var) && $var === false) || (is_array($var) && empty($var))) {
return true;
}
return false;
}
/**
* Prepare array with list of tabs
*
@ -75,12 +94,12 @@ function length_accountg($account)
{
global $conf;
if ($account < 0 || empty($account)) return '';
if ($account < 0 || is_empty($account)) return '';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account;
if (! is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account;
$g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT;
if (! empty($g)) {
if (! is_empty($g)) {
// Clean parameters
$i = strlen($account);
@ -110,12 +129,12 @@ function length_accounta($accounta)
{
global $conf;
if ($accounta < 0 || empty($accounta)) return '';
if ($accounta < 0 || is_empty($accounta)) return '';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta;
if (! is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta;
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
if (! empty($a)) {
if (! is_empty($a)) {
// Clean parameters
$i = strlen($accounta);
@ -158,7 +177,7 @@ function journalHead($nom, $variante, $period, $periodlink, $description, $build
print "\n\n<!-- debut cartouche journal -->\n";
if(! empty($varlink)) $varlink = '?'.$varlink;
if(! is_empty($varlink)) $varlink = '?'.$varlink;
$head=array();
$h=0;

View File

@ -649,6 +649,8 @@ function getFormeJuridiqueLabel($code)
*/
function getCountriesInEEC()
{
global $conf;
// List of all country codes that are in europe for european vat rules
// List found on http://ec.europa.eu/taxation_customs/common/faq/faq_1179_en.htm#9
$country_code_in_EEC=array(
@ -687,6 +689,12 @@ function getCountriesInEEC()
//'CH', // Switzerland - No. Swizerland in not in EEC
);
if (! empty($conf->global->MAIN_COUNTRIES_IN_EEC))
{
// For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK'
$country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC);
}
return $country_code_in_EEC;
}
@ -1513,7 +1521,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$out.=getTitleFieldOfList($langs->trans("Type"));
$out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
$out.=getTitleFieldOfList('');
$out.=getTitleFieldOfList($langs->trans("RelatedObjects"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');

View File

@ -739,8 +739,8 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
global $conf,$user;
if (! is_object($objsoc)) $valueforccc=$objsoc;
elseif ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur;
else $valueforccc=$objsoc->code_client;
elseif ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=dol_string_unaccent($objsoc->code_fournisseur);
else $valueforccc=dol_string_unaccent($objsoc->code_client);
$sharetable = $table;
if ($table == 'facture' || $table == 'invoice') $sharetable = 'invoicenumber'; // for getEntity function
@ -988,6 +988,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// Define $maskLike
$maskLike = dol_string_nospecial($mask);
$maskLike = str_replace("%", "_", $maskLike);
// Replace protected special codes with matching number of _ as wild card caracter
$maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike);
$maskLike = preg_replace('/\{yy\}/i', '__', $maskLike);
@ -1163,7 +1164,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// Now we replace the refclient
if ($maskrefclient)
{
//print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode."\n<br>";
//print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskrefclient_clientcode=".$maskrefclient_clientcode."\n<br>";exit;
$maskrefclient_maskbefore='{'.$maskrefclient.'}';
$maskrefclient_maskafter=$maskrefclient_clientcode.str_pad($maskrefclient_counter, dol_strlen($maskrefclient_maskcounter), "0", STR_PAD_LEFT);
$numFinal = str_replace($maskrefclient_maskbefore, $maskrefclient_maskafter, $numFinal);

View File

@ -172,14 +172,21 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
* For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'
*
* @param string $url Full URL.
* @param int $mode 0=return 'mydomain', 1=return 'mydomain.com'
* @param int $mode 0=return 'mydomain', 1=return 'mydomain.com', 2=return 'abc.mydomain.com'
* @return string Returns domaine name
*/
function getDomainFromURL($url, $mode = 0)
{
$tmpdomain = preg_replace('/^https?:\/\//i', '', $url); // Remove http(s)://
$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after domain
$tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)$/', '\1.\2', $tmpdomain); // Remove part www.abc before domain name
if ($mode == 2)
{
$tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)\.([^\.]+)$/', '\1.\2.\3', $tmpdomain); // Remove part 'www.' before 'abc.mydomain.com'
}
else
{
$tmpdomain = preg_replace('/^.*\.([^\.]+)\.([^\.]+)$/', '\1.\2', $tmpdomain); // Remove part 'www.abc.' before 'mydomain.com'
}
if (empty($mode))
{
$tmpdomain = preg_replace('/\.[^\.]+$/', '', $tmpdomain); // Remove first level domain (.com, .net, ...)

View File

@ -175,18 +175,29 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P')
/**
* Return if pdf file is protected/encrypted
*
* @param TCPDF $pdf PDF initialized object
* @param string $pathoffile Path of file
* @return boolean True or false
*/
function pdf_getEncryption(&$pdf, $pathoffile)
function pdf_getEncryption($pathoffile)
{
require_once TCPDF_PATH.'tcpdf_parser.php';
$isencrypted = false;
$pdfparser = $pdf->_getPdfParser($pathoffile);
$data = $pdfparser->getParsedData();
if (isset($data[0]['trailer'][1]['/Encrypt'])) {
$isencrypted = true;
$content = file_get_contents($pathoffile);
//ob_start();
@($parser = new \TCPDF_PARSER(ltrim($content)));
list($xref, $data) = $parser->getParsedData();
unset($parser);
//ob_end_clean();
if (isset($xref['trailer']['encrypt'])) {
$isencrypted = true; // Secured pdf file are currently not supported
}
if (empty($data)) {
$isencrypted = true; // Object list not found. Possible secured file
}
return $isencrypted;

View File

@ -78,3 +78,36 @@ function stock_prepare_head($object)
return $head;
}
/**
* Return array head with list of tabs to view object informations.
*
* @return array head array with tabs
*/
function stock_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/stock.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'stock_admin', 'remove');
return $head;
}

View File

@ -1307,6 +1307,14 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && ! empty($object->thirdparty->code_client))
{
$posy+=4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{

View File

@ -240,7 +240,7 @@ class modAccounting extends DolibarrModules
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Chartofaccounts';
$this->export_icon[$r]='Accounting';
$this->export_icon[$r]='accounting';
$this->export_permission[$r]=array(array("accounting","chartofaccount"));
$this->export_fields_array[$r]=array('ac.rowid'=>'ChartofaccountsId','ac.pcg_version'=>'Chartofaccounts','aa.rowid'=>'Id','aa.account_number'=>"AccountAccounting",'aa.label'=>"Label",'aa.account_parent'=>"Accountparent",'aa.pcg_type'=>"Pcgtype",'aa.pcg_subtype'=>'Pcgsubtype','aa.active'=>'Status');
$this->export_TypeFields_array[$r]=array('ac.rowid'=>'List:accounting_system:pcg_version','aa.account_number'=>"Text",'aa.label'=>"Text",'aa.account_parent'=>"Text",'aa.pcg_type'=>'Text','aa.pcg_subtype'=>'Text','aa.active'=>'Status');

View File

@ -274,20 +274,22 @@ class modAdherent extends DolibarrModules
'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",
'a.photo'=>"Photo",'a.note_public'=>"NotePublic",'a.note_private'=>"NotePrivate",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation',
'a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel',
'c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.subscription'=>'Amount'
'c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.datef'=>'DateEndSubscription','c.subscription'=>'Amount'
);
$this->export_TypeFields_array[$r]=array(
'a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.gender'=>'Text','a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",
'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",
'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date',
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle::member_type','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle::member_type','ta.libelle'=>'Text',
'c.rowid'=>'Numeric','c.dateadh'=>'Date','c.datef'=>'Date','c.subscription'=>'Numeric'
);
$this->export_entities_array[$r]=array(
'a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.gender'=>'member','a.morphy'=>'member',
'a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",
'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",
'a.photo'=>"member",'a.note_public'=>"member",'a.note_private'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member',
'a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.subscription'=>'subscription'
'a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type',
'c.rowid'=>'subscription','c.dateadh'=>'subscription','c.datef'=>'subscription','c.subscription'=>'subscription'
);
// Add extra fields
$keyforselect='adherent'; $keyforelement='member'; $keyforaliasextra='extra';

View File

@ -51,7 +51,7 @@ class modCommande extends DolibarrModules
$this->numero = 25;
$this->family = "crm";
$this->module_position = '30';
$this->module_position = '23';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Gestion des commandes clients";

View File

@ -42,6 +42,7 @@ class modDynamicPrices extends DolibarrModules
$this->numero = 2200;
$this->family = "products";
$this->module_position = '85';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Enable the usage of math expressions for prices";

View File

@ -44,7 +44,7 @@ class modExpenseReport extends DolibarrModules
$this->numero = 770;
$this->family = "hr";
$this->module_position = '40';
$this->module_position = '42';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)

View File

@ -218,7 +218,7 @@ class modFacture extends DolibarrModules
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus',
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
'fd.subprice'=>"LineUnitPrice", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.total_ht'=>"LineTotalHT", 'fd.total_tva'=>"LineTotalVAT",
'fd.total_ttc'=>"LineTotalTTC", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
'fd.product_type'=>"TypeOfLineServiceOrProduct", 'fd.fk_product'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel',
@ -232,21 +232,31 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT))
{
$this->export_fields_array[$r]['f.module_source']='POSModule';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal';
}
$this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric',
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
'pj.ref'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric",
'pj.ref'=>'Text', 'pj.title'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric",
'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_tva'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date",
'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text',
'p.accountancy_code_sell'=>'Text'
);
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT))
{
$this->export_TypeFields_array[$r]['f.module_source']='Text';
$this->export_TypeFields_array[$r]['f.pos_source']='Text';
}
$this->export_entities_array[$r] = array(
's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company',
's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'company', 's.phone'=>'company',
's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company',
's.tva_intra'=>'company', 'pj.ref'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line",
's.tva_intra'=>'company', 'pj.ref'=>'project', 'pj.title'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line",
'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line",
'fd.qty'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>'invoice_line',
'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product', 'p.ref'=>'product', 'p.label'=>'product', 'p.accountancy_code_sell'=>'product',
@ -292,7 +302,7 @@ class modFacture extends DolibarrModules
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus',
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef',
'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef',
'p.amount'=>'AmountPayment', 'pf.amount'=>'AmountPaymentDistributedOnInvoice', 'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber',
'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef'
);
@ -304,19 +314,29 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
}
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT))
{
$this->export_fields_array[$r]['f.module_source']='POSModule';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal';
}
$this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status',
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric',
'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.title'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric',
'p.fk_bank'=>'Numeric', 'p.note'=>'Text', 'pt.code'=>'Text', 'pt.libelle'=>'text', 'ba.ref'=>'Text'
);
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT))
{
$this->export_fields_array[$r]['f.module_source']='POSModule';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal';
}
$this->export_entities_array[$r] = array(
's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company',
's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'company', 's.phone'=>'company',
's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company',
's.tva_intra'=>'company', 'pj.ref'=>'project', 'p.rowid'=>'payment', 'p.ref'=>'payment', 'p.amount'=>'payment', 'pf.amount'=>'payment', 'p.datep'=>'payment',
's.tva_intra'=>'company', 'pj.ref'=>'project', 'p.title'=>'project', 'p.rowid'=>'payment', 'p.ref'=>'payment', 'p.amount'=>'payment', 'pf.amount'=>'payment', 'p.datep'=>'payment',
'p.num_paiement'=>'payment', 'pt.code'=>'payment', 'pt.libelle'=>'payment', 'p.note'=>'payment', 'f.fk_user_author'=>'user', 'uc.login'=>'user',
'f.fk_user_valid'=>'user', 'uv.login'=>'user', 'p.fk_bank'=>'account', 'ba.ref'=>'account'
);

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