Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2020-05-15 11:55:31 +00:00
parent a660fd61c9
commit 9699ee7263
9 changed files with 52 additions and 52 deletions

View File

@ -296,23 +296,23 @@ if ($action != 'export_csv')
}
print '<tr class="oddeven">';
if(!empty($show_subgroup))
if (!empty($show_subgroup))
{
// Permet d'afficher le compte comptable
if (empty($displayed_account) || $root_account_description != $displayed_account) {
// Affiche un Sous-Total par compte comptable
if ($displayed_account != "") {
print '<tr class="liste_total"><td class="right" colspan="3">' . $langs->trans("SubTotal") . ':</td>';
print '<td class="nowrap right">' . price($sous_total_debit) . '</td>';
print '<td class="nowrap right">' . price($sous_total_credit) . '</td>';
print '<td class="nowrap right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
print "<td></td>\n";
print '</tr>';
}
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '</td>';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_description;
@ -337,9 +337,9 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
if(!empty($show_subgroup))
if (!empty($show_subgroup))
{
print '<tr class="liste_total"><td class="right" colspan="3">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print "<td></td>\n";
print '</tr>';
}

View File

@ -712,11 +712,11 @@ if (!empty($date_start) && !empty($date_stop))
print '<td aling="left">'.$data['paid'].'</td>';
// Total ET
print '<td align="right">'.price($data['sens']?$data['amount_ht']:-$data['amount_ht'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."</td>\n";
// Total IT
print '<td align="right">'.price($data['sens']?$data['amount_ttc']:-$data['amount_ttc'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."</td>\n";
// Total VAT
print '<td align="right">'.price($data['sens']?$data['amount_vat']:-$data['amount_vat'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."</td>\n";
print '<td>'.$data['thirdparty_name']."</td>\n";
@ -758,9 +758,9 @@ if (!empty($date_start) && !empty($date_stop))
// Balance
print '<tr class="liste_total">';
print '<td colspan="6" class="right">'.$langs->trans('Total').'</td>';
print '<td align="right">'.price(price2num($totalET_credit+$totalET_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_credit+$totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit+$totalVAT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalET_credit + $totalET_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
print "</tr>\n";
}

View File

@ -379,7 +379,7 @@ class Interfaces
print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers<br>';
}
}
catch(Exception $e) {
catch (Exception $e) {
print $e->getMessage();
}

View File

@ -910,7 +910,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0,
if ($numholidays == 1) return 0;
}
$nbOpenDay=$lastday;
$nbOpenDay = $lastday;
if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24);
return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));

View File

@ -2302,7 +2302,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning';
if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning';
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
print '<span class="info-box-icon-version'.($versiontrans? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
print $this->getVersion(1);
print '</span>';
}

View File

@ -465,14 +465,14 @@ class pdf_paiement
if ($yp > $this->tab_height - 15)
{
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array());
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetFont('', 'B', $default_font_size - 1);
$pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_page), 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetFillColor(220, 220, 220);
$page++;
@ -523,19 +523,19 @@ class pdf_paiement
}
// Add line to add total by payment mode if mode reglement for nex line change
if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j+1][2]))
if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j + 1][2]))
{
$pdf->SetFillColor(245, 245, 245);
$pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array());
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->SetFont('', 'I', $default_font_size - 1);
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total_mod), 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
$mod = $lines[$j+1][2];
$mod = $lines[$j + 1][2];
$total_mod = 0;
$yp = $yp + 5;
if ($yp > $this->tab_height - 5)
@ -551,14 +551,14 @@ class pdf_paiement
}
$total += $total_page;
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect($this->marge_gauche +1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite -3, $this->line_height, 'F', array(), array());
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetXY($this->posxdate -1, $this->tab_top + 10 + $yp);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->SetFont('', 'B');
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount -1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount +1, $this->line_height, price($total), 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', 1);
$pdf->SetFillColor(220, 220, 220);
}
}

View File

@ -1092,7 +1092,7 @@ class EmailCollector extends CommonObject
$i++;
$header = imap_fetchheader($connection, $imapemail, 0);
$header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines
$header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines
$matches = array();
preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches);
$headers = array_combine($matches[1], $matches[2]);

View File

@ -625,7 +625,7 @@ $(document).ready(function() {
else selectedline=this.id;
selectedtext=$('#'+selectedline).find("td:first").html();
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
print '$("#phonediv1").load("auto_order.php?action=editline&placeid="+placeid+"&selectedline="+selectedline, function() {
});';
}

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
// Decode place if it is an order from customer phone
$key = GETPOST('key');
$place=dol_decode($key);
$place = dol_decode($key);
}
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
$action = GETPOST('action', 'alpha');
@ -73,7 +73,7 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/takepos/css/phone.css">';
if ($action=="productinfo"){
if ($action == "productinfo") {
$prod = new Product($db);
$prod->fetch($idproduct);
print "<b>".$prod->label."</b><br>";
@ -83,7 +83,7 @@ if ($action=="productinfo"){
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="AddProductConfirm(place, '.$idproduct.');">'.$langs->trans('Add').'</button>';
}
elseif ($action=="editline"){
elseif ($action == "editline") {
$placeid = GETPOST('placeid', 'int');
$selectedline = GETPOST('selectedline', 'int');
$invoice = new Facture($db);
@ -99,8 +99,8 @@ elseif ($action=="editline"){
print "<br>".$prod->description;
print "<br><b>".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."</b>";
print '<br>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty-1).');">-</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty+1).');">+</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty - 1).');">-</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetQty(place, '.$selectedline.', '.($line->qty + 1).');">+</button>';
print '<button type="button" class="publicphonebutton2" onclick="SetNote(place, '.$selectedline.');">'.$langs->trans('Note').'</button>';
}
}
@ -168,11 +168,11 @@ $( document ).ready(function() {
function LoadPlace(placeid){
place=placeid;
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?mobilepage=invoice&place="+place, function() {
});';
}
else{
else {
echo '$("#phonediv2").load("invoice.php?mobilepage=invoice&place="+place, function() {
});';
}
@ -183,12 +183,12 @@ function LoadPlace(placeid){
function AddProduct(placeid, productid){
<?php
// If is a public terminal first show product information
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
print 'place=placeid;
$("#phonediv1").load("auto_order.php?action=productinfo&place="+place+"&idproduct="+productid, function() {
});';
}
else{
else {
print 'AddProductConfirm(placeid, productid);';
}
?>
@ -197,11 +197,11 @@ function AddProduct(placeid, productid){
function AddProductConfirm(placeid, productid){
place=placeid;
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=addline&place="+place+"&idproduct="+productid, function() {
});';
}
else{
else {
echo '$("#phonediv2").load("invoice.php?mobilepage=invoice&action=addline&place="+place+"&idproduct="+productid, function() {
});';
}
@ -229,11 +229,11 @@ function SetNote(place, selectedline){
function LoadCats(){
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv1").load("auto_order.php?mobilepage=cats&place="+place, function() {
});';
}
else{
else {
echo '$("#phonediv1").load("invoice.php?mobilepage=cats&place="+place, function() {
});';
}
@ -243,11 +243,11 @@ function LoadCats(){
function LoadProducts(idcat){
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv1").load("auto_order.php?mobilepage=products&catid="+idcat+"&place="+place, function() {
});';
}
else{
else {
echo '$("#phonediv1").load("invoice.php?mobilepage=products&catid="+idcat+"&place="+place, function() {
});';
}
@ -262,11 +262,11 @@ function LoadPlacesList(){
function TakeposPrintingOrder(){
console.log("TakeposPrintingOrder");
<?php
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
echo '$("#phonediv2").load("auto_order.php?action=order&place="+place, function() {
});';
}
else{
else {
echo '$("#phonediv2").load("invoice.php?action=order&place="+place, function() {
});';
}
@ -294,13 +294,13 @@ function CheckPlease(){
<div class="container">
<div class="phonebuttonsrow">
<?php
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')){
if (!defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
print '<button type="button" class="phonebutton" onclick="LoadPlacesList();">'.strtoupper(substr($langs->trans('Floors'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
}
else{
else {
print '<button type="button" class="publicphonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 5)).'</button>';
print '<button type="button" class="publicphonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 5)).'</button>';