����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.139.86.227 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/muebles/pos11/core/app/view/ |
Upload File : |
<?php if(isset($_GET["product_id"])): $stock = StockData::getById($_GET["stock"]); $product = ProductData::getById($_GET["product_id"]); //ventas salida $operations = OperationData::getAllByProductIdAndStock($product->id,$stock->id); //compras entrada $operations2 = OperationData2::getAllByProductIdAndStock($product->id,$stock->id); //ordenes de compra Entrada $itotal_O = OperationData2::getBySumOC($product->barcode, 1); //ventas en tabla t_sale_detail $operations3 = OperationData::getByc2OK($product->barcode); //devoluciones de tabla operations $operations4 = OperationData::getAllByProductIdAndStockDev($product->id,$stock->id); $totalV=0; foreach($operations3 as $op) { $totalV = $totalV + $op->qty; } $totalDev=0; foreach($operations4 as $op2) { $totalDev = $totalDev + $op2->q; } ?> <?php endif; ?> <div class="row"> <div class="col-md-12"> <div class="btn-group pull-right"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-download"></i> Descargar <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="report/history-word.php?id=<?php echo $product->id;?>&stock_id=<?php echo $_GET["stock"];?>">Word 2007 (.docx)</a></li> </ul> </div> <?php $array1=ProductData::getBycodeItem($product->barcode); //desglosamos todo el array if(isset($array1)){ foreach($array1 as $key=>$value){ if( $key == "stock") { // asignamos el valor de stock a una variable $sts=$value; } } }else{ $sts=0; } ?> </div> </div> <!-- Content Header (Page header) --> <section class="content-header"> <h1> <h1><?php echo $product->barcode; ?>-<?php echo $product->name; ?> <small>Historial</small></h1> </h1> <ol class="breadcrumb"> <li><a href="./?view=home">Inicio</a></li> <li><a href="./?view=stocks">Almacenes</a></li> <li><a href="./?view=inventary&stock=<?php echo $stock->id; ?>"><?php echo $stock->name;?></a></li> <li class="active">Historial</li> </ol> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-md-4"> <?php //revisar que entradas son $itotal = OperationData::GetInputQByStock($product->id,$stock->id); //abastecimientos $itotal2 = OperationData2::GetInputQByStock($product->id,$stock->id); //ajuste salida $totalAjusteS = -1*OperationData2::getOutputQYesF($product->id); $entradas = $itotal2; ?> <div class="small-box bg-aqua"> <div class="inner"> <h3><?php echo $itotal2+$totalDev + $itotal_O['0']->sum ; ?></h3> <p>Entradas</p> <p>(Devoluciones = <?php echo $totalDev; ?>)+(Compras = <?php echo $itotal2; ?>) +(OC = <?php echo $itotal_O['0']->sum; ?>)</p> </div> <div class="icon"> <i class="fa fa-usd"></i> </div> </div> </div> <div class="col-md-4"> <?php $total = OperationData::GetQByStock($product->id,$stock->id); //entradas por compras $total2 = OperationData2::GetQByStock($product->id,$stock->id); ?> <?php //diferencia entre entrada y salida tabla operation2 $ototal = -1*OperationData2::GetOutputQYesF($product->id); ?> <div class="small-box bg-green"> <div class="inner"> <h3><?php echo $entradas-$totalV+$totalDev-$totalAjusteS + + $itotal_O['0']->sum; ?></h3> <p>Disponible</p> <p>(Existencia - Ajustes_S=<?php echo $totalAjusteS;?>)( ini = <?php echo $sts; ?>)+ (O.C.)</p> </div> <div class="icon"> <i class="fa fa-cube"></i> </div> </div> <?php ?> </div> <div class="col-md-4"> <div class="small-box bg-yellow"> <div class="inner"> <h3><?php echo $totalV; ?></h3> <p>Salidas </p> <p>(Ventas = <?php echo $totalV; ?>)</p> </div> <div class="icon"> <i class="fa fa-shopping-cart"></i> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="clearfix"></div> <br> <?php $users2 = OperationData2::getAllByProductIdAndStock($product->id,$stock->id); $montoE=0; $cantT=0; $compras=0; if(count($users2)>0){ // si hay usuarios ?> <div class="box"> <div class="box-header"> <h3 class="box-title">Movimientos Entradas</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table table-bordered datatable table-hover"> <thead> <th>Folio Compra</th> <th>Precio Costo</th> <th>Cantidad</th> <th>Fecha</th> <th>Tipo</th> <th></th> </thead> <?php foreach($users2 as $user){ ?> <tr> <td> <a href="index.php?view=onere&id=<?php echo $user->re_id;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a><?php echo $user->re_id;?></td> <td>$<?php echo number_format($user->price_in,2);?></td> <td><?php $montoE = $montoE + ($user->q*$user->price_in); $cantT = $cantT + $user->q; $compras= $compras + $user->q; echo $user->q; ?></td> <td><?php echo $user->created_at;?></td> <td> <?php if($user->operation_type_id==1){ echo "Compra"; }else{ echo "Ajuste id: " ; echo $user->operation_type_id; } ?> </td> <td style="width:130px;"><a href="#" id="oper-<?php echo $user->id; ?>" class="btn btn-danger btn-xs">Eliminar</a></td> <script> $("#oper-"+<?php echo $user->id; ?>).click(function(){ x = confirm("Estas seguro que quieres eliminar esto ??"); if(x==true){ window.location = "index.php?view=deleteoperation2&ref=history&pid=<?php echo $user->product_id;?>&opid=<?php echo $user->id;?>"; } }); </script> </tr> <?php } ?> </table> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td>Gran total Compras:</td> <td align="right"><u><b>$ <?php echo number_format($montoE,2,'.',','); ?></b></u></td> </tr> <tr> <td>Compras/Entradas:</td> <td align="right"><u><b><?php echo $compras; ?></b></u></td> </tr> </table> </div> </div> </div> </div><!-- /.box-body --> </div><!-- /.box --> <?php }else{ echo "<p class='alert alert-danger'>No hay Compras de este producto</p>"; } ?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="clearfix"></div> <br> <?php $users2 = OperationData2::getAllByProductIdAndStock_OC($product->barcode,$stock->id); $montoE=0; $cantT=0; $compras=0; if(count($users2)>0){ // si hay usuarios ?> <div class="box"> <div class="box-header"> <h3 class="box-title">Movimientos por Orden de Compra</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table table-bordered datatable table-hover"> <thead> <th>Folio Orden Compra</th> <th>Precio Costo</th> <th>Cantidad</th> <th>Fecha</th> <th>Tipo</th> <th></th> </thead> <?php foreach($users2 as $user){ ?> <tr> <td> <a href="index.php?view=onereO&id=<?php echo $user->re_id;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a><?php echo $user->re_id;?></td> <td>$<?php echo number_format($user->price_in,2);?></td> <td><?php $montoE = $montoE + ($user->q*$user->price_in); $cantT = $cantT + $user->q; $compras= $compras + $user->q; echo $user->q; ?></td> <td><?php echo $user->created_at;?></td> <td> <?php if($user->operation_type_id==1){ echo "Orden Compra"; }else{ echo "Ajuste id: " ; echo $user->operation_type_id; } ?> </td> <td style="width:130px;"><a href="#" id="oper-<?php echo $user->id; ?>" class="btn btn-danger btn-xs">Eliminar</a></td> <script> $("#oper-"+<?php echo $user->id; ?>).click(function(){ x = confirm("Estas seguro que quieres eliminar esto ??"); if(x==true){ window.location = "index.php?view=deleteoperation2&ref=history&pid=<?php echo $user->product_id;?>&opid=<?php echo $user->id;?>"; } }); </script> </tr> <?php } ?> </table> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td>Gran total O. Compras:</td> <td align="right"><u><b>$ <?php echo number_format($montoE,2,'.',','); ?></b></u></td> </tr> <tr> <td>O. Compras/Entradas:</td> <td align="right"><u><b><?php echo $compras; ?></b></u></td> </tr> </table> </div> </div> </div> </div><!-- /.box-body --> </div><!-- /.box --> <?php }else{ echo "<p class='alert alert-danger'>No hay Ordenes de Compras de este producto</p>"; } ?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="clearfix"></div> <br> <?php //ventas en tabla t_sale_detail $users2 = OperationData::getByc2OK($product->barcode); if(count($users2)>0){ // si hay ?> <div class="box"> <div class="box-header"> <h3 class="box-title">Movimientos Ventas</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table table-bordered datatable table-hover"> <thead> <th>Ticket venta</th> <th>Precio</th> <th>Cantidad</th> <th>Folio</th> <th>Fecha Venta</th> <th>Fecha captura</th> <th></th> </thead> <?php $montoS= 0; $ventas=0; foreach($users2 as $user){ $search= $user->sale_id; //tabla t_sale $sell3 = SellData::getByIdSale($search); //tabla sell $sell34 = SellData::getByc($search); if(isset($sell34->id)) { $sell = $sell34->id; }else { $sell = "Error"; } ?> <tr> <td> <a href="index.php?view=onesell1&id=<?php echo $sell;?>&sale_id=<?php echo $user->sale_id;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a> <?php echo $sell; ?> </td> <td> $<?php echo number_format($user->price,2);?> </td> <td><?php echo $user->qty; $montoS= $montoS + ($user->qty*$user->price); $ventas=$ventas +$user->qty; ?></td> <td><?php echo $user->sale_id;?></td> <td><?php echo $sell3->sale_date;?></td> <td><?php echo $user->created_at;?></td> <td style="width:130px;"><a href="#" id="oper-<?php echo $user->autoid; ?>" class="btn btn-danger btn-xs">Eliminar</a></td> <script> $("#oper-"+<?php echo $user->autoid; ?>).click(function(){ x = confirm("Estas seguro que quieres eliminar esto ??"); if(x==true){ window.location = "index.php?view=deleteoperation2&ref=history&pid=<?php echo $user->barcode;?>&opid=<?php echo $user->autoid;?>"; } }); </script> </tr> <?php } ?> </table> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td>Gran total Ventas:</td> <td align="right"><u><b>$ <?php echo number_format($montoS,2,'.',','); ?></b></u></td> </tr> <tr> <td>Cantidad de Ventas:</td> <td align="right"><u><b><?php echo $ventas; ?></b></u></td> </tr> </table> </div> </div> </div> </div><!-- /.box-body --> </div><!-- /.box --> <?php }else{ $montoS=0; echo "<p class='alert alert-danger'>No hay Ventas de este producto</p>"; } ?> </div> </div> <div class="row"> <div class="col-md-12"> <div class="clearfix"></div> <br> <?php //ventas en tabla t_sale_detail $users2 = OperationData::getAllByProductIdAndStockDev($product->id,$stock->id); //total de devoluciones inicialiacion $montoD =0; $devoluciones=0; if(count($users2)>0){ // si hay ?> <div class="box"> <div class="box-header"> <h3 class="box-title">Movimientos Devoluciones</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table table-bordered datatable table-hover"> <thead> <th>Ticket venta</th> <th>Precio</th> <th>Cantidad</th> <th>Folio</th> <th>Fecha</th> <th></th> </thead> <?php foreach($users2 as $user){ ?> <tr> <td> <a href="index.php?view=onesell1&id=<?php echo $user->id;?>" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a> <?php echo $user->id; ?> </td> <td> $ <?php echo number_format($user->price_out,2);?> </td> <td><?php echo $user->q;?></td> <?php $montoD = $montoD +($user->q*$user->price_out); $devoluciones=$devoluciones+$user->q; ?> <td><?php echo $user->sell_id;?></td> <td><?php echo $user->created_at;?></td> <td style="width:130px;"><a href="#" id="oper-<?php echo $user->autoid; ?>" class="btn btn-danger btn-xs">Eliminar</a></td> <script> $("#oper-"+<?php echo $user->autoid; ?>).click(function(){ x = confirm("Estas seguro que quieres eliminar esto ??"); if(x==true){ window.location = "index.php?view=deleteoperation2&ref=history&pid=<?php echo $user->barcode;?>&opid=<?php echo $user->autoid;?>"; } }); </script> </tr> <?php } ?> </table> <div class="row"> <div class="col-md-4"> <div class="box box-primary"> <table class="table table-bordered"> <tr> <td>Gran total Devoluciones:</td> <td align="right"><u><b>$ <?php echo number_format($montoD,2,'.',','); ?></b></u></td> </tr> <tr> <td>Cantidad Devoluciones:</td> <td align="right"><u><b><?php echo $devoluciones; ?></b></u></td> </tr> </table> </div> </div> </div> </div><!-- /.box-body --> </div><!-- /.box --> <?php }else{ echo "<p class='alert alert-danger'>No hay Devoluciones de este producto</p>"; } ?> </div> </div> <div class="box"> <div class="box-header"> <h3 class="box-title">Saldos Por Producto</h3> </div><!-- /.box-header --> <div class="box-body"> <table class="table table-bordered datatable table-hover"> <thead> <th>Compras</th> <th>Ventas</th> <th>Devoluciones</th> <th>Neto</th> </thead> <tr> <td align="right"><u><b>$ <?php echo number_format($montoE ,2,'.',','); ?></b></u></td> <td align="right"><u><b>$ <?php echo number_format($montoS,2,'.',','); ?></b></u></td> <td align="right"><u><b>$ <?php echo number_format($montoD,2,'.',','); ?></b></u></td> <td align="right"><u><b>$ <?php echo number_format($montoS-$montoE-$montoD,2,'.',','); ?></b></u></td> </tr> </table> </div> </div> <?php if( ($montoS-$montoE) < 1 and isset($user->price) ): ?> <div class="small-box bg-red"> <div class="inner"> <h3>Analizar <u><?php if(isset($user->price)) { echo number_format( ($montoE-$montoS)/$user->price ,2); } else{ //valor gastos fijos $no=27; $configCosto = ConfigurationData::getByIdConf($no); $costofijo = $configCosto->val; //(P x U) – (Cvu x U) – CF = 0 $user->price_in*0.30)/($user->price_out-( $user->price_in +($user->price_in*0.30) ) echo number_format( $costofijo /( ($user->price_out)-($user->price_in +($user->price_in*0.30)) ) , 2) ; } ?></u> punto de equilibrio</h3> <p>Punto de Equilibro </p> <p>(Monto en Dinero = $ <?php echo number_format($montoS-$montoE); ?>)</p> </div> <div class="icon"> <i class="fa fa-shopping-cart"></i> </div> </div> <?php else: ?> <?php if(isset($user->price)): ?> <div class="small-box bg-green"> <div class="inner"> <h3><u> Punto de equilibrio: <?php echo number_format( ( 300/(1-( ($montoE+300)/$montoS) ) ), 2); ?> piezas</u></h3> <p>Ganancia en Porcentaje = <?php echo number_format( 100-($montoE*100)/$montoS, 2 ); ?> % </p> <p>(Utilidad = $<?php echo number_format($montoS-$montoE,2); ?>)</p> </div> <div class="icon"> <i class="fa fa-shopping-cart"></i> </div> </div> <?php endif; ?> <?php endif; ?> </section><!-- /.content -->