From: Alexander Smirnov Date: Mon, 20 May 2024 09:52:46 +0000 (+0300) Subject: fix X-Git-Tag: 1.1~22^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=a5c3a5c48ef025669b918eaa96040b0544d037a1;p=erp24_rep%2Fyii-erp24%2F.git fix --- diff --git a/erp24/controllers/ShipmentController.php b/erp24/controllers/ShipmentController.php index 188e20c7..b4998cee 100755 --- a/erp24/controllers/ShipmentController.php +++ b/erp24/controllers/ShipmentController.php @@ -32,4 +32,5 @@ class ShipmentController extends Controller public function actionPolnogramm() { return $this->render('polnogramm'); } public function actionAjaxUpdateStoreZakup() { return $this->renderPartial('ajax-update-store-zakup'); } public function actionAjaxUpdateStep() { return $this->renderPartial('ajax-update-step'); } + public function actionStatusFieldsSort() { return $this->render('status-fields-sort'); } } \ No newline at end of file diff --git a/erp24/modul/shipment/fields/auto_purchase_formula.php b/erp24/modul/shipment/fields/auto_purchase_formula.php index 36de484e..3c85c0db 100644 --- a/erp24/modul/shipment/fields/auto_purchase_formula.php +++ b/erp24/modul/shipment/fields/auto_purchase_formula.php @@ -1,4 +1,7 @@ - $name) { +foreach($products ?? [] as $product_id => $name) { $min_order = $FiledsDataArray["min_order"][$product_id][""]; $min_lot=$FiledsDataArray["min_lot"][$product_id][""]; diff --git a/erp24/modul/shipment/fields/price_zakup_summ.php b/erp24/modul/shipment/fields/price_zakup_summ.php index 34b22816..d3c37b7c 100644 --- a/erp24/modul/shipment/fields/price_zakup_summ.php +++ b/erp24/modul/shipment/fields/price_zakup_summ.php @@ -1,17 +1,20 @@ - $name){ - $data_up[$product_id][0][0] = round($FiledsDataArray["purchase_price_zakup"][$product_id] * $FiledsDataArray["quantity_zakup_fact"][$product_id],2); -} +foreach($products ?? [] as $product_id => $name){ + $data_up[$product_id][0][0] = round($FiledsDataArray["purchase_price_zakup"][$product_id] * $FiledsDataArray["quantity_zakup_fact"][$product_id],2); +} diff --git a/erp24/modul/shipment/fields/purchase_price.php b/erp24/modul/shipment/fields/purchase_price.php index e2b7cfbd..de74b54f 100644 --- a/erp24/modul/shipment/fields/purchase_price.php +++ b/erp24/modul/shipment/fields/purchase_price.php @@ -1,7 +1,13 @@ - $name){ +foreach($products ?? [] as $product_id => $name){ // розничная цена в рублях на сумму закупки по факту закупщиком $data_up[$product_id][0][0] = round($FiledsDataArray["purchase_price"][$product_id] * $FiledsDataArray["quantity_zakup_fact"][$product_id]); diff --git a/erp24/modul/shipment/fields/quantity.php b/erp24/modul/shipment/fields/quantity.php index 904a22e6..9d067797 100644 --- a/erp24/modul/shipment/fields/quantity.php +++ b/erp24/modul/shipment/fields/quantity.php @@ -1,9 +1,16 @@ -0 AND product_id $whereInProductsId -AND store_id $orderStoresArrayRelation_in group by product_id, color, store_id"); - foreach($store_planogram as $row) { - $data_up[$row["product_id"]][$row["store_id"]][$row["color"]] +=$row["quantity"]; - $data_up[$row["product_id"]][0][$row["color"]] +=$row["quantity"]; - } \ No newline at end of file +AND store_id $orderStoresArrayRelation_in group by product_id, color, store_id, quantity"; + $store_planogram = $db::getRows($sql); + + foreach ($store_planogram as $row) { + $data_up[$row["product_id"]][$row["store_id"]][$row["color"]] = ($data_up[$row["product_id"]][$row["store_id"]][$row["color"]] ?? 0) + $row["quantity"]; + $data_up[$row["product_id"]][0][$row["color"]] = ($data_up[$row["product_id"]][0][$row["color"]] ?? 0) + $row["quantity"]; + } +} \ No newline at end of file diff --git a/erp24/modul/shipment/fields/quantity_storage.php b/erp24/modul/shipment/fields/quantity_storage.php index b6ffdeb8..f0c1d148 100644 --- a/erp24/modul/shipment/fields/quantity_storage.php +++ b/erp24/modul/shipment/fields/quantity_storage.php @@ -2,10 +2,12 @@ global $whereInProductsId, $orderStoresArrayRelation_in, $data_up; -$data2=$db::getRows("SELECT product_id,store_id,quantity FROM balances WHERE quantity>0 +if ($whereInProductsId != " in ()") { + $data2 = $db::getRows("SELECT product_id,store_id,quantity FROM balances WHERE quantity>0 AND product_id $whereInProductsId AND store_id $orderStoresArrayRelation_in"); -foreach($data2 as $row2) { -$data_up[$row2["product_id"]][$row2["store_id"]][0] = ($data_up[$row2["product_id"]][$row2["store_id"]][0] ?? 0) + $row2["quantity"]; -$data_up[$row2["product_id"]][0][0] = ($data_up[$row2["product_id"]][0][0] ?? 0) + $row2["quantity"]; + foreach ($data2 as $row2) { + $data_up[$row2["product_id"]][$row2["store_id"]][0] = ($data_up[$row2["product_id"]][$row2["store_id"]][0] ?? 0) + $row2["quantity"]; + $data_up[$row2["product_id"]][0][0] = ($data_up[$row2["product_id"]][0][0] ?? 0) + $row2["quantity"]; + } } \ No newline at end of file diff --git a/erp24/modul/shipment/fields/scheduled_delivery_cnt.php b/erp24/modul/shipment/fields/scheduled_delivery_cnt.php index 18047680..c6c6ad88 100644 --- a/erp24/modul/shipment/fields/scheduled_delivery_cnt.php +++ b/erp24/modul/shipment/fields/scheduled_delivery_cnt.php @@ -16,12 +16,11 @@ foreach($data as $row) { $i++; } -if(!empty($whereInOrderId)) { +if(!empty($whereInOrderId) && $whereInProductsId != " in ()") { $sql = "SELECT product_id, store_id, value FROM store_orders_fields_data WHERE order_id IN ($whereInOrderId) AND product_id $whereInProductsId AND field_name='quantity_zakup_new' AND color='' AND value>0 group by product_id, store_id, value"; -//var_dump($sql); die; $data=$db::getRows($sql); foreach($data as $row) { $data_up[$row["product_id"]][$row["store_id"]]["0"]=$row["value"]; diff --git a/erp24/modul/shipment/fields/storehouse_balance.php b/erp24/modul/shipment/fields/storehouse_balance.php index b4a55a81..6664e391 100644 --- a/erp24/modul/shipment/fields/storehouse_balance.php +++ b/erp24/modul/shipment/fields/storehouse_balance.php @@ -17,7 +17,7 @@ foreach($dataF as $row) { //echo"

Storehouse_balance

"; -foreach($products as $productId => $nameProduct) { +foreach($products ?? [] as $productId => $nameProduct) { // echo"
$nameProduct ".$FiledsDataArray["quantity_warehouseman_fact"][$productId][0] ." - ".$FiledsDataArray["division_store_summ"][$productId][0].""; $data_up[$productId][0][0]=$FiledsDataArray["quantity_warehouseman_fact"][$productId][0] - $FiledsDataArray["division_summ"][$productId][0]; foreach($productsColorsArray[$productId] ?? [] as $color) { diff --git a/erp24/modul/shipment/shipment.php b/erp24/modul/shipment/shipment.php index 76e26525..9d80f9ee 100644 --- a/erp24/modul/shipment/shipment.php +++ b/erp24/modul/shipment/shipment.php @@ -58,7 +58,7 @@ $html='наименовани пересчитать данные'; if(in_array($_SESSION["group_id"],[1,11,7])) { -echo'сортировка столбцов +echo'сортировка столбцов настройка столбцов'; } @@ -205,7 +205,7 @@ foreach($data as $row) { $dostup=$dostup_fields[$row["id"]] ?? ''; if($dostup=="edit" or $dostup=="show") { $s=""; -if($fieldsRows[$row["name_eng"]]["row_type_sum"]=="amount") $s=$rowArraySum[$row["id"]]; +if($fieldsRows[$row["name_eng"]]["row_type_sum"]=="amount") $s=$rowArraySum[$row["id"]] ?? 0; if((($rowArraySum["cnt__".$row["id"]] ?? 0) > 0) && $fieldsRows[$row["name_eng"]]["row_type_sum"]=="avg") $s=round($rowArraySum[$row["id"]]/$rowArraySum["cnt__".$row["id"]]); echo''.$s.''; diff --git a/erp24/modul/shipment/statusFieldsSort.php b/erp24/modul/shipment/statusFieldsSort.php index bd67d3ed..78601e9d 100644 --- a/erp24/modul/shipment/statusFieldsSort.php +++ b/erp24/modul/shipment/statusFieldsSort.php @@ -1,11 +1,9 @@ -2) exit("У вас нет доступа"); $statuses=$db::mapping("SELECT id, name FROM store_orders_statuses"); @@ -17,7 +15,7 @@ echo'

Сортировка полей н $id=(int)$_REQUEST["status_id"]; foreach($statuses as $id2 => $name) { - echo''.$name.''; @@ -25,9 +23,9 @@ if($id2==$id) echo'success'; else echo'info'; } -echo'
- -
+echo ''; +echo ''; +echo '
'; @@ -71,7 +69,7 @@ $row=$db::getRow("SELECT fields_sort, fields_hide FROM store_orders_statuses WHE $fields_hide=explode(",",$row["fields_hide"]); $sort=$row["fields_sort"]; -if(!empty($sort)) $data3=$db::getRows("SELECT * FROM store_orders_fields ORDER BY FIELD(`id`, $sort) "); +if(!empty($sort)) $data3=$db::getRows("SELECT * FROM store_orders_fields "); // TODO: pgsql sort [[ORDER BY FIELD(`id`, $sort)]] else $data3=$db::getRows("SELECT * FROM store_orders_fields "); @@ -221,7 +219,4 @@ $(document).ready(function () { '; -include"templates/bottom.php"; - - - +include_once dirname(__DIR__, 2) . '/templates/bottom_light.php'; \ No newline at end of file diff --git a/erp24/views/shipment/status-fields-sort.php b/erp24/views/shipment/status-fields-sort.php new file mode 100644 index 00000000..93e3c479 --- /dev/null +++ b/erp24/views/shipment/status-fields-sort.php @@ -0,0 +1,5 @@ +