PSR coding style
This commit is contained in:
parent
fe8eb1be92
commit
7abf23c471
@ -39,7 +39,8 @@ if ($user->societe_id) {
|
|||||||
$result=restrictedArea($user,'produit|service');
|
$result=restrictedArea($user,'produit|service');
|
||||||
|
|
||||||
//checks if a product has been ordered
|
//checks if a product has been ordered
|
||||||
function ordered($product_id) {
|
function ordered($product_id)
|
||||||
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$sql = 'SELECT DISTINCT cfd.fk_product, SUM(cfd.qty) from ';
|
$sql = 'SELECT DISTINCT cfd.fk_product, SUM(cfd.qty) from ';
|
||||||
$sql .= MAIN_DB_PREFIX . 'commande_fournisseurdet as cfd ';
|
$sql .= MAIN_DB_PREFIX . 'commande_fournisseurdet as cfd ';
|
||||||
@ -53,16 +54,16 @@ function ordered($product_id) {
|
|||||||
$exists = $db->num_rows($resql);
|
$exists = $db->num_rows($resql);
|
||||||
if ($exists) {
|
if ($exists) {
|
||||||
$obj = $db->fetch_array($resql);
|
$obj = $db->fetch_array($resql);
|
||||||
|
|
||||||
return $obj['SUM(cfd.qty)'] . ' ' . img_picto('','tick');
|
return $obj['SUM(cfd.qty)'] . ' ' . img_picto('','tick');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return img_picto('', 'stcomm-1');
|
return img_picto('', 'stcomm-1');
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$error = $db->lasterror();
|
$error = $db->lasterror();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
dol_syslog('replenish.php: ' . $error, LOG_ERROR);
|
dol_syslog('replenish.php: ' . $error, LOG_ERROR);
|
||||||
|
|
||||||
return $langs->trans('error');
|
return $langs->trans('error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -125,8 +126,7 @@ if($action == 'order') {
|
|||||||
$line->total_ttc = $line->total_ht + $line->total_tva;
|
$line->total_ttc = $line->total_ht + $line->total_tva;
|
||||||
$line->ref_fourn = $obj->ref_fourn;
|
$line->ref_fourn = $obj->ref_fourn;
|
||||||
$suppliers[$obj->fk_soc]['lines'][] = $line;
|
$suppliers[$obj->fk_soc]['lines'][] = $line;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$error=$db->lasterror();
|
$error=$db->lasterror();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
dol_syslog('replenish.php: '.$error, LOG_ERROR);
|
dol_syslog('replenish.php: '.$error, LOG_ERROR);
|
||||||
@ -190,8 +190,7 @@ if ($sall) {
|
|||||||
if (dol_strlen($type)) {
|
if (dol_strlen($type)) {
|
||||||
if ($type == 1) {
|
if ($type == 1) {
|
||||||
$sql .= ' AND p.fk_product_type = 1';
|
$sql .= ' AND p.fk_product_type = 1';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$sql .= ' AND p.fk_product_type != 1';
|
$sql .= ' AND p.fk_product_type != 1';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,8 +250,7 @@ if ($resql) {
|
|||||||
'',
|
'',
|
||||||
$num
|
$num
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
$filters .= '&fourn_id=' . $fourn_id;
|
$filters .= '&fourn_id=' . $fourn_id;
|
||||||
$filters .= (isset($type)?'&type=' . $type:'');
|
$filters .= (isset($type)?'&type=' . $type:'');
|
||||||
@ -323,8 +321,7 @@ if ($resql) {
|
|||||||
);
|
);
|
||||||
if ($conf->global->USE_VIRTUAL_STOCK) {
|
if ($conf->global->USE_VIRTUAL_STOCK) {
|
||||||
$stocklabel = $langs->trans('VirtualStock');
|
$stocklabel = $langs->trans('VirtualStock');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$stocklabel = $langs->trans('PhysicalStock');
|
$stocklabel = $langs->trans('PhysicalStock');
|
||||||
}
|
}
|
||||||
print_liste_field_titre($stocklabel,
|
print_liste_field_titre($stocklabel,
|
||||||
@ -430,14 +427,11 @@ if ($resql) {
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
|
if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
|
||||||
print $regs[1] . ' ' . $langs->trans('DurationYear');
|
print $regs[1] . ' ' . $langs->trans('DurationYear');
|
||||||
}
|
} elseif (preg_match('/([0-9]+)m/i', $objp->duration, $regs)) {
|
||||||
else if(preg_match('/([0-9]+)m/i', $objp->duration, $regs)) {
|
|
||||||
print $regs[1] . ' ' . $langs->trans('DurationMonth');
|
print $regs[1] . ' ' . $langs->trans('DurationMonth');
|
||||||
}
|
} elseif (preg_match('/([0-9]+)d/i', $objp->duration, $regs)) {
|
||||||
else if(preg_match('/([0-9]+)d/i', $objp->duration, $regs)) {
|
|
||||||
print $regs[1] . ' ' . $langs->trans('DurationDay');
|
print $regs[1] . ' ' . $langs->trans('DurationDay');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
print $objp->duration;
|
print $objp->duration;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -461,8 +455,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
$stock_commande_fournisseur = $prod->stats_commande_fournisseur['qty'];
|
$stock_commande_fournisseur = $prod->stats_commande_fournisseur['qty'];
|
||||||
$stock = $objp->stock_physique - $stock_commande_client + $stock_commande_fournisseur;
|
$stock = $objp->stock_physique - $stock_commande_client + $stock_commande_fournisseur;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$stock = $objp->stock_physique;
|
$stock = $objp->stock_physique;
|
||||||
}
|
}
|
||||||
if ($objp->seuil_stock_alerte
|
if ($objp->seuil_stock_alerte
|
||||||
@ -516,8 +509,7 @@ if ($resql) {
|
|||||||
0,
|
0,
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
$filters .= '&fourn_id=' . $fourn_id;
|
$filters .= '&fourn_id=' . $fourn_id;
|
||||||
$filters .= (isset($type)? '&type=' . $type : '');
|
$filters .= (isset($type)? '&type=' . $type : '');
|
||||||
@ -537,11 +529,9 @@ if ($resql) {
|
|||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
?>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user