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