Browse Source

拆梯&美容成本平均分到每台

gary
jrbin 1 year ago
parent
commit
576814b49b
  1. 23
      wms/mkt/pricereview_mi-api.php

23
wms/mkt/pricereview_mi-api.php

@ -136,6 +136,27 @@ try {
}
mysqli_free_result($res);
// 拆梯&美容平均分到每台電梯
$dismantle_fee = $dismantle_amt = $polishing_fee = $polishing_amt = 0;
if ($opt == "R") {
$sql3 = "select item_spec, item_qty, note from pricereview_item where mid = '$id' and item_group = 'C'";
$res_i = mysqli_query($link, $sql3);
while ($row_i = mysqli_fetch_assoc($res_i)) {
$sql4 = "select min_floors, price, price_plus from dismantle_mi_option where spec = '".$row_i["item_spec"]."' ";
$sql4 .= "and version_date = '2023-09-04'";
$sql4 .= "and ($row_i[note] between min_floors and max_floors) ";
$res_d = mysqli_query($link, $sql4);
if ($row_d = mysqli_fetch_assoc($res_d)) {
$dismantle_amt += ($row_d["price"] + $row_d["price_plus"]*($row_i["note"] - $row_d["min_floors"]))*$row_i["item_qty"];
$polishing_amt += 3000*$row_i["note"];
}
mysqli_free_result($res_d);
}
mysqli_free_result($res_i);
}
$dismantle_fee = round($dismantle_amt/$elev_qty_all, 0);
$polishing_fee = round($polishing_amt/$elev_qty_all, 0);
//print_r($elev_arr);
//print_r($opt_elev_arr);
//print_r($opt_nosel_id_arr);
@ -195,6 +216,7 @@ try {
$mi = $equipment_ntd + $shipping_fee + $row_e["unloading"] + $row_e["transport_site"] + $install_cost_total + $row_e["free1y"] + $row_e["option_price"] + $row_e["weight_price"];
*/
// 拆梯價格
/*
$dismantle_fee = $polishing_fee = 0;
if ($opt == "R") {
$sql3 = "select item_spec, item_qty, note from pricereview_item where mid = '$id' and item_group = 'C'";
@ -212,6 +234,7 @@ try {
}
mysqli_free_result($res_i);
}
*/
// Option價格
$oparr = [];

Loading…
Cancel
Save