From: Alexander Smirnov Date: Sun, 19 May 2024 15:28:25 +0000 (+0300) Subject: fix ajax-update-step X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=849f117e024941db29586ccb48c79bf2b25fc526;p=yii-erp24%2F.git fix ajax-update-step --- diff --git a/erp24/controllers/ShipmentController.php b/erp24/controllers/ShipmentController.php index 22abb64..188e20c 100755 --- a/erp24/controllers/ShipmentController.php +++ b/erp24/controllers/ShipmentController.php @@ -31,4 +31,5 @@ class ShipmentController extends Controller public function actionAjaxField() { return $this->renderPartial('ajax-field'); } 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'); } } \ No newline at end of file diff --git a/erp24/modul/shipment/ajaxUpdateStep.php b/erp24/modul/shipment/ajaxUpdateStep.php index a53261e..533aff7 100644 --- a/erp24/modul/shipment/ajaxUpdateStep.php +++ b/erp24/modul/shipment/ajaxUpdateStep.php @@ -1,8 +1,8 @@ -=? - INTERVAL 14 day group BY p.product_id, s.store_id_1c order by +WHERE s.id=p.check_id AND s.operation='Продажа' AND p.product_id $whereInProductsId AND s.date>=?::date - INTERVAL '14 day' group BY p.product_id, s.store_id_1c order by squantity DESC",[$date_start_division]); foreach($data as $row){ $productsArrayStores[$row["product_id"]][$row["store_id_1c"]]=$row["squantity"]; @@ -136,7 +136,7 @@ $productsArrayStores[$row["product_id"]][$row["store_id_1c"]]=$row["squantity"]; // товар в пути date_start<='$date_start_sale 00:00:00' AND date_start>='$date_start_sale' -interval 7 day -$data=$db::getRows("SELECT id,name,providers_arr FROM store_orders WHERE date_add>='$order_date_add' - interval 7 day AND date_add<='$order_date_add' "); +$data=$db::getRows("SELECT id,name,providers_arr FROM store_orders WHERE date_add>='$order_date_add'::date - interval '7 day' AND date_add<='$order_date_add' "); $j=0; @@ -331,8 +331,8 @@ foreach($colorsProductsArray[$productId] as $color) { if($color=="NULL") { $color=""; try { - $db::sql("INSERT IGNORE INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update,title) - VALUES (?,?,?,?,?,?,?,?,'-1',NOW(),?) ON DUPLICATE KEY UPDATE value=?, hand=0, value_text=?, date_update=NOW(), title=?", + $db::sql("INSERT INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update,title) + VALUES (?,?,?,?,?,?,?,?,'-1',NOW(),?) ON CONFLICT (product_id, order_id, store_id, field_id, field_name, color) DO UPDATE SET value=?, hand=0, value_text=?, date_update=NOW(), title=?", [$productId, $orderId, $storeId, $field_name, $field_id, $value, "", $color, $title, $value, "",$title]); } catch (Exception $e) @@ -390,8 +390,8 @@ $storehouse_balance=$FiledsData["$rowFactName"][$productId]["NULL"]["NULL"]-($di try { - $s="INSERT IGNORE INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update) - VALUES (?,?,?,?,?,?,?,?,'-1',NOW()) ON DUPLICATE KEY UPDATE value=?, hand=0, value_text=?, date_update=NOW()"; + $s="INSERT INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update) + VALUES (?,?,?,?,?,?,?,?,'-1',NOW()) ON CONFLICT (product_id, order_id, store_id, field_name, field_id, color) DO UPDATE SET value=?, hand=0, value_text=?, date_update=NOW()"; $db::sql($s, [$productId, $orderId, $storeId, $field_name, $field_id, $value, $value_text, $color, $value, $value_text]); } diff --git a/erp24/modul/shipment/fields/min_lot.php b/erp24/modul/shipment/fields/min_lot.php index 02f6de1..cef8664 100644 --- a/erp24/modul/shipment/fields/min_lot.php +++ b/erp24/modul/shipment/fields/min_lot.php @@ -1,5 +1,11 @@ -