Fixing style errors.
This commit is contained in:
parent
6d3066a312
commit
9342fa8781
@ -149,13 +149,13 @@ if (empty($reshook)) {
|
||||
|
||||
// Set if we used free entry or predefined product
|
||||
$bom_child_id = (int) GETPOST('bom_id', 'int');
|
||||
if($bom_child_id > 0){
|
||||
$bom_child = new BOM($db);
|
||||
$res = $bom_child->fetch($bom_child_id);
|
||||
if($res){
|
||||
$idprod = $bom_child->fk_product;
|
||||
}
|
||||
} else {
|
||||
if ($bom_child_id > 0) {
|
||||
$bom_child = new BOM($db);
|
||||
$res = $bom_child->fetch($bom_child_id);
|
||||
if ($res) {
|
||||
$idprod = $bom_child->fk_product;
|
||||
}
|
||||
} else {
|
||||
$idprod = (int) GETPOST('idprod', 'int');
|
||||
}
|
||||
|
||||
|
||||
@ -1064,7 +1064,7 @@ class BOM extends CommonObject
|
||||
$tmpproduct->cost_price = 0;
|
||||
$tmpproduct->pmp = 0;
|
||||
|
||||
if(empty($line->fk_bom_child)){
|
||||
if (empty($line->fk_bom_child)) {
|
||||
$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
|
||||
if ($result < 0) {
|
||||
$this->error = $tmpproduct->error;
|
||||
@ -1083,7 +1083,7 @@ class BOM extends CommonObject
|
||||
} else {
|
||||
$bom_child= new BOM($this->db);
|
||||
$res = $bom_child->fetch($line->fk_bom_child);
|
||||
if($res>0){
|
||||
if ($res>0) {
|
||||
$bom_child->calculateCosts();
|
||||
$this->total_cost += $bom_child->total_cost;
|
||||
} else {
|
||||
|
||||
@ -85,8 +85,8 @@ $res = $tmpbom->fetch($line->fk_bom_child);
|
||||
if ($tmpbom->id > 0) {
|
||||
print '<a class="collapse_bom" id="collapse-'.$line->id.'" href="#">' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' </a>';
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
print ' '.$langs->trans('or').' ';
|
||||
print $tmpbom->getNomUrl(1);
|
||||
print ' '.$langs->trans('or').' ';
|
||||
print $tmpbom->getNomUrl(1);
|
||||
} else {
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
print ' - '.$tmpproduct->label;
|
||||
@ -203,14 +203,14 @@ if ($resql) {
|
||||
|
||||
// Product OR BOM
|
||||
print '<td style="padding-left: 5%" id="sub_bom_product_'.$sub_bom_line->id.'">';
|
||||
if(!empty($obj->fk_bom_child)){
|
||||
if (!empty($obj->fk_bom_child)) {
|
||||
print $sub_bom_product->getNomUrl(1);
|
||||
print ' '.$langs->trans('or').' ';
|
||||
print $sub_bom->getNomUrl(1);
|
||||
} else {
|
||||
} else {
|
||||
print $sub_bom_product->getNomUrl(1);
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Qty
|
||||
if ($sub_bom_line->qty_frozen > 0) {
|
||||
@ -232,7 +232,7 @@ if ($resql) {
|
||||
print '<td class="linecolefficiency nowrap right" id="sub_bom_efficiency_'.$sub_bom_line->id.'">'.$sub_bom_line->efficiency.'</td>';
|
||||
|
||||
// Cost price if it's defined
|
||||
if ($sub_bom_product->cost_price > 0) {
|
||||
if ($sub_bom_product->cost_price > 0) {
|
||||
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">'.price($sub_bom_product->cost_price * $line->qty).'</td>';
|
||||
$total_cost+= $sub_bom_product->cost_price * $line->qty;
|
||||
} elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined
|
||||
@ -244,7 +244,7 @@ if ($resql) {
|
||||
$resql_supplier_price = $object->db->query($sql_supplier_price);
|
||||
if ($resql_supplier_price) {
|
||||
$obj = $object->db->fetch_object($resql_supplier_price);
|
||||
$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty;
|
||||
$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty;
|
||||
|
||||
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">'.price($line_cost).'</td>';
|
||||
$total_cost+= $line_cost;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user