����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.22.70.233 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 : /var/www/html/t/sae/appsae/core/app/action/ |
Upload File : |
<?php if(!empty($_POST["sell_id"])){ //print_r($_POST); $sell = SellData::getByc2($_POST["sell_id"]); //echo $sell->sale_id; $operations = OperationData::getAllProductsBySellId($sell->sale_id); $total= 0; //agregamos el registro de la devolucion $dev = new DevData(); $dev->user_id = $_SESSION["user_id"]; $dev->operation_type_id = 3; // devolution $d = $dev->add_de(); foreach ($operations as $op) { if(isset($_POST["op_".$op->id_item])){ if($_POST["op_".$op->id_item]>0 && $_POST["op_".$op->id_item]<=$op->qty){ //print_r($op); //solo agregamos los registros que tenemos valor mayor a 1 $product = ProductData::getAllByName($op->item_name); // print_r($product); //echo $product[0]->barcode; $dev_op = new OperationData(); $dev_op->sale_id = $sell->sale_id; $dev_op->product_id = $product[0]->id; $dev_op->price_in = $product[0]->price_in; $dev_op->price_out= $op->price; $dev_op->stock_id = StockData::getPrincipal()->id; $dev_op->operation_type_id=OperationTypeData::getByName("devolucion")->id; $dev_op->dev_id=$d[1]; $dev_op->sell_id = $_POST["sell_id"]; echo $cantAdev = number_format($_POST["op_".$op->id_item],2); $dev_op->q = $cantAdev; $dev_op->addD(); $total = $total + ( $_POST["op_".$op->id_item]*$op->price); $op->q -= $_POST["op_".$op->id_item]; //actualizamos la tabla t_sale para dejar en evidencia la devolucion $op->update_qty($op->sale_id); /// agregamos la devolucion como un gasto // $product = ProductData::getById($op->product_id); $user = new SpendData(); $user->name = "Devolucion - Venta - ".$sell->sale_id." - ".$product[0]->name; $user->price = $op->price*$_POST["op_".$op->id_item]; $total_total = $user->price; $user->id_dev = $_POST["sell_id"]; $user->f_pago = $_POST["f_pago"]; $user->q = $_POST["op_".$op->id_item]; $user->id_seller = $_POST["id_seller"]; $user->add(); //agregamos el registro de la devolucion } } } $dev = new DevData(); $dev->user_id = $_SESSION["user_id"]; $dev->operation_type_id = 3; // devolution $dev->total= $total; $dev->id_seller = $_POST["id_seller"]; $dev->f_pago = $_POST["f_pago"]; $dev->entrega = $_POST["entrega"]; $d = $dev->add_de(); //id de devolucion $id_dev=$d[1]; $sell_id=$_POST["sell_id"]; $entrega= $_POST["entrega"]; Core::alert("Devolucion agregada!"); print "<script>window.location='index.php?view=onesellD&id=$id_dev&sell_id=$sell_id&entrega=$entrega';</script>"; } else { Core::alert("Devolucion No registrada!"); Core::redir("./?view=devolution"); } ?>