Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
4ffa48d9bd
@ -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')
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -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>';
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -931,7 +931,7 @@ 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);
|
||||
@ -942,7 +942,7 @@ if (empty($action) || $action == 'view') {
|
||||
|| ($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>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -510,7 +510,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">';
|
||||
|
||||
|
||||
@ -745,7 +745,7 @@ 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();" />';
|
||||
|
||||
@ -682,7 +682,7 @@ if (empty($action) || $action == 'view') {
|
||||
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();" />';
|
||||
|
||||
@ -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])
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -24,21 +24,22 @@
|
||||
* \brief Library of accountancy functions
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Check if a value is empty with some options
|
||||
*
|
||||
* @param 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 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.
|
||||
* @param 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 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 array Bool
|
||||
* @author Michael - https://www.php.net/manual/fr/function.empty.php#90767
|
||||
* @author Michael - https://www.php.net/manual/fr/function.empty.php#90767
|
||||
*/
|
||||
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;
|
||||
} else {
|
||||
return 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
|
||||
|
||||
@ -100,7 +100,7 @@ NotReconciled=Not reconciled
|
||||
CustomerInvoicePayment=Customer payment
|
||||
SupplierInvoicePayment=Vendor payment
|
||||
SubscriptionPayment=Subscription payment
|
||||
WithdrawalPayment=Withdrawal payment
|
||||
WithdrawalPayment=Debit payment order
|
||||
SocialContributionPayment=Social/fiscal tax payment
|
||||
BankTransfer=Bank transfer
|
||||
BankTransfers=Bank transfers
|
||||
|
||||
@ -69,8 +69,8 @@ WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT
|
||||
BankToReceiveWithdraw=Receiving Bank Account
|
||||
CreditDate=Credit on
|
||||
WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country %s (Your country is not supported)
|
||||
ShowWithdraw=Show Withdraw
|
||||
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one withdrawal payment not yet processed, it won't be set as paid to allow prior withdrawal management.
|
||||
ShowWithdraw=Show Direct Debit Order
|
||||
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management.
|
||||
DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When payment order is closed, payment on invoice will be automatically recorded, and invoice closed if remainder to pay is null.
|
||||
WithdrawalFile=Withdrawal file
|
||||
SetToStatusSent=Set to status "File Sent"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user