����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.148 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 echo "Almacen que busca: "; echo $stock_id = $_SESSION['stock_id']; $almacen = StockData::getByid($stock_id); ?> <div class="box-body table-responsive no-padding" style="max-width:1124px;"> <table id="table_search" class="table table-bordered table-hover "> <thead> <tr class="tableheader"> <th style="width:4px">#</th> <th style="width:60px">Id</th> <th style="width:150px">Imagen</th> <th style="width:300px">Nombre</th> <th style="width:300px">almacen 1</th> <th style="width:300px">almacen 2</th> <th style="width:300px">almacen 3</th> <th style="width:300px">almacen 4</th> <th style="width:160px">Operaciones</th> <th></th> </tr> </thead> <tbody> <?php $Iden = ($_POST['ID']); if(isset($Iden)){ $products = ProductData::getBycode2($Iden); if(count($products) == 0){ echo "<script> $.notifyDefaults({ url_target: '_self' }); $.notify({ message: 'Clic Aqui para Ver Ayuda!', url: 'https://www.youtube.com/watch?v=jqiqsdu4t6c&list=LLcuskh7GrX1jFEahFHKdZPA&index=1' }); $.notify({ title: '<strong>Codigo No Existe</strong>', message: 'Revisar al escribir el codigo de barras.' },{ type: 'danger' }); </script>"; } else { ?> <?php foreach($products as $product): ?> <?php echo $stock_id = 1; echo "......"; // almacen 1--------------------------------------------- //compras $itotal2 =0; $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id); //ordenes de compra $itotal_O = 0; $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id); //Total de entradas $entradas = 0; $entradas = $itotal2 + $itotal_O['0']->sum; //ventas en tabla t_sale_detail $vendedores = UserData::getByIdStock($stock_id); //print_r($vendedores); $totalV=0; $totalP=0; foreach($vendedores as $vendedor){ //ventas en tabla t_sale_detail por almacen //extraemos el valor de barcode del producto hijo $prod_hijo = ProductData::getBycodeItem($product->barcode); //print_r($prod_hijo->id_item); if($product->is_service == 3){ $operations3 = OperationData::getByPackOK($product->barcode, $vendedor->id_user); //print_r($operations3); }else{ //obtenemos los productos que se venden dentro de paquetes $operations3 = OperationData::getByc2OK($prod_hijo->id_item, $vendedor->id_user); //obtenemos los productos que se venden solos $operationsP = OperationData::getByPackOK($product->barcode, $vendedor->id_user); //print_r($operations3); } foreach($operations3 as $op) { $totalV = $totalV + $op->qty; } if($product->is_service == 3){ }else{ //productos en paquete foreach($operationsP as $op) { $totalP = $totalP + $op->qty; } } } //obtenemos el multiplicador del producto padre para ver cuantas se vendieron $prod_padre = ProductData::getBycodePadre($prod_hijo->id_item); //print_r($prod_padre->qy); if(empty($prod_padre->qy)) { }else{ //obtenemos el total de ventas solas de este producto inventariable $factorM = $totalP*$prod_padre->qy; //multiplicamos las ventas del paquete por qy(cantidad de productos hijo dentro del paquete) $totalV = ($totalV*$prod_padre->qy) + $totalP - $factorM ; } //ajuste salida $totalAjusteS=0; $totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id); //devoluciones de tabla operations $totalDev=0; $operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id); foreach($operations4 as $op2) { $totalDev = $totalDev + $op2->q; } //existencia $existencia1=0; $existencia1 = ($entradas - $totalV + $totalDev) + $totalAjusteS; ?> <?php echo $stock_id = 2; echo "......"; // almacen 2--------------------------------------------- //compras $itotal2 =0; $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id); //ordenes de compra $itotal_O = 0; $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id); //Total de entradas $entradas = 0; $entradas = $itotal2 + $itotal_O['0']->sum; //ventas en tabla t_sale_detail $vendedores = UserData::getByIdStock($stock_id); //print_r($vendedores); $totalV=0; foreach($vendedores as $vendedor){ //ventas en tabla t_sale_detail por almacen $operations3 = OperationData::getByc2OK_general($product->barcode, $vendedor->id_user); foreach($operations3 as $op) { $totalV = $totalV + $op->qty; } } //ajuste salida $totalAjusteS=0; $totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id); //devoluciones de tabla operations $totalDev=0; $operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id); foreach($operations4 as $op2) { $totalDev = $totalDev + $op2->q; } //existencia ALMACEN 2 $existencia2=0; $existencia2 = ($entradas - $totalV + $totalDev) + $totalAjusteS; ?> <?php echo $stock_id = 3; echo "......"; // almacen 3--------------------------------------------- //compras $itotal2 =0; $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id); //ordenes de compra $itotal_O = 0; $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id); //Total de entradas $entradas = 0; $entradas = $itotal2 + $itotal_O['0']->sum; //ventas en tabla t_sale_detail $vendedores = UserData::getByIdStock($stock_id); //print_r($vendedores); $totalV=0; foreach($vendedores as $vendedor){ //ventas en tabla t_sale_detail por almacen $operations3 = OperationData::getByc2OK_general($product->barcode, $vendedor->id_user); foreach($operations3 as $op) { $totalV = $totalV + $op->qty; } } //ajuste salida $totalAjusteS=0; $totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id); //devoluciones de tabla operations $totalDev=0; $operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id); foreach($operations4 as $op2) { $totalDev = $totalDev + $op2->q; } //existencia $existencia3=0; $existencia3 = ($entradas - $totalV + $totalDev) + $totalAjusteS; ?> <?php echo $stock_id = 4; echo "......"; // almacen 4--------------------------------------------- //compras $itotal2 =0; $itotal2 = OperationData2::GetInputQByStock($product->id,$stock_id); //ordenes de compra $itotal_O = 0; $itotal_O = OperationData2::getBySumOC($product->barcode, $stock_id); //Total de entradas $entradas = 0; $entradas = $itotal2 + $itotal_O['0']->sum; //ventas en tabla t_sale_detail $vendedores = UserData::getByIdStock($stock_id); //print_r($vendedores); $totalV=0; foreach($vendedores as $vendedor){ //ventas en tabla t_sale_detail por almacen $operations3 = OperationData::getByc2OK_general($product->barcode, $vendedor->id_user); foreach($operations3 as $op) { $totalV = $totalV + $op->qty; } } //ajuste salida $totalAjusteS=0; $totalAjusteS = -1*OperationData2::getOutputQByStock($product->id, $stock_id); //devoluciones de tabla operations $totalDev=0; $operations4 = OperationData::getAllByProductIdAndStockDev($product->id, $stock_id); foreach($operations4 as $op2) { $totalDev = $totalDev + $op2->q; } //existencia $existencia4=0; $existencia4 = ($entradas - $totalV + $totalDev) + $totalAjusteS; ?> <tr class="<?php echo "danger"?>"> <td><?php echo $product->id; ?></td> <td><?php echo $product->barcode; ?></td> <td> <?php if($product->image!=""):?> <a href=""><img src="storage/products/<?php echo $product->image;?>" width="75" height="75"></a> <a href="?view=ventana&product_code=<?php echo $product->id;?>" target="_blank" onClick="window.open(this.href, this.target, 'width=400,height=600', directories=0, menubar=0,scrollbars=0,resizable=0); return false;">Zoom</a> <?php endif;?> </td> <td><?php echo $product->name; ?></td> <td> <?php echo $existencia1;?> </td> <td> <?php echo $existencia2;?> </td> <td> <?php echo $existencia3;?> </td> <td> <?php echo $existencia4;?> </td> <td style="width:250px;"> <form method="post" action="index.php?view=editproduct&id=<?php echo $product->id; ?>"> <input type="hidden" name="product_id" value="<?php echo $product->id; ?>"> <button class="btn btn-warning" title="editar producto"><a href="index.php?view=editproduct&id=<?php echo $product->id; ?>" class="btn btn-xs btn-warning"><i class="glyphicon glyphicon-pencil"></i></a></button> <button class="btn btn-secundary" title="editar Precio"><a href="index.php?view=PriceCam&id=<?php echo $product->id; ?>" class="btn btn-xs btn-dark"><i class="glyphicon glyphicon-edit"></i></a></button> </form> <div class="input-group"> <button class="btn btn-info" title="historial de producto"><a href="index.php?view=history&product_id=<?php echo $product->id; ?>&stock=1" class="btn btn-xs btn-info"><i class="glyphicon glyphicon-level-up"></i></a></button> <button class="btn btn-success" title="Surtir producto"><a href="index.php?view=re&product=&code=<?php echo $product->barcode; ?>" class="btn btn-xs btn-success"><i class="glyphicon glyphicon-repeat"></i></a></button> </div> <?php if($_SESSION['rol']==1){?> <td style="width:100px;"> <a href="#" onclick="prueba(<?php echo $product->id; ?>)" id="oper-<?php echo $product->id; ?>" class="btn tip btn-xs btn-danger" title="Eliminar"> <i class="glyphicon glyphicon-trash"></i></a> </td> <?php }?> </tr> <?php endforeach;?> <script> /* SweetAlert */ async function prueba(id) { const { isConfirmed, value } = await Swal.fire({ title: 'Eliminacion de Producto', text: "Se eliminara registro de manera permanente, desea continuar!", icon: 'warning', input: 'password', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Si, borrar!!' }); $.ajax({ type:'post', url:"./?action=logindel", //contentType: 'application/json; charset=utf-8', data: { pass: value, id: id }, dataType: 'json', success:function(res){ if(res==true){ Swal.fire( 'Buen trabajo!', 'Producto eliminado!', 'success') setTimeout(function(){ window.location.reload(); }, 3000); }else{ Swal.fire({ icon: 'error', title: 'Oops...', text: 'Datos invalidos', }) } } }) } set_focus("#txtsearchitem2"); $("#txtsearchitem2").val(""); </script> <?php } } else { echo "<script>alert('Estas metiendo un valor no numérico');</script>"; } ?> </tbody> </table> </div>