From 253f7e252d9b16ef6d720466192a3bc795184924 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Mon, 10 Jul 2017 13:15:14 +1100 Subject: [PATCH 1/6] Fixes local taxes repports by rate --- htdocs/compta/localtax/quadri_detail.php | 16 ++++++------ htdocs/core/lib/tax.lib.php | 31 ++++++++++++++++-------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 175ff6cf98f..b7d8b1d6bad 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -54,8 +54,9 @@ if (empty($year)) $year_current = $year; $year_start = $year; } -$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); -$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]); + +$date_start = dol_mktime( 0, 0, 0, GETPOST( "date_startmonth" ), GETPOST( "date_startday" ), GETPOST( "date_startyear" ) ); +$date_end = dol_mktime( 23, 59, 59, GETPOST( "date_endmonth" ), GETPOST( "date_endday" ), GETPOST( "date_endyear" ) ); // Quarter if (empty($date_start) || empty($date_end)) // We define date_start and date_end { @@ -92,12 +93,9 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); - - -/* +/** * View */ - $morequerystring=''; $listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday'); foreach($listofparams as $param) @@ -118,6 +116,7 @@ $paymentfourn_static=new PaiementFourn($db); $fsearch.=' '; $fsearch.=' '; +$fsearch.=' '; $calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local; @@ -196,9 +195,8 @@ $total = 0; $i=0; // Load arrays of datas -$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); -$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy'); - +$x_coll = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'sell'); +$x_paye = tax_by_date('localtax' . $local, $db, 0, 0, $date_start, $date_end, $modetax, 'buy'); echo ''; diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 0fc401f0280..38ff0ed73f7 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -186,6 +186,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction * to report the amounts for different VAT rates as different lines. * This function also accounts recurrent invoices. * + * @param string $type Tax type, either vat, 'localtax1' or 'localtax2'. Default to 'vat' * @param DoliDB $db Database handler object * @param int $y Year * @param int $q Quarter @@ -196,7 +197,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction * @param int $m Month * @return array List of quarters with vat */ -function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) +function tax_by_date($type='vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) { global $conf; @@ -210,8 +211,6 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $fk_facture2='fk_facture'; $fk_payment='fk_paiement'; $total_tva='total_tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; $paymenttable='paiement'; $paymentfacturetable='paiement_facture'; $invoicefieldref='facnumber'; @@ -224,13 +223,20 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $fk_facture2='fk_facturefourn'; $fk_payment='fk_paiementfourn'; $total_tva='tva'; - $total_localtax1='total_localtax1'; - $total_localtax2='total_localtax2'; $paymenttable='paiementfourn'; $paymentfacturetable='paiementfourn_facturefourn'; $invoicefieldref='ref'; } + if ( strpos( $type, 'localtax' ) === 0 ) { + $f_rate = $type . '_tx'; + } else { + $f_rate = 'tva_tx'; + } + + $total_localtax1='total_localtax1'; + $total_localtax2='total_localtax2'; + // CAS DES BIENS // Define sql request @@ -238,7 +244,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -273,7 +279,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, else // Option vat on delivery for goods (payments) and payments for services { // Count on delivery date (use invoice date as delivery is unknown) - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef as date_f, s.nom as company_name, s.rowid as company_id,"; @@ -378,7 +384,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { // Count on invoice date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -413,7 +419,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, else // Option vat on delivery for goods (payments) and payments for services { // Count on payments date - $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; + $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; $sql .=" d.".$total_localtax1." as total_localtax1, d.".$total_localtax2." as total_localtax2, "; $sql.= " d.date_start as date_start, d.date_end as date_end,"; $sql.= " f.".$invoicefieldref." as facnum, f.type, f.total_ttc as ftotal_ttc, f.datef, s.nom as company_name, s.rowid as company_id,"; @@ -522,7 +528,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; // Count on payments date - $sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; + $sql = "SELECT e.rowid, d.product_type as dtype, e.rowid as facid, d.$f_rate as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.total_tva as total_vat, e.note_private as descr,"; $sql .=" d.total_localtax1 as total_localtax1, d.total_localtax2 as total_localtax2, "; $sql.= " e.date_debut as date_start, e.date_fin as date_end,"; $sql.= " e.ref as facnum, e.total_ttc as ftotal_ttc, e.date_create, s.nom as company_name, s.rowid as company_id, d.fk_c_type_fees as type,"; @@ -622,3 +628,8 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, return $list; } +function vat_by_date ($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) +{ + return tax_by_date('vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m); +} + From 244574f8e6d576f5e22c7d33b13730a4e1217f54 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Mon, 10 Jul 2017 13:19:59 +1100 Subject: [PATCH 2/6] Fixes functions comments --- htdocs/core/lib/tax.lib.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 38ff0ed73f7..802919af619 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -181,9 +181,9 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } /** - * Gets VAT to collect for the given year (and given quarter or month) - * The function gets the VAT in split results, as the VAT declaration asks - * to report the amounts for different VAT rates as different lines. + * Gets Tax to collect for the given year (and given quarter or month) + * The function gets the Tax in split results, as the Tax declaration asks + * to report the amounts for different Tax rates as different lines. * This function also accounts recurrent invoices. * * @param string $type Tax type, either vat, 'localtax1' or 'localtax2'. Default to 'vat' @@ -628,6 +628,22 @@ function tax_by_date($type='vat', $db, $y, $q, $date_start, $date_end, $modetax, return $list; } +/** + * Gets VAT to collect for the given year (and given quarter or month) + * The function gets the VAT in split results, as the VAT declaration asks + * to report the amounts for different VAT rates as different lines. + * This function also accounts recurrent invoices. + * + * @param DoliDB $db Database handler object + * @param int $y Year + * @param int $q Quarter + * @param string $date_start Start date + * @param string $date_end End date + * @param int $modetax 0 or 1 (option vat on debit) + * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * @param int $m Month + * @return array List of quarters with vat + */ function vat_by_date ($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) { return tax_by_date('vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m); From 64a5be3e0092fccfc1fd43bef9d9f4d5fb045737 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Mon, 10 Jul 2017 14:14:21 +1100 Subject: [PATCH 3/6] Fixes travis error: Arguments with default values must be at the end of the argument list --- htdocs/core/lib/tax.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 802919af619..805adb9d796 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -186,7 +186,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction * to report the amounts for different Tax rates as different lines. * This function also accounts recurrent invoices. * - * @param string $type Tax type, either vat, 'localtax1' or 'localtax2'. Default to 'vat' + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' * @param DoliDB $db Database handler object * @param int $y Year * @param int $q Quarter @@ -197,7 +197,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction * @param int $m Month * @return array List of quarters with vat */ -function tax_by_date($type='vat', $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) +function tax_by_date($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) { global $conf; From 017b654acd8c2a956d13c162b39ba2f58accc1f7 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 11 Jul 2017 17:45:16 +0200 Subject: [PATCH 4/6] FIX PgSQL --- .../install/mysql/migration/4.0.0-5.0.0.sql | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 5f62c766a01..76c8f6df672 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -134,7 +134,7 @@ CREATE TABLE llx_product_lot_extrafields ALTER TABLE llx_product_lot_extrafields ADD INDEX idx_product_lot_extrafields (fk_object); -ALTER TABLE llx_website_page MODIFY content MEDIUMTEXT; +ALTER TABLE llx_website_page MODIFY COLUMN content MEDIUMTEXT; CREATE TABLE llx_product_warehouse_properties ( @@ -160,7 +160,7 @@ ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (accou ALTER TABLE llx_expensereport_det ADD COLUMN fk_code_ventilation integer DEFAULT 0; -ALTER TABLE llx_c_payment_term change fdm type_cdr tinyint; +ALTER TABLE llx_c_payment_term CHANGE COLUMN fdm type_cdr tinyint; ALTER TABLE llx_facturedet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx; @@ -173,11 +173,10 @@ ALTER TABLE llx_supplier_proposaldet ADD COLUMN vat_src_code varchar(10) DEFAULT ALTER TABLE llx_supplier_proposaldet ADD COLUMN fk_unit integer DEFAULT NULL; ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx; -ALTER TABLE llx_c_payment_term change fdm type_cdr tinyint; +ALTER TABLE llx_c_payment_term CHANGE COLUMN fdm type_cdr TINYINT; ALTER TABLE llx_entrepot ADD COLUMN fk_parent integer DEFAULT 0; - create table llx_resource_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -206,6 +205,8 @@ ALTER TABLE llx_overwrite_trans ADD COLUMN entity integer DEFAULT 1 NOT NULL AFT ALTER TABLE llx_mailing_cibles ADD COLUMN error_text varchar(255); ALTER TABLE llx_c_actioncomm MODIFY COLUMN type varchar(50) DEFAULT 'system' NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_c_actioncomm ALTER COLUMN type SET DEFAULT 'system'; +-- VPGSQL8.2 ALTER TABLE llx_c_actioncomm ALTER COLUMN type SET NOT NULL; create table llx_user_employment ( @@ -240,12 +241,12 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_app DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm); -- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate. -drop table tmp_links_double; +DROP TABLE tmp_links_double; --select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2; -create table tmp_links_double as (select objectid, label, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_links where label is not null group by objectid, label having count(rowid) >= 2); +CREATE TABLE tmp_links_double AS (SELECT objectid, label, MAX(rowid) AS max_rowid, COUNT(rowid) AS count_rowid FROM llx_links WHERE label IS NOT NULL GROUP BY objectid, label HAVING COUNT(rowid) >= 2); --select * from tmp_links_double; -delete from llx_links where (rowid, label) in (select max_rowid, label from tmp_links_double); --update to avoid duplicate, delete to delete -drop table tmp_links_double; +DELETE FROM llx_links WHERE (rowid, label) IN (SELECT max_rowid, label FROM tmp_links_double); --update to avoid duplicate, delete to delete +DROP TABLE tmp_links_double; ALTER TABLE llx_links ADD UNIQUE INDEX uk_links (objectid,label); @@ -256,8 +257,7 @@ ALTER TABLE llx_projet_task ADD UNIQUE INDEX uk_projet_task_ref (ref, entity); ALTER TABLE llx_contrat ADD COLUMN fk_user_modif integer; - -update llx_accounting_account set account_parent = 0 where account_parent = ''; +UPDATE llx_accounting_account SET account_parent = 0 WHERE account_parent = ''; -- VMYSQL4.3 ALTER TABLE llx_product_price MODIFY COLUMN date_price DATETIME NULL; -- VPGSQL8.2 ALTER TABLE llx_product_price ALTER COLUMN date_price DROP NOT NULL; @@ -268,10 +268,8 @@ ALTER TABLE llx_product_customer_price ADD COLUMN default_vat_code varchar(10) a ALTER TABLE llx_product_customer_price_log ADD COLUMN default_vat_code varchar(10) after tva_tx; ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx; - ALTER TABLE llx_events MODIFY COLUMN ip varchar(250); - UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur'; UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client'; From cd3d18cb4d36d7f0874ee61110857495cc70463f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jul 2017 14:16:51 +0200 Subject: [PATCH 5/6] Fix detection of payment for credit note --- htdocs/accountancy/journal/bankjournal.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index cba6f5b3987..05e54c7c167 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -169,9 +169,9 @@ if ($result) { // Set accountancy code (for bank and thirdparty) $compta_bank = $obj->account_number; - if ($obj->label == '(SupplierInvoicePayment)') + if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier); - if ($obj->label == '(CustomerInvoicePayment)') + if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer); $tabcompany[$obj->rowid] = array ( @@ -542,10 +542,10 @@ if ($action == 'export_csv') { $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $reflabel = $val["ref"]; - if ($reflabel == '(SupplierInvoicePayment)') { + if ($reflabel == '(SupplierInvoicePayment)' || $reflabel == '(SupplierInvoicePaymentBack)') { $reflabel = $langs->trans('Supplier'); } - if ($reflabel == '(CustomerInvoicePayment)') { + if ($reflabel == '(CustomerInvoicePayment)' || $reflabel == '(CustomerInvoicePaymentBack)') { $reflabel = $langs->trans('Customer'); } if ($reflabel == '(SocialContributionPayment)') { @@ -769,10 +769,10 @@ if (empty($action) || $action == 'view') { $date = dol_print_date($db->jdate($val["date"]), 'day'); $reflabel = $val["ref"]; - if ($reflabel == '(SupplierInvoicePayment)') { + if ($reflabel == '(SupplierInvoicePayment)' || $reflabel == '(SupplierInvoicePaymentBack)') { $reflabel = $langs->trans('Supplier'); } - if ($reflabel == '(CustomerInvoicePayment)') { + if ($reflabel == '(CustomerInvoicePayment)' || $reflabel == '(CustomerInvoicePaymentBack)') { $reflabel = $langs->trans('Customer'); } if ($reflabel == '(SocialContributionPayment)') { From 24ecd48b22e5fbfa2e0a81a6ab4ab18fef1d8639 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Jul 2017 03:40:20 +0200 Subject: [PATCH 6/6] Minor fix --- htdocs/compta/bank/bankentries.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index c3afc9634cf..f1ba166001e 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -102,7 +102,7 @@ $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); $pageplusone = GETPOST("pageplusone",'int'); if ($pageplusone) $page = $pageplusone - 1; -if ($page == -1) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -130,7 +130,7 @@ if ($id > 0 || ! empty($ref)) $contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id); //var_dump($contextpage); -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('banktransactionlist', $contextpage)); $extrafields = new ExtraFields($db); @@ -580,6 +580,7 @@ if ($resql) print ''; print ''; print ''; + print ''; print ''; print ''; if (GETPOST('bid')) print ''; @@ -1212,6 +1213,7 @@ if ($resql) { print ''; } + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['b.num_releve']['checked']))
-