diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 6cdb19b3fb5..218af698be1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -232,14 +232,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); - } - else if ($value == 'entity') { + if ($value == 'entity') { $_POST[$listfieldvalue[$i]] = $conf->entity; } if ($i) $sql.=","; - if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + if ($_POST[$listfieldvalue[$i]] == '' && ! $listfieldvalue[$i] == 'formula') $sql.="null"; // For vat, we want/accept code = '' else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index efd5abc5a82..5934ca71afb 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -85,7 +85,6 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $name=$langs->trans("PurchasesJournal"); -$namelink=''; $periodlink=''; $exportlink=''; $builddate=dol_now(); @@ -94,7 +93,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $ else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index cc5b7472d88..f4b027b5016 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -89,7 +89,6 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $nom=$langs->trans("SellsJournal"); -$namelink=''; $periodlink=''; $exportlink=''; $builddate=dol_now(); @@ -97,7 +96,7 @@ $description=$langs->trans("DescSellsJournal").'
'; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); else $description.= $langs->trans("DepositsAreIncluded"); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink); $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); $idpays = $p[0]; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index c5226aa3055..70d52c3d9d3 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -142,7 +142,7 @@ if ($calc==2) // Invoice for goods, payment for services $productsup=$langs->trans("Description"); $amountsup=$langs->trans("AmountHT"); } -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 0053a152633..5e18c786c18 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -177,7 +177,7 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services $vatsup=$langs->trans("VATPaid"); if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); if($local==1){ diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 05290fee1e9..4c5be71ff88 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -147,7 +147,6 @@ llxHeader(); $form=new Form($db); -$namelink=''; $periodlink=''; $exportlink=''; @@ -200,7 +199,7 @@ elseif ($modecompta=="BOOKKEEPING") $hselected = 'report'; -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 40ab4f9e752..0e058513571 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -113,7 +113,6 @@ llxHeader(); $form=new Form($db); -$namelink=''; $exportlink=''; // Affiche en-tete du rapport @@ -160,7 +159,7 @@ else if ($modecompta=="BOOKKEEPING") $hselected='report'; -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 3a8752219f9..b59466e5239 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -194,7 +194,6 @@ else if ($modecompta=="BOOKKEEPING") $calcmode=$langs->trans("CalcModeBookkeeping"); //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $nomlink = ''; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period.='     '.$langs->trans("DetailByAccount").' '. $form->selectyesno('showaccountdetail',$showaccountdetail,0); $periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ; @@ -206,7 +205,7 @@ else if ($modecompta=="BOOKKEEPING") $builddate=dol_now(); } -report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode); +report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode); if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') @@ -259,10 +258,10 @@ else if ($modecompta=="BOOKKEEPING") $formula = $cat['formula']; - print ""; + print ''; // Year NP - print ''; + print ''; print $cat['code']; print ''; print $cat['label']; @@ -283,7 +282,7 @@ else if ($modecompta=="BOOKKEEPING") $r = dol_eval($result, 1); //var_dump($r); - print '' . price($r) . ''; + print '' . price($r) . ''; // Year N $code = $cat['code']; // code of categorie ('VTE', 'MAR', ...) @@ -301,7 +300,7 @@ else if ($modecompta=="BOOKKEEPING") //$r = $AccCat->calculate($result); $r = dol_eval($result, 1); - print '' . price($r) . ''; + print '' . price($r) . ''; $sommes[$code]['N'] += $r; // Detail by month @@ -315,7 +314,7 @@ else if ($modecompta=="BOOKKEEPING") //$r = $AccCat->calculate($result); $r = dol_eval($result, 1); - print '' . price($r) . ''; + print '' . price($r) . ''; $sommes[$code]['M'][$k] += $r; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index ae6b178f8dd..276f801d05b 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -220,7 +220,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index bb42298f577..c622881d273 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -210,7 +210,7 @@ if ($modetax==0) // Invoice for goods, payment for services if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; } -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php index 209e38e2a53..4c054923837 100644 --- a/htdocs/compta/tva/quarter_report.php +++ b/htdocs/compta/tva/quarter_report.php @@ -244,7 +244,7 @@ if ($modetax==0) { // Invoice for goods, payment for services $vatsup.=' ('.$langs->trans("ToGetBack").')'; } } -report_header($name,$namelink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); +report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); $vatcust=$langs->trans("VATReceived"); $vatsup=$langs->trans("VATPaid"); diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index b84b8d77e47..475fbaa48d5 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -24,10 +24,10 @@ /** - * Show header of a VAT report + * Show header of a report * - * @param string $nom Name of report - * @param string $variante Link for alternate report + * @param string $reportname Name of report + * @param string $notused Not used * @param string $period Period of report * @param string $periodlink Link to switch period * @param string $description Description @@ -38,13 +38,13 @@ * @param string $varlink Add a variable into the address of the page * @return void */ -function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') +function report_header($reportname,$notused,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') { global $langs; if (empty($hselected)) $hselected='report'; - print "\n\n\n"; + print "\n\n\n"; if(! empty($varlink)) $varlink = '?'.$varlink; @@ -53,23 +53,25 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat $head[$h][1] = $langs->trans("Report"); $head[$h][2] = 'report'; + print '
'; + dol_fiche_head($head, 'report'); - print ''; foreach($moreparam as $key => $value) { print ''; } print ''; + $variante = ($periodlink || $exportlink); + // Ligne de titre print ''; print ''; - if (! $variantexxx) print ''; + if ($variante) print ''; print ''; // Calculation mode @@ -77,10 +79,9 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat { print ''; print ''; - if (! $variante) print ''; print ''; print ''; } @@ -88,35 +89,37 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat // Ligne de la periode d'analyse du rapport print ''; print ''; - if (! $periodlink) print ''; print ''; print ''; // Ligne de description print ''; print ''; - print ''; + print ''; + if ($variante) print ''; print ''; // Ligne d'export print ''; print ''; - if (! $exportlink) print ''; + print ''; + if ($variante) print ''; + print ''; print '
'.$langs->trans("ReportName").''; - else print ''; - print $nom; - if ($variantexxx) print ''.$variantexxx; + print ''; + print $reportname; print '
'.$langs->trans("CalculationMode").''; - else print ''; + print ''; print $calcmode; - if ($variante) print ''.$variante; + if ($variante) print '
'.$langs->trans("ReportPeriod").''; - else print ''; + print ''; if ($period) print $period; - if ($periodlink) print ''.$periodlink; + if ($variante) print ''.$periodlink.'
'.$langs->trans("ReportDescription").''.$description.''.$description.'
'.$langs->trans("GeneratedOn").''; - else print ''; + print ''; print dol_print_date($builddate, 'dayhour'); - if ($exportlink) print ''.$langs->trans("Export").''.$exportlink; - print '
'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'
'; - print '
'; - print '
'; - dol_fiche_end(); - print "\n\n\n"; + print '
'; + + print ''; + print '
'; + + print "\n\n\n"; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 7712386d30a..0d4b95c319a 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -31,7 +31,7 @@ ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account JournalizationInLedgerStatus=Status of journalization AlreadyInGeneralLedger=Already journalized in ledgers NotYetInGeneralLedger=Not yet journalized in ledgers -GroupIsEmptyCheckSetup=Group is empty, check setup of the accounting group +GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group DetailByAccount=Show detail by account MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup