Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
grandoc committed Aug 1, 2019
2 parents 0baea71 + d7a41c6 commit b32dbbf
Show file tree
Hide file tree
Showing 124 changed files with 2,473 additions and 803 deletions.
6 changes: 6 additions & 0 deletions .scrutinizer.yml
@@ -1,6 +1,12 @@
# .scrutinizer.yml
#build:
# - php-scrutinizer-run
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

imports:
- javascript
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Expand Up @@ -32,7 +32,7 @@ PSR/simple-cache ? Library for cache (used by PHPSp
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
Sabre 3.2.2 BSD Yes DAV support
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
Stripe 6.35 MIT licence Yes Library for Stripe module
Stripe 6.41 MIT licence Yes Library for Stripe module
TCPDF 6.2.25 LGPL-3+ Yes PDF generation
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement

Expand Down
6 changes: 3 additions & 3 deletions htdocs/accountancy/bookkeeping/card.php
Expand Up @@ -641,8 +641,8 @@
print '<td>' . $accountingaccount->getNomUrl(0, 1, 1, '', 0) . '</td>';
print '<td>' . length_accounta($line->subledger_account) . '</td>';
print '<td>' . $line->label_operation. '</td>';
print '<td class="right">' . price($line->debit) . '</td>';
print '<td class="right">' . price($line->credit) . '</td>';
print '<td class="nowrap right">' . price($line->debit) . '</td>';
print '<td class="nowrap right">' . price($line->credit) . '</td>';

print '<td class="center">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">';
Expand Down Expand Up @@ -675,7 +675,7 @@
print $formaccounting->select_account('', 'accountingaccount_number', 1, array (), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/accountancy/bookkeeping/list.php
Expand Up @@ -789,7 +789,7 @@
// Amount debit
if (! empty($arrayfields['t.debit']['checked']))
{
print '<td class="right">' . ($line->debit ? price($line->debit) : ''). '</td>';
print '<td class="nowrap right">' . ($line->debit ? price($line->debit) : ''). '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totaldebitfield']=$totalarray['nbfield'];
$totalarray['totaldebit'] += $line->debit;
Expand All @@ -798,7 +798,7 @@
// Amount credit
if (! empty($arrayfields['t.credit']['checked']))
{
print '<td class="right">' . ($line->credit ? price($line->credit) : '') . '</td>';
print '<td class="nowrap right">' . ($line->credit ? price($line->credit) : '') . '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalcreditfield']=$totalarray['nbfield'];
$totalarray['totalcredit'] += $line->credit;
Expand Down Expand Up @@ -879,8 +879,8 @@
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
}
elseif ($totalarray['totaldebitfield'] == $i) print '<td class="right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="right">'.price($totalarray['totalcredit']).'</td>';
elseif ($totalarray['totaldebitfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totalcredit']).'</td>';
else print '<td></td>';
}
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
Expand Down
112 changes: 108 additions & 4 deletions htdocs/accountancy/class/accountancyexport.class.php
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
Expand Down Expand Up @@ -50,6 +50,7 @@ class AccountancyExport
public static $EXPORT_TYPE_SAGE50_SWISS = 45;
public static $EXPORT_TYPE_QUADRATUS = 60;
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_FEC = 1000;


Expand Down Expand Up @@ -105,6 +106,7 @@ public static function getType()
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
);

Expand Down Expand Up @@ -133,6 +135,7 @@ private static function getFormatCode($type)
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
self::$EXPORT_TYPE_FEC => 'fec',
);

Expand Down Expand Up @@ -191,6 +194,10 @@ public static function getTypeConfig()
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_LDCOMPTA => array(
'label' => $langs->trans('Modelcsv_LDCompta'),
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
),
self::$EXPORT_TYPE_FEC => array(
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
Expand Down Expand Up @@ -257,12 +264,15 @@ public function export(&$TData)
case self::$EXPORT_TYPE_OPENCONCERTO :
$this->exportOpenConcerto($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
case self::$EXPORT_TYPE_SAGE50_SWISS :
$this->exportSAGE50SWISS($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA :
$this->exportLDCompta($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
default:
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
break;
Expand Down Expand Up @@ -909,6 +919,100 @@ public function exportSAGE50SWISS($objectLines)
}
}

/**
* Export format : LD Compta version 9 & higher
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW10.pdf
*
* @param array $objectLines data
*
* @return void
*/
public function exportLDCompta($objectLines)
{

$separator = ';';
$end_line = "\n";

foreach ($objectLines as $line) {

$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');

// TYPE
$type_enregistrement = 'E'; // For write movement
print $type_enregistrement . $separator;
// JNAL
print substr($line->code_journal, 0, 2) . $separator;
// NECR
print $line->id . $separator;
// NPIE
print $line->piece_num . $separator;
// DATP
print $date_document . $separator;
// LIBE
print $line->label_operation . $separator;
// DATH
print $line->date_lim_reglement . $separator;
// CNPI
if ($line->doc_type == 'supplier_invoice') {
if ($line->montant < 0) {
$nature_piece = 'AF';
} else {
$nature_piece = 'FF';
}
} elseif ($line->doc_type == 'customer_invoice') {
if ($line->montant < 0) {
$nature_piece = 'AC';
} else {
$nature_piece = 'FC';
}
} else {
$nature_piece = '';
}
print $nature_piece . $separator;
// RACI
/*
if (! empty($line->subledger_account)) {
if ($line->doc_type == 'supplier_invoice') {
$racine_subledger_account = '40';
} elseif ($line->doc_type == 'customer_invoice') {
$racine_subledger_account = '41';
} else {
$nature_piece = '';
}
print $racine_subledger_account . $separator;
} else {
print $separator;
}
*/
// MONT
print price(abs($line->montant)) . $separator;
// CODC
print $line->sens . $separator;
// CPTG
print length_accountg($line->numero_compte) . $separator;
// DATE
print $date_creation . $separator;
// CLET
print $line->lettering_code . $separator;
// DATL
print $line->date_lettering . $separator;
// CPTA
if (! empty($line->subledger_account)) {
print length_accounta($line->subledger_account) . $separator;
}
// CNAT
if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) {
print 'F';
} elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) {
print 'C';
} else {
print '';
}
print $end_line;
}
}

/**
* trunc
*
Expand Down
7 changes: 4 additions & 3 deletions htdocs/accountancy/class/bookkeeping.class.php
Expand Up @@ -469,14 +469,15 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss
*/
public function createStd(User $user, $notrigger = false, $mode = '')
{
global $conf;
global $conf, $langs;

$langs->loadLangs(array("accountancy", "bills", "compta"));

dol_syslog(__METHOD__, LOG_DEBUG);

$error = 0;

// Clean parameters

if (isset($this->doc_type)) {
$this->doc_type = trim($this->doc_type);
}
Expand Down Expand Up @@ -540,7 +541,7 @@ public function createStd(User $user, $notrigger = false, $mode = '')
$now = dol_now();

// Check parameters
// Put here code to add control on parameters values
$this->journal_label = $langs->trans($this->journal_label);

// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.' (';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/card.php
Expand Up @@ -1187,7 +1187,7 @@ function initfieldrequired()
}
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy", 'alpha'):$object->morphy));
print "</td></tr>";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/ldap.php
Expand Up @@ -182,7 +182,7 @@
if (empty($dn))
{
$langs->load("errors");
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font></td></tr>';
print '<tr '.$bc[false].'><td colspan="2"><font class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).'</font></td></tr>';
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/type.php
Expand Up @@ -342,7 +342,7 @@
// Morphy
$morphys[""] = $langs->trans("MorPhy");
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
print "</td></tr>";
Expand Down Expand Up @@ -775,7 +775,7 @@
// Morphy
$morphys[""] = $langs->trans("MorPhy");
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy);
print "</td></tr>";
Expand Down
8 changes: 4 additions & 4 deletions htdocs/admin/clicktodial.php
Expand Up @@ -37,12 +37,12 @@
/*
* Actions
*/

if ($action == 'setvalue' && $user->admin)
{
$result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
$result1=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
$result2=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);

if ($result1 >= 0 && $result2 >= 0)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
Expand Down

0 comments on commit b32dbbf

Please sign in to comment.