Merge pull request #21255 from aspangaro/16b4-php8_1
PHP 8 in social contribution
This commit is contained in:
commit
313cff77d0
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -254,6 +255,7 @@ if ($action == 'create') {
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
$total_ttc = 0;
|
||||||
$totalrecu = 0;
|
$totalrecu = 0;
|
||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -134,7 +135,7 @@ print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("Pa
|
|||||||
print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_payment.'</td></tr>';
|
print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_payment.'</td></tr>';
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -53,6 +53,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
|||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||||
|
$lineid = GETPOST('lineid', 'int');
|
||||||
|
|
||||||
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -544,7 +545,7 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
// Clean data
|
// Clean data
|
||||||
$this->num_payment = trim($this->num_payment);
|
$this->num_payment = trim($this->num_payment);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2021-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,6 +49,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 's
|
|||||||
|
|
||||||
$search_ref = GETPOST('search_ref', 'int');
|
$search_ref = GETPOST('search_ref', 'int');
|
||||||
$search_label = GETPOST('search_label', 'alpha');
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
|
$search_typeid = GETPOST('search_typeid', 'int');
|
||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
$search_status = GETPOST('search_status', 'int');
|
$search_status = GETPOST('search_status', 'int');
|
||||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||||
@ -93,19 +94,6 @@ if (!$sortorder) {
|
|||||||
|
|
||||||
$filtre = GETPOST("filtre", 'int');
|
$filtre = GETPOST("filtre", 'int');
|
||||||
|
|
||||||
if (!GETPOSTISSET('search_typeid')) {
|
|
||||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
|
||||||
$filterarray = explode('-', $newfiltre);
|
|
||||||
foreach ($filterarray as $val) {
|
|
||||||
$part = explode(':', $val);
|
|
||||||
if ($part[0] == 'cs.fk_type') {
|
|
||||||
$search_typeid = $part[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$search_typeid = GETPOST('search_typeid', 'int');
|
|
||||||
}
|
|
||||||
|
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
|
'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
|
||||||
'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20),
|
'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20),
|
||||||
@ -388,6 +376,9 @@ if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
|||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
$massactionbutton = '';
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
if ($massactionbutton) {
|
if ($massactionbutton) {
|
||||||
@ -552,6 +543,8 @@ print '</tr>';
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = $TLoadedUsers = array();
|
$totalarray = $TLoadedUsers = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
$totalarray['val']['totalttcfield'] = 0;
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2011-2022 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) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||||
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$hookmanager = new HookManager($db);
|
$hookmanager = new HookManager($db);
|
||||||
|
|
||||||
@ -48,6 +51,7 @@ $langs->loadLangs(array('compta', 'bills', 'hrm'));
|
|||||||
|
|
||||||
$year = GETPOST("year", 'int');
|
$year = GETPOST("year", 'int');
|
||||||
$search_sc_type = GETPOST('search_sc_type', 'int');
|
$search_sc_type = GETPOST('search_sc_type', 'int');
|
||||||
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
@ -123,6 +127,9 @@ if ($year) {
|
|||||||
if ($search_sc_type) {
|
if ($search_sc_type) {
|
||||||
$param .= '&search_sc_type='.urlencode($search_sc_type);
|
$param .= '&search_sc_type='.urlencode($search_sc_type);
|
||||||
}
|
}
|
||||||
|
if ($optioncss != '') {
|
||||||
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
|
}
|
||||||
$num = 0;
|
$num = 0;
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -139,14 +146,16 @@ $sql = "SELECT c.id, c.libelle as type_label,";
|
|||||||
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
|
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
|
||||||
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
|
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||||
$sql .= " pct.code as payment_code,";
|
$sql .= " pct.code as payment_code,";
|
||||||
$sql .= " u.rowid uid, u.lastname, u.firstname, u.email, u.login, u.admin,";
|
$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,";
|
||||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos";
|
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
|
||||||
|
$sql .= " aj.label as account_journal";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON ba.fk_accountancy_journal = aj.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = cs.fk_user";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = cs.fk_user";
|
||||||
$sql .= " WHERE cs.fk_type = c.id";
|
$sql .= " WHERE cs.fk_type = c.id";
|
||||||
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
||||||
@ -278,7 +287,7 @@ while ($i < min($num, $limit)) {
|
|||||||
print $socialcontrib->getNomUrl(1, '');
|
print $socialcontrib->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Type
|
// Type
|
||||||
print '<td title="'.dol_escape_htmltag($obj->label).'" class="tdoverflowmax300">'.$obj->label.'</td>';
|
print '<td title="'.dol_escape_htmltag($obj->label_sc).'" class="tdoverflowmax300">'.$obj->label_sc.'</td>';
|
||||||
// Date
|
// Date
|
||||||
$date = $obj->periode;
|
$date = $obj->periode;
|
||||||
if (empty($date)) {
|
if (empty($date)) {
|
||||||
@ -297,8 +306,7 @@ while ($i < min($num, $limit)) {
|
|||||||
$userstatic->admin = $obj->admin;
|
$userstatic->admin = $obj->admin;
|
||||||
$userstatic->login = $obj->login;
|
$userstatic->login = $obj->login;
|
||||||
$userstatic->email = $obj->email;
|
$userstatic->email = $obj->email;
|
||||||
$userstatic->socid = $obj->fk_soc;
|
$userstatic->statut = $obj->statut;
|
||||||
$userstatic->statut = $obj->status;
|
|
||||||
print $userstatic->getNomUrl(1);
|
print $userstatic->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
@ -327,13 +335,16 @@ while ($i < min($num, $limit)) {
|
|||||||
$accountstatic->id = $obj->bid;
|
$accountstatic->id = $obj->bid;
|
||||||
$accountstatic->ref = $obj->bref;
|
$accountstatic->ref = $obj->bref;
|
||||||
$accountstatic->number = $obj->bnumber;
|
$accountstatic->number = $obj->bnumber;
|
||||||
$accountstatic->accountancy_number = $obj->account_number;
|
|
||||||
$accountstatic->accountancy_journal = $obj->accountancy_journal;
|
|
||||||
$accountstatic->label = $obj->blabel;
|
$accountstatic->label = $obj->blabel;
|
||||||
$accountstatic->iban = $obj->iban;
|
$accountstatic->iban = $obj->iban;
|
||||||
$accountstatic->bic = $obj->bic;
|
$accountstatic->bic = $obj->bic;
|
||||||
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
|
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
|
||||||
$accountstatic->clos = $obj->clos;
|
$accountstatic->clos = $obj->clos;
|
||||||
|
|
||||||
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
$accountstatic->account_number = $obj->account_number;
|
||||||
|
$accountstatic->accountancy_journal = $obj->account_journal;
|
||||||
|
}
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
print ' ';
|
print ' ';
|
||||||
@ -356,7 +367,6 @@ while ($i < min($num, $limit)) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$total = $total + $obj->total;
|
$total = $total + $obj->total;
|
||||||
$totalnb = $totalnb + $obj->nb;
|
|
||||||
$totalpaid = $totalpaid + $obj->totalpaid;
|
$totalpaid = $totalpaid + $obj->totalpaid;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user