mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Debug v20
This commit is contained in:
parent
20e0417f3b
commit
c31c766431
|
|
@ -196,11 +196,11 @@ if ($filtertype != 1) {
|
|||
print '</td>';
|
||||
}
|
||||
|
||||
$coldisplay += $colspan;
|
||||
print '<td class="bordertop nobottom linecoledit center valignmiddle" colspan="' . $colspan . '">';
|
||||
print '<input type="submit" class="button button-add" name="addline" id="addline" value="' . $langs->trans('Add') . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$coldisplay += $colspan;
|
||||
print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">';
|
||||
print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -351,11 +351,12 @@ if ($resql) {
|
|||
print '<span class="amount">'.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * (float) $line->qty, 'MT')).'</span></td>';
|
||||
$total_cost .= $sub_bom_product->pmp * $sub_bom_line->qty * (float) $line->qty;
|
||||
} else { // Minimum purchase price if cost price and PMP aren't defined
|
||||
$sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
|
||||
$sql_supplier_price .= ' WHERE fk_product = '. (int) $sub_bom_product->id;
|
||||
$sql_supplier_price = "SELECT MIN(price) AS min_price, quantity AS qty FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
|
||||
$sql_supplier_price .= " WHERE fk_product = ". (int) $sub_bom_product->id;
|
||||
$sql_supplier_price .= " GROUP BY quantity ORDER BY quantity ASC";
|
||||
$resql_supplier_price = $object->db->query($sql_supplier_price);
|
||||
if ($resql_supplier_price) {
|
||||
$obj = $object->db->fetch_object($resql_supplier_price);
|
||||
$obj = $object->db->fetch_object($resql_supplier_price); // Take first value so the ref with the smaller minimum quantity
|
||||
if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) {
|
||||
$line_cost = $obj->min_price / $obj->qty * $sub_bom_line->qty * (float) $line->qty;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user