����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.14 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/www/html/t/sae/appsae/core/app/view/ |
Upload File : |
<?php echo "proceso de compra!"; if(isset($_SESSION["reabastecer"])){ $cart = $_SESSION["reabastecer"]; if(count($cart)>0){ $process = true; ////////////////////////////////// if($process==true){ //verificammos si es entrada,salida o pendiente entrada if($_POST["ajust_id"]>0) { $operation_type = 2; $sell = new Re2Data(); $sell->user_id = $_SESSION["user_id"]; $sell->total = $_POST["total"]; $sell->stock_to_id = $_POST["stock_id"]; $sell->person_id=$_POST["client_id"]!=""?$_POST["client_id"]:"NULL"; $s = $sell->add_re(); } else { if($_POST["d_id"]==2){ $operation_type= 3; // 3.- entrada-pendiente echo $_POST["ajust_id"]; }else{ $operation_type = 1; } $sell = new ReData(); $sell->user_id = $_SESSION["user_id"]; $sell->p_id = $_POST["p_id"]; $sell->d_id = $_POST["d_id"]; $sell->total = $_POST["total"]; $sell->stock_to_id = $_POST["stock_id"]; $sell->operation_type_id = $operation_type; $sell->person_id=$_POST["client_id"]!=""?$_POST["client_id"]:"NULL"; $s = $sell->add_re(); } foreach($cart as $c){ //verificammos si es entreda salida o pendiente entrada if($_POST["ajust_id"]>0) { $operation_type = 2; } else { if($_POST["d_id"]==2){ $operation_type= 3; // 3.- entrada-pendiente echo $_POST["ajust_id"]; }else{ $operation_type = 1; } } //consultamos el producto de la tabla $product = ProductData::getById($c["product_id"]); $op = new OperationData2(); $op->price_in = $c["price_in"]; $op->price_out = $c["price_out"]; $op->barcode = $product->barcode; $op->stock_id = $_POST["stock_id"]; $op->product_id = $c["product_id"] ; $op->operation_type_id=$operation_type; // 1 - entrada $op->re_id=$s[1]; $op->q = $c["q"]; $add = $op->add(); //entrada de inventario compra if($operation_type == 1){ //actualizamos stock en tabla item $item = ProductData::getBycodeItem($product->barcode); //stock antes de actualizar segun el almacen if($_POST["stock_id"] == 1){ $preStock = $item->stock + $c["q"]; $item->updateStock($product->barcode,$preStock); //actualizar precio de venta $item->updateP($product->barcode,$c["price_out"],0); }elseif($_POST["stock_id"]== 2){ $preStock = $item->stock2 + $c["q"]; $item->updateStock2($product->barcode,$preStock); }elseif($_POST["stock_id"] == 3){ $preStock = $item->stock3 + $c["q"]; $item->updateStock3($product->barcode,$preStock); }else{ $preStock = $item->stock4 + $c["q"]; $item->updateStock4($product->barcode,$preStock); } //cargamos el valor de compras al valor anterios sumamos //salida de inventario ajuste }elseif($operation_type == 2){ //actualizamos stock en tabla item $item = ProductData::getBycodeItem($product->barcode); if($_POST["stock_id"] == 1){ $preStock = $item->stock - $c["q"]; $item->updateStock($product->barcode,$preStock); //actualizar precio tabla m_item $item->updateP($product->barcode,$c["price_out"],0); echo "almacen 1..."; }elseif($_POST["stock_id"]== 2){ $preStock = $item->stock2 - $c["q"]; $item->updateStock2($product->barcode,$preStock); echo "almacen 2..."; }elseif($_POST["stock_id"] == 3){ $preStock = $item->stock3 - $c["q"]; $item->updateStock3($product->barcode,$preStock); echo "almacen 3..."; }else{ $preStock = $item->stock4 - $c["q"]; $item->updateStock4($product->barcode,$preStock); echo "almacen 4..."; } }else{ echo "Funciones no activadas de movimiento de inventario!!!"; } } unset($_SESSION["reabastecer"]); setcookie("selled","selled"); if($_POST["ajust_id"]>0){ $origen= StockData::getById($_POST["stock_id"])->name; //////////////////// print "<script>alert('Se realizo un Ajuste de salida para el almacen: ".$origen." ');</script>"; print "<script>window.location='index.php?view=re';</script>"; }else{ $origen= StockData::getById($_POST["stock_id"])->name; //////////////////// print "<script>alert('Se realizo una compra de salida para el almacen: ".$origen." ');</script>"; print "<script>window.location='index.php?view=onere&id=$s[1]';</script>"; } } } } ?>