';
$html .= $langs->trans("NoDraftProposals");
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index d7ab4e99c78..c55e888e405 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1603,85 +1603,85 @@ class Product extends CommonObject
$price_base_type = $this->price_base_type;
// If price per segment
- if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($thirdparty_buyer->price_level))
+ if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($thirdparty_buyer->price_level))
{
- $pu_ht = $this->multiprices[$thirdparty_buyer->price_level];
- $pu_ttc = $this->multiprices_ttc[$thirdparty_buyer->price_level];
- $price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
- $price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
- if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
- {
- if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) $tva_tx=$this->multiprices_tva_tx[$thirdparty_buyer->price_level];
- if (isset($this->multiprices_recuperableonly[$thirdparty_buyer->price_level])) $tva_npr=$this->multiprices_recuperableonly[$thirdparty_buyer->price_level];
- if (empty($tva_tx)) $tva_npr=0;
- }
- }
+ $pu_ht = $this->multiprices[$thirdparty_buyer->price_level];
+ $pu_ttc = $this->multiprices_ttc[$thirdparty_buyer->price_level];
+ $price_min = $this->multiprices_min[$thirdparty_buyer->price_level];
+ $price_base_type = $this->multiprices_base_type[$thirdparty_buyer->price_level];
+ if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
+ {
+ if (isset($this->multiprices_tva_tx[$thirdparty_buyer->price_level])) $tva_tx=$this->multiprices_tva_tx[$thirdparty_buyer->price_level];
+ if (isset($this->multiprices_recuperableonly[$thirdparty_buyer->price_level])) $tva_npr=$this->multiprices_recuperableonly[$thirdparty_buyer->price_level];
+ if (empty($tva_tx)) $tva_npr=0;
+ }
+ }
// If price per customer
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
{
- require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
- $prodcustprice = new Productcustomerprice($db);
+ $prodcustprice = new Productcustomerprice($db);
- $filter = array('t.fk_product' => $this->id,'t.fk_soc' => $thirdparty_buyer->id);
+ $filter = array('t.fk_product' => $this->id,'t.fk_soc' => $thirdparty_buyer->id);
- $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
- if ($result) {
- if (count($prodcustprice->lines) > 0) {
- $pu_ht = price($prodcustprice->lines[0]->price);
- $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
- $price_base_type = $prodcustprice->lines[0]->price_base_type;
- $tva_tx = $prodcustprice->lines[0]->tva_tx;
- if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
- $tva_npr = $prodcustprice->lines[0]->recuperableonly;
- if (empty($tva_tx)) $tva_npr=0;
- }
- }
+ $result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
+ if ($result) {
+ if (count($prodcustprice->lines) > 0) {
+ $pu_ht = price($prodcustprice->lines[0]->price);
+ $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
+ $price_base_type = $prodcustprice->lines[0]->price_base_type;
+ $tva_tx = $prodcustprice->lines[0]->tva_tx;
+ if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
+ $tva_npr = $prodcustprice->lines[0]->recuperableonly;
+ if (empty($tva_tx)) $tva_npr=0;
}
+ }
+ }
// If price per quantity
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))
{
- if ($this->prices_by_qty[0]) // yes, this product has some prices per quantity
+ if ($this->prices_by_qty[0]) // yes, this product has some prices per quantity
+ {
+ // Search price into product_price_by_qty from $this->id
+ foreach($this->prices_by_qty_list[0] as $priceforthequantityarray)
+ {
+ if ($priceforthequantityarray['rowid'] != $pqp) continue;
+ // We found the price
+ if ($priceforthequantityarray['price_base_type'] == 'HT')
{
- // Search price into product_price_by_qty from $this->id
- foreach($this->prices_by_qty_list[0] as $priceforthequantityarray)
- {
- if ($priceforthequantityarray['rowid'] != $pqp) continue;
- // We found the price
- if ($priceforthequantityarray['price_base_type'] == 'HT')
- {
- $pu_ht = $priceforthequantityarray['unitprice'];
- }
- else
- {
- $pu_ttc = $priceforthequantityarray['unitprice'];
- }
- break;
- }
+ $pu_ht = $priceforthequantityarray['unitprice'];
}
+ else
+ {
+ $pu_ttc = $priceforthequantityarray['unitprice'];
+ }
+ break;
}
+ }
+ }
// If price per quantity and customer
- elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
{
- if ($this->prices_by_qty[$thirdparty_buyer->price_level]) // yes, this product has some prices per quantity
+ if ($this->prices_by_qty[$thirdparty_buyer->price_level]) // yes, this product has some prices per quantity
+ {
+ // Search price into product_price_by_qty from $this->id
+ foreach($this->prices_by_qty_list[$thirdparty_buyer->price_level] as $priceforthequantityarray)
+ {
+ if ($priceforthequantityarray['rowid'] != $pqp) continue;
+ // We found the price
+ if ($priceforthequantityarray['price_base_type'] == 'HT')
{
- // Search price into product_price_by_qty from $this->id
- foreach($this->prices_by_qty_list[$thirdparty_buyer->price_level] as $priceforthequantityarray)
- {
- if ($priceforthequantityarray['rowid'] != $pqp) continue;
- // We found the price
- if ($priceforthequantityarray['price_base_type'] == 'HT')
- {
- $pu_ht = $priceforthequantityarray['unitprice'];
- }
- else
- {
- $pu_ttc = $priceforthequantityarray['unitprice'];
- }
- break;
- }
+ $pu_ht = $priceforthequantityarray['unitprice'];
}
+ else
+ {
+ $pu_ttc = $priceforthequantityarray['unitprice'];
+ }
+ break;
}
+ }
+ }
return array('pu_ht'=>$pu_ht, 'pu_ttc'=>$pu_ttc, 'price_min'=>$price_min, 'price_base_type'=>$price_base_type, 'tva_tx'=>$tva_tx, 'tva_npr'=>$tva_npr);
}
@@ -4293,14 +4293,14 @@ class Product extends CommonObject
{
switch ($type)
{
- case 0:
+ case 0:
return $this->LibStatut($this->status, $mode, $type);
- case 1:
+ case 1:
return $this->LibStatut($this->status_buy, $mode, $type);
- case 2:
+ case 2:
return $this->LibStatut($this->status_batch, $mode, $type);
- default:
- //Simulate previous behavior but should return an error string
+ default:
+ //Simulate previous behavior but should return an error string
return $this->LibStatut($this->status_buy, $mode, $type);
}
}
diff --git a/htdocs/product/inventory/ajax/ajax.inventory.php b/htdocs/product/inventory/ajax/ajax.inventory.php
index f94a383f666..ced76050e31 100644
--- a/htdocs/product/inventory/ajax/ajax.inventory.php
+++ b/htdocs/product/inventory/ajax/ajax.inventory.php
@@ -6,45 +6,45 @@ require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get', 'alpha');
$put = GETPOST('put', 'alpha');
- switch ($put)
- {
- case 'qty':
- if (empty($user->rights->stock->creer)) { echo -1; exit; }
+switch ($put)
+{
+ case 'qty':
+ if (empty($user->rights->stock->creer)) { echo -1; exit; }
- $fk_det_inventory = GETPOST('fk_det_inventory');
+ $fk_det_inventory = GETPOST('fk_det_inventory');
- $det = new InventoryLine($db);
- if( $det->fetch($fk_det_inventory))
- {
- $det->qty_view+=GETPOST('qty');
- $res = $det->update($user);
+ $det = new InventoryLine($db);
+ if( $det->fetch($fk_det_inventory))
+ {
+ $det->qty_view+=GETPOST('qty');
+ $res = $det->update($user);
- echo $det->qty_view;
- }
- else
- {
- echo -2;
- }
+ echo $det->qty_view;
+ }
+ else
+ {
+ echo -2;
+ }
- break;
+ break;
- case 'pmp':
- if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; }
+ case 'pmp':
+ if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; }
- $fk_det_inventory = GETPOST('fk_det_inventory');
+ $fk_det_inventory = GETPOST('fk_det_inventory');
- $det = new InventoryLine($db);
- if( $det->fetch($fk_det_inventory))
- {
- $det->new_pmp=price2num(GETPOST('pmp'));
- $det->update($user);
+ $det = new InventoryLine($db);
+ if( $det->fetch($fk_det_inventory))
+ {
+ $det->new_pmp=price2num(GETPOST('pmp'));
+ $det->update($user);
- echo $det->new_pmp;
- }
- else
- {
- echo -2;
- }
+ echo $det->new_pmp;
+ }
+ else
+ {
+ echo -2;
+ }
- break;
- }
+ break;
+}
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 139fd681ee0..e8e332d95b5 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -475,10 +475,10 @@ if (empty($reshook))
{
$priceid = GETPOST('priceid', 'int');
if (!empty($rowid)) {
- $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_price_by_qty";
- $sql .= " WHERE fk_product_price = " . $priceid;
+ $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_price_by_qty";
+ $sql .= " WHERE fk_product_price = " . $priceid;
- $result = $db->query($sql);
+ $result = $db->query($sql);
} else {
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null, 'errors');
}
@@ -755,17 +755,17 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
{
- // TVA
- print '
' . $langs->trans("DefaultTaxRate") . '
';
+ // TVA
+ print '
' . $langs->trans("DefaultTaxRate") . '
';
- $positiverates='';
- if (price2num($object->multiprices_tva_tx[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_tva_tx[$soc->price_level]);
- if (price2num($object->multiprices_localtax1_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax1_tx[$soc->price_level]);
- if (price2num($object->multiprices_localtax2_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax2_tx[$soc->price_level]);
- if (empty($positiverates)) $positiverates='0';
- echo vatrate($positiverates.($object->default_vat_code?' ('.$object->default_vat_code.')':''), '%', $object->tva_npr);
- //print vatrate($object->multiprices_tva_tx[$soc->price_level], true);
- print '
';
+ $positiverates='';
+ if (price2num($object->multiprices_tva_tx[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_tva_tx[$soc->price_level]);
+ if (price2num($object->multiprices_localtax1_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax1_tx[$soc->price_level]);
+ if (price2num($object->multiprices_localtax2_type[$soc->price_level])) $positiverates.=($positiverates?'/':'').price2num($object->multiprices_localtax2_tx[$soc->price_level]);
+ if (empty($positiverates)) $positiverates='0';
+ echo vatrate($positiverates.($object->default_vat_code?' ('.$object->default_vat_code.')':''), '%', $object->tva_npr);
+ //print vatrate($object->multiprices_tva_tx[$soc->price_level], true);
+ print '';
}
else
{
@@ -791,10 +791,10 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI
{
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
{
- // We show only vat for level 1
- print '
';
// Serial / Eat-by date
- if (! empty($conf->productbatch->enabled) &&
+if (! empty($conf->productbatch->enabled) &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock'))
)
- {
- print '
';
- print '
element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
';
- if ($pdluoid > 0)
- {
- // If form was opened for a specific pdluoid, field is disabled
- print '';
- print '';
- }
- else
- {
- print '';
- }
- print '
';
- print '
';
+{
+ print '
';
+ print '
element == 'stock'?'': ' class="fieldrequired"').'>'.$langs->trans("batch_number").'
';
+ if ($pdluoid > 0)
+ {
+ // If form was opened for a specific pdluoid, field is disabled
+ print '';
+ print '';
+ }
+ else
+ {
+ print '';
+ }
+ print '
';
+ print '
';
- print '
';
- print '
'.$langs->trans("EatByDate").'
';
- print $form->selectDate(($d_eatby?$d_eatby:$pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print '
';
- print '
'.$langs->trans("SellByDate").'
';
- print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
- print '
';
- print '
';
- }
+ print '
';
+ print '
'.$langs->trans("EatByDate").'
';
+ print $form->selectDate(($d_eatby?$d_eatby:$pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print '
';
+ print '
'.$langs->trans("SellByDate").'
';
+ print $form->selectDate(($d_sellby?$d_sellby:$pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print '
';
+ print '
';
+}
// Label
$valformovementlabel=(GETPOST("label")?GETPOST("label"):$langs->trans("MovementTransferStock", $productref));
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index f5db207a42e..e51b2e4b404 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -813,23 +813,23 @@ if (count($tasksarray) > 0)
print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'';
print '';
- for ($idw = 0; $idw < 7; $idw++)
+ for ($idw = 0; $idw < 7; $idw++)
{
- $cssweekend='';
- if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css.
- {
- $cssweekend='weekend';
- }
+ $cssweekend='';
+ if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css.
+ {
+ $cssweekend='weekend';
+ }
- $tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
+ $tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
- $cssonholiday='';
- if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
- elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
- elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
+ $cssonholiday='';
+ if (! $isavailable[$tmpday]['morning'] && ! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayallday ';
+ elseif (! $isavailable[$tmpday]['morning']) $cssonholiday.='onholidaymorning ';
+ elseif (! $isavailable[$tmpday]['afternoon']) $cssonholiday.='onholidayafternoon ';
- print '
';
- }
+ print '
';
+ }
print '
';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index da2d41512e1..a873b53dbc0 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -401,7 +401,7 @@ class Project extends CommonObject
$result = 1;
}
else
- {
+ {
$this->db->rollback();
$result = -1;
}
@@ -1222,7 +1222,7 @@ class Project extends CommonObject
// No filter. Use this if user has permission to see all project
}
- $sql.= $filter;
+ $sql.= $filter;
//print $sql;
$resql = $this->db->query($sql);
@@ -1722,23 +1722,23 @@ class Project extends CommonObject
$num = $this->db->num_rows($resql);
$i = 0;
// Loop on each record found, so each couple (project id, task id)
- while ($i < $num)
+ while ($i < $num)
{
- $obj=$this->db->fetch_object($resql);
- $day=$this->db->jdate($obj->task_date); // task_date is date without hours
- if (empty($daylareadyfound[$day]))
- {
- $this->weekWorkLoad[$day] = $obj->task_duration;
- $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
- }
- else
- {
- $this->weekWorkLoad[$day] += $obj->task_duration;
- $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
- }
- $daylareadyfound[$day]=1;
- $i++;
- }
+ $obj=$this->db->fetch_object($resql);
+ $day=$this->db->jdate($obj->task_date); // task_date is date without hours
+ if (empty($daylareadyfound[$day]))
+ {
+ $this->weekWorkLoad[$day] = $obj->task_duration;
+ $this->weekWorkLoadPerTask[$day][$obj->fk_task] = $obj->task_duration;
+ }
+ else
+ {
+ $this->weekWorkLoad[$day] += $obj->task_duration;
+ $this->weekWorkLoadPerTask[$day][$obj->fk_task] += $obj->task_duration;
+ }
+ $daylareadyfound[$day]=1;
+ $i++;
+ }
$this->db->free($resql);
return 1;
}
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index e35b4b4bdad..1bd044bc985 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -852,15 +852,15 @@ class Task extends CommonObject
$sql.=" t.rowid, t.ref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut,";
$sql.=" t.dateo, t.datee, t.planned_workload, t.rang,";
$sql.=" s.rowid, s.nom, s.email,";
- $sql.=" p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
- if (!empty($extrafields->attributes['projet']['label']))
- {
- foreach ($extrafields->attributes['projet']['label'] as $key => $val) $sql.=($extrafields->attributes['projet']['type'][$key] != 'separate' ? ",efp.".$key : '');
- }
- if (!empty($extrafields->attributes['projet_task']['label']))
- {
- foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) $sql.=($extrafields->attributes['projet_task']['type'][$key] != 'separate' ? ",efpt.".$key : '');
- }
+ $sql.=" p.fk_opp_status, p.opp_amount, p.opp_percent, p.budget_amount";
+ if (!empty($extrafields->attributes['projet']['label']))
+ {
+ foreach ($extrafields->attributes['projet']['label'] as $key => $val) $sql.=($extrafields->attributes['projet']['type'][$key] != 'separate' ? ",efp.".$key : '');
+ }
+ if (!empty($extrafields->attributes['projet_task']['label']))
+ {
+ foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) $sql.=($extrafields->attributes['projet_task']['type'][$key] != 'separate' ? ",efpt.".$key : '');
+ }
}
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 3a2886229a0..44b803571ba 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -863,8 +863,8 @@ foreach ($listofreferent as $key => $value)
if (canApplySubtotalOn($tablename))
{
- // Sort
- $elementarray = sortElementsByClientName($elementarray);
+ // Sort
+ $elementarray = sortElementsByClientName($elementarray);
}
$num=count($elementarray);
@@ -1077,9 +1077,9 @@ foreach ($listofreferent as $key => $value)
if ($othermessage) print $othermessage;
if (isset($total_ht_by_line))
{
- if (! $qualifiedfortotal) print '';
- print price($total_ht_by_line);
- if (! $qualifiedfortotal) print '';
+ if (! $qualifiedfortotal) print '';
+ print price($total_ht_by_line);
+ if (! $qualifiedfortotal) print '';
}
if ($warning) print ' '.img_warning($warning);
print '';
@@ -1124,9 +1124,9 @@ foreach ($listofreferent as $key => $value)
if ($othermessage) print $othermessage;
if (isset($total_ttc_by_line))
{
- if (! $qualifiedfortotal) print '';
- print price($total_ttc_by_line);
- if (! $qualifiedfortotal) print '';
+ if (! $qualifiedfortotal) print '';
+ print price($total_ttc_by_line);
+ if (! $qualifiedfortotal) print '';
}
if ($warning) print ' '.img_warning($warning);
print '';
diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php
index 5c5cd398354..7d75544ef93 100644
--- a/htdocs/projet/graph_opportunities.inc.php
+++ b/htdocs/projet/graph_opportunities.inc.php
@@ -35,11 +35,11 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
$valsamount[$obj->opp_status]=$obj->opp_amount;
$totalnb+=$obj->nb;
if ($obj->opp_status) $totaloppnb+=$obj->nb;
- if (! in_array($obj->code, array('WON', 'LOST')))
+ if (! in_array($obj->code, array('WON', 'LOST')))
{
- $totalamount+=$obj->opp_amount;
- $ponderated_opp_amount+=$obj->ponderated_opp_amount;
- }
+ $totalamount+=$obj->opp_amount;
+ $ponderated_opp_amount+=$obj->ponderated_opp_amount;
+ }
}
$total+=$row[0];
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 9a5514ff1cc..8524e940f36 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -143,10 +143,10 @@ $arrayfields=array(
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
- {
+ foreach($extrafields->attribute_label as $key => $val)
+ {
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
- }
+ }
}
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index 9353f968116..f8480f8f322 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -108,7 +108,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
unset($data1);
if ($nocolor)
-$px->SetDataColor(array (
+ $px->SetDataColor(array (
array (
220,
220,
@@ -130,9 +130,9 @@ $px->SetDataColor(array (
));
$px->SetTitle($langs->trans('OpportunitiesStatusForProjects'));
$result=$px->draw($filenamenb, $fileurlnb);
- if ($result<0) {
- setEventMessages($px->error, null, 'errors');
- }
+ if ($result<0) {
+ setEventMessages($px->error, null, 'errors');
+ }
} else {
setEventMessages(null, $mesgs, 'errors');
}
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 3d4077790c7..2abfea6e64e 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -645,7 +645,7 @@ elseif ($id > 0 || ! empty($ref))
print ' ';
-// Link to create task
+ // Link to create task
$linktocreatetaskParam = array();
$linktocreatetaskUserRight = false;
if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
@@ -787,8 +787,8 @@ elseif ($id > 0 || ! empty($ref))
print_liste_field_titre("TaskProgressSummary", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center ');
if ($object->usage_bill_time)
{
- print_liste_field_titre("TimeToBill", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
- print_liste_field_titre("TimeBilled", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
+ print_liste_field_titre("TimeToBill", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
+ print_liste_field_titre("TimeBilled", $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'right ');
}
if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) print_liste_field_titre("TaskRessourceLinks", $_SERVER["PHP_SELF"], '', '', '', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', 'width="80"', $sortfield, $sortorder, 'center maxwidthsearch ');
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 2448088c6b1..b09d8345177 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
/*
* Lines of contacts
*/
-/*
+ /*
// Contacts lines (modules that overwrite templates must declare this into descriptor)
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
foreach($dirtpls as $reldir)
@@ -364,7 +364,7 @@ if ($id > 0 || ! empty($ref))
$res=@include dol_buildpath($reldir.'/contacts.tpl.php');
if ($res) break;
}
-*/
+ */
/*
* Add a new contact line
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index d9730946377..78431f983a4 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -616,7 +616,7 @@ if ($id > 0 || ! empty($ref))
{
if (! $object->hasChildren() && ! $object->hasTimeSpent())
{
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
}
else
{
diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php
index 48e2a8ddb65..416a17f0c0f 100644
--- a/test/phpunit/BankAccountTest.php
+++ b/test/phpunit/BankAccountTest.php
@@ -169,7 +169,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testBankAccountOther
*
* @param Object $localobject Object contract
diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php
index eb830e1f827..135c77dfa2d 100644
--- a/test/phpunit/BonPrelevementTest.php
+++ b/test/phpunit/BonPrelevementTest.php
@@ -173,7 +173,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
* @depends testBonPrelevementOther
* The depends says test is run only if previous is ok
*/
-/* public function testBonPrelevementDelete($id)
+ /* public function testBonPrelevementDelete($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@@ -189,5 +189,5 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase
$this->assertLessThan($result, 0);
return $result;
}
-*/
+ */
}
diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php
index b64d3242edb..7c302105aa2 100644
--- a/test/phpunit/ContratTest.php
+++ b/test/phpunit/ContratTest.php
@@ -166,7 +166,7 @@ class ContratTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testContratOther
*
* @param Object $localobject Object contract
diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php
index 66ef42a9e15..7f440bf067d 100644
--- a/test/phpunit/ExportTest.php
+++ b/test/phpunit/ExportTest.php
@@ -265,7 +265,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
public function testExportPersonalizedWithFilter()
{
global $conf,$user,$langs,$db;
-/*
+ /*
$sql = "SELECT f.ref as f_ref, f.total as f_total, f.tva as f_tva FROM ".MAIN_DB_PREFIX."facture f";
$objexport=new Export($db);
@@ -303,7 +303,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $array_filtervalue, $sql);
$expectedresult=1;
$this->assertEquals($expectedresult,$result);
-*/
+ */
return true;
}
diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php
index f346909e8b8..b277ba5c1b3 100644
--- a/test/phpunit/FactureFournisseurTest.php
+++ b/test/phpunit/FactureFournisseurTest.php
@@ -214,7 +214,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFactureFournisseurOther
*
* @param Object $localobject Supplier invoice
diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php
index 34dd42b63f6..4e361895fcc 100644
--- a/test/phpunit/FactureTest.php
+++ b/test/phpunit/FactureTest.php
@@ -241,7 +241,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFactureOther
*
* @param Object $localobject Invoice
diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php
index 60be4024e69..ba9408441a1 100644
--- a/test/phpunit/FichinterTest.php
+++ b/test/phpunit/FichinterTest.php
@@ -190,7 +190,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testFichinterValid
*
* @param Object $localobject Object intervention
diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php
index d73d99f7078..776e783a6b0 100644
--- a/test/phpunit/FilesLibTest.php
+++ b/test/phpunit/FilesLibTest.php
@@ -150,11 +150,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
}
- /**
- * testDolCountNbOfLine
- *
- * @return int
- */
+ /**
+ * testDolCountNbOfLine
+ *
+ * @return int
+ */
public function testDolCountNbOfLine()
{
global $conf,$user,$langs,$db;
@@ -171,11 +171,11 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
return $result;
}
- /**
- * testDolIsFileDir
- *
- * @return int
- */
+ /**
+ * testDolIsFileDir
+ *
+ * @return int
+ */
public function testDolIsFileDir()
{
global $conf,$user,$langs,$db;
diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php
index a7fcaba25ce..71474ba1847 100644
--- a/test/phpunit/ImagesLibTest.php
+++ b/test/phpunit/ImagesLibTest.php
@@ -118,11 +118,11 @@ class ImagesLibTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
- /**
- * testDolCountNbOfLine
- *
- * @return int
- */
+ /**
+ * testDolCountNbOfLine
+ *
+ * @return int
+ */
public function testgetImageSize()
{
$file=dirname(__FILE__).'/img250x50.jpg';
diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php
index 955024baa91..709c5bbcfb7 100644
--- a/test/phpunit/PropalTest.php
+++ b/test/phpunit/PropalTest.php
@@ -239,7 +239,7 @@ class PropalTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testPropalOther
*
* @param Propal $localobject Proposal
diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php
index b9658818d48..ea3970e5a4b 100644
--- a/test/phpunit/RestAPIUserTest.php
+++ b/test/phpunit/RestAPIUserTest.php
@@ -149,30 +149,30 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
*/
public function testRestGetUser()
{
- global $conf,$user,$langs,$db;
+ global $conf,$user,$langs,$db;
- $url = $this->api_url.'/users/123456789?api_key='.$this->api_key;
- //$addheaders=array('Content-Type: application/json');
+ $url = $this->api_url.'/users/123456789?api_key='.$this->api_key;
+ //$addheaders=array('Content-Type: application/json');
- print __METHOD__." Request GET url=".$url."\n";
- $result=getURLContent($url, 'GET', '', 1, array());
- //print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(404, $object['error']['code']);
+ print __METHOD__." Request GET url=".$url."\n";
+ $result=getURLContent($url, 'GET', '', 1, array());
+ //print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(404, $object['error']['code']);
- $url = $this->api_url.'/users/1?api_key='.$this->api_key;
+ $url = $this->api_url.'/users/1?api_key='.$this->api_key;
- print __METHOD__." Request GET url=".$url."\n";
- $result=getURLContent($url, 'GET', '', 1, array());
- //print __METHOD__." Result for existing user user: ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(1, $object['statut']);
+ print __METHOD__." Request GET url=".$url."\n";
+ $result=getURLContent($url, 'GET', '', 1, array());
+ //print __METHOD__." Result for existing user user: ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(1, $object['statut']);
}
/**
@@ -183,52 +183,52 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
public function testRestCreateUser()
{
- // attemp to create without mandatory fields :
- $url = $this->api_url.'/users?api_key='.$this->api_key;
- $addheaders=array('Content-Type: application/json');
+ // attemp to create without mandatory fields :
+ $url = $this->api_url.'/users?api_key='.$this->api_key;
+ $addheaders=array('Content-Type: application/json');
- $bodyobj = array(
- "lastname"=>"testRestUser",
- "password"=>"testRestPassword",
- "email"=>"test@restuser.com"
- );
- $body = json_encode($bodyobj);
+ $bodyobj = array(
+ "lastname"=>"testRestUser",
+ "password"=>"testRestPassword",
+ "email"=>"test@restuser.com"
+ );
+ $body = json_encode($bodyobj);
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- //print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ //print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
- // create regular user
- unset($result);
- $bodyobj = array(
- "login"=>"testRestLogin".mt_rand(),
- "lastname"=>"testRestUser",
- "password"=>"testRestPassword",
- "email"=>"test@restuser.com"
- );
- $body = json_encode($bodyobj);
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $resid=json_decode($result['content'], true);
- $this->assertNotNull($resid, "Parsing of json result must no be null");
- $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
+ // create regular user
+ unset($result);
+ $bodyobj = array(
+ "login"=>"testRestLogin".mt_rand(),
+ "lastname"=>"testRestUser",
+ "password"=>"testRestPassword",
+ "email"=>"test@restuser.com"
+ );
+ $body = json_encode($bodyobj);
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $resid=json_decode($result['content'], true);
+ $this->assertNotNull($resid, "Parsing of json result must no be null");
+ $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']);
- // attempt to create duplicated user
- print __METHOD__." Request POST url=".$url."\n";
- $result=getURLContent($url, 'POST', $body, 1, $addheaders);
- //print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
- print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
- $this->assertEquals($result['curl_error_no'], '');
- $object=json_decode($result['content'], true);
- $this->assertNotNull($object, "Parsing of json result must no be null");
- $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
+ // attempt to create duplicated user
+ print __METHOD__." Request POST url=".$url."\n";
+ $result=getURLContent($url, 'POST', $body, 1, $addheaders);
+ //print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
+ print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
+ $this->assertEquals($result['curl_error_no'], '');
+ $object=json_decode($result['content'], true);
+ $this->assertNotNull($object, "Parsing of json result must no be null");
+ $this->assertEquals(500, $object['error']['code'], $object['error']['code'].' '.$object['error']['message']);
}
}
diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php
index aa91e8d533b..42d7e5842a6 100644
--- a/test/phpunit/SupplierProposalTest.php
+++ b/test/phpunit/SupplierProposalTest.php
@@ -231,7 +231,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase
return $localobject;
}
- /**
+ /**
* testSupplierProposalOther
*
* @param SupplierProposal $localobject Proposal
diff --git a/test/phpunit/functional/TakePosFunctionalTest.php b/test/phpunit/functional/TakePosFunctionalTest.php
index e33a050cecf..597a893c67b 100644
--- a/test/phpunit/functional/TakePosFunctionalTest.php
+++ b/test/phpunit/functional/TakePosFunctionalTest.php
@@ -67,14 +67,14 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
),
// Geckodriver does not keep the session at the moment?!
// XPath selectors also don't seem to work
-// array(
-// 'browser' => 'Mozilla Firefox on Linux',
-// 'browserName' => 'firefox',
-// 'sessionStrategy' => 'shared',
-// 'desiredCapabilities' => array(
-// 'marionette' => true
-// )
-// )
+ //array(
+ // 'browser' => 'Mozilla Firefox on Linux',
+ // 'browserName' => 'firefox',
+ // 'sessionStrategy' => 'shared',
+ // 'desiredCapabilities' => array(
+ // 'marionette' => true
+ // )
+ //)
);
/**