WHERE guia='".$_GET[guia]."' AND idusuario='".$_GET[idpagina]."' ";
		mysql_query($sql,$l) or postError($sql);
		echo "ok";
	}
	
	if($_GET[accion]==14){
		/*$s="SELECT SUM(ncd.importe)AS importe FROM notacredito nc 
		INNER JOIN notacreditodetalle ncd ON nc.folio=ncd.folionotacredito  
		WHERE nc.folio=$_GET[folio] AND nc.cliente=$_GET[cliente] group by nc.folio order by nc.fechanotacredito";*/
		
		if($_GET[cliente]!="")
			$elcliente = " AND n.cliente='$_GET[cliente]'";
		
		$s = "SELECT SUM(importe)*(1+n.impuestoporc) AS importe 
		FROM notacreditodetalle nd
		INNER JOIN notacredito n ON nd.folionotacredito = n.folio
		WHERE folionotacredito=$_GET[folio] $elcliente";
		$r=mysql_query($s,$l)or postError($s); 
		$registros= array();
		
		if (mysql_num_rows($r)>0){
				while ($f=mysql_fetch_object($r)){
				$registros[]=$f;	
				}
			echo str_replace('null','""',json_encode($registros));
		}else{
			echo str_replace('null','""',json_encode(0));
		}
	}
?>
				<guardado>1</guardado>
				<folioguia>$_GET[newfolio]</folioguia>
				<rastreo>$rastreo</rastreo>
				</datos>
				</xml>";
				
		if($estado == 'ALMACEN ORIGEN'){
			$s = "UPDATE lasalertas SET gunoem=gunoem+1 WHERE sucursal=$_SESSION[IDSUCURSAL];";
			mysql_query($s,$l) or postError(mysql_error($l).$s);
			$s = "UPDATE lasalertas SET mereem=mereem+1 WHERE sucursal=$_GET[idsucursaldestino];";
			mysql_query($s,$l) or postError(mysql_error($l).$s);
			$s = "UPDATE lasalertas SET gupore=gupore+1 WHERE sucursal=$_GET[idsucursaldestino];";
			mysql_query($s,$l) or postError($s."<BR>".mysql_error($l));
			
			$s = "UPDATE lasalertas SET evpegeguem=evpegeguem-1 WHERE sucursal=$_SESSION[IDSUCURSAL];";
			mysql_query($s,$l) or postError(mysql_error($l).$s);
		}
	}
	
	//solicitar guias
	if($_GET[accion] == 5){
		
		//obtener la unidad si es ke van en unidad
		$s = "select ifnull(unidad,'') as unidad from seguimiento_guias where guia = '$_GET[folio]' order by id desc limit 1";
		$r = mysql_query($s,$l) or die($s);
		$etiquetaunidad = "";
		if(mysql_num_rows($r)>0){
			$f = mysql_fetch_object($r);
			if($f->unidad!=""){
				$etiquetaunidad = "<unidadguia>".cambio_texto($f->unidad)."</unidadguia>";
			}
               }
               ******************************************************************/
            if ($gcac_related_visit) {
                $grow = sqlQuery("SELECT COUNT(*) AS count FROM forms " . "WHERE pid = '{$patient_id}' AND encounter = '{$encounter}' AND " . "deleted = 0 AND formdir = 'LBFgcac'");
                if (empty($grow['count'])) {
                    // if there is no gcac form
                    postError(xl('GCAC visit form is missing'));
                }
            }
            // end if
            /*****************************************************************/
            if (!$billed) {
                postError($GLOBALS['simplified_demographics'] ? xl('Not checked out') : xl('Not billed'));
            }
            if (!$encounter) {
                postError(xl('No visit'));
            }
            if (!$charges) {
                $billed = "";
            }
            $docrow['charges'] += $charges;
            $docrow['copays'] += $copays;
            if ($encounter) {
                ++$docrow['encounters'];
            }
            if ($_POST['form_details']) {
                ?>
 <tr>
  <td>
   &nbsp;<?php 
                echo $docname == $docrow['docname'] ? "" : $docname;
							sucursalcobro='$_SESSION[IDSUCURSAL]' WHERE guia='$f->guia' AND pagado='N' ";					
							$d = mysql_query(str_replace("''",'NULL',$sq),$l) or postError($sq);
						}
					}
				}
			}
			
			# se actualiza el reparto para ponerlo como liquidado
			$sql="UPDATE repartomercanciaead SET liquidado = 1
			WHERE folio = '$_GET[idreparto]' AND sucursal = '$_SESSION[IDSUCURSAL]'";
			mysql_query($sql,$l) or postError($sql);
			
			# se actualiza los datos de devyliq para ponerlo como liquidado
			$sql="UPDATE devyliqautomatica SET liquidada = 'S'
			WHERE reparto = '$_GET[idreparto]' AND sucursal = '$_SESSION[IDSUCURSAL]'";
			mysql_query($sql,$l) or postError($sql);
			
			echo "ok";
			
	}else if($_GET[accion]==4){
		$foliosucursal = $_GET[folio];
		$s = "SELECT id FROM liquidacionead WHERE folio = $_GET[folio] AND sucursal = $_SESSION[IDSUCURSAL]";
		$r=mysql_query($s,$l)or die($s); 
		$f = mysql_fetch_object($r);
		$_GET[folio] = $f->id;
	
		$s = "SELECT ce1.id idempleado1, CONCAT_WS(' ', ce1.nombre, ce1.apellidopaterno, ce1.apellidopaterno) AS conductor1,
		ce2.id idempleado2, CONCAT_WS(' ', ce2.nombre, ce2.apellidopaterno, ce2.apellidopaterno) AS conductor2,
		cu.numeroeconomico unidad,
		ld.idreparto,ld.entregadas,ld.devueltas,ld.pagadas_credito,ld.pagadas_contado,
		ld.tpagadas_credito,ld.tpagadas_contado,ld.porcobrar_contado,ld.porcobrar_credito,
Esempio n. 5
0
 public function transform($operation, $parameters)
 {
     if ($this->properties["mimetype"] == "image/tilepic") {
         return false;
     }
     # no transformations for Tilepic
     if (!$this->handle) {
         return false;
     }
     if (!$this->info["TRANSFORMATIONS"][$operation]) {
         # invalid transformation
         postError(1655, _t("Invalid transformation %1", $operation), "WLPlugGD->transform()");
         return false;
     }
     # get parameters for this operation
     $sparams = $this->info["TRANSFORMATIONS"][$operation];
     $w = $parameters["width"];
     $h = $parameters["height"];
     $cw = $this->get("width");
     $ch = $this->get("height");
     if ((bool) $this->properties['no_upsampling']) {
         $w = min($cw, round($w));
         $h = min($ch, round($h));
     }
     $do_crop = 0;
     switch ($operation) {
         # -----------------------
         case 'SCALE':
             $aa = $parameters["antialiasing"];
             if ($aa <= 0) {
                 $aa = 0;
             }
             switch ($parameters["mode"]) {
                 # ----------------
                 case "width":
                     $scale_factor = $w / $cw;
                     $h = $ch * $scale_factor;
                     break;
                     # ----------------
                 # ----------------
                 case "height":
                     $scale_factor = $h / $ch;
                     $w = $cw * $scale_factor;
                     break;
                     # ----------------
                 # ----------------
                 case "bounding_box":
                     $scale_factor_w = $w / $cw;
                     $scale_factor_h = $h / $ch;
                     $w = $cw * ($scale_factor_w < $scale_factor_h ? $scale_factor_w : $scale_factor_h);
                     $h = $ch * ($scale_factor_w < $scale_factor_h ? $scale_factor_w : $scale_factor_h);
                     break;
                     # ----------------
                 # ----------------
                 case "fill_box":
                     $scale_factor_w = $w / $cw;
                     $scale_factor_h = $h / $ch;
                     $w = $cw * ($scale_factor_w > $scale_factor_h ? $scale_factor_w : $scale_factor_h);
                     $h = $ch * ($scale_factor_w > $scale_factor_h ? $scale_factor_w : $scale_factor_h);
                     $do_crop = 1;
                     break;
                     # ----------------
             }
             $w = round($w);
             $h = round($h);
             if ($w > 0 && $h > 0) {
                 $r_new_img = imagecreatetruecolor($w, $h);
                 if (!imagecopyresampled($r_new_img, $this->handle, 0, 0, 0, 0, $w, $h, $cw, $ch)) {
                     $this->postError(1610, _t("Couldn't resize image"), "WLPlugGD->transform()");
                     return false;
                 }
                 imagedestroy($this->handle);
                 $this->handle = $r_new_img;
                 if ($do_crop) {
                     $r_new_img = imagecreatetruecolor($parameters["width"], $parameters["height"]);
                     imagecopy($r_new_img, $this->handle, 0, 0, 0, 0, $parameters["width"], $parameters["height"]);
                     imagedestroy($this->handle);
                     $this->handle = $r_new_img;
                     $this->properties["width"] = $parameters["width"];
                     $this->properties["height"] = $parameters["height"];
                 } else {
                     $this->properties["width"] = $w;
                     $this->properties["height"] = $h;
                 }
             }
             break;
             # -----------------------
         # -----------------------
         case "ROTATE":
             $angle = $parameters["angle"];
             if ($angle > -360 && $angle < 360) {
                 if (!($r_new_img = imagerotate($this->handle, $angle, 0))) {
                     postError(1610, _t("Couldn't rotate image"), "WLPlugGD->transform()");
                     return false;
                 }
                 imagedestroy($this->handle);
                 $this->handle = $r_new_img;
             }
             break;
             # -----------------------
         # -----------------------
         case "DESPECKLE":
             # noop
             break;
             # -----------------------
         # -----------------------
         case "MEDIAN":
             # noop
             break;
             # -----------------------
         # -----------------------
         case "SHARPEN":
             # noop
             break;
             # -----------------------
         # -----------------------
         case "UNSHARP_MASK":
             # noop
             break;
             # -----------------------
         # -----------------------
         case "SET":
             while (list($k, $v) = each($parameters)) {
                 $this->set($k, $v);
             }
             break;
             # -----------------------
     }
     return true;
 }
				
				
				//facturacion electronica
				
				$arre_cliente = null;
				$empresa = null;
		
				$s = "SELECT * FROM catalogofoliosfacturacion ORDER BY id DESC LIMIT 1";
				$rm = mysql_query($s,$link) or postError("$s");
				$fm = mysql_fetch_object($rm);
				$fe_anoaprobacion 		= $fm->anoaprobacion;
				$fe_numeroaprobacion 	= $fm->numeroaprobacion;
				$fe_serie 					= $fm->serie;
				
				$s = "SELECT * FROM certificates_empresa";
				$rm = mysql_query($s,$link) or postError("$s");
				$fm = mysql_fetch_object($rm);
				$fe_nombre		= $f->nombre;
				$fe_rfc			= $f->rfc;
				$fe_calle		= $f->calle;
				$fe_numeroint	= $f->numeroint;
				$fe_numeroext	= $f->numeroext;
				$fe_colonia		= $f->colonia;
				$fe_cp			= $f->cp;
				
				#empresa
				$empresa['Business']['name'] = $fe_nombre;
				$empresa['Business']['rfc'] = $fe_rfc;
				$empresa['Business']['street'] = $fe_calle;
				//$empresa['Business']["inside_number"] = $fe_numeroint;
				$empresa['Business']["outside_number"] = $fe_numeroext;
Esempio n. 7
0
     // End IPPF stuff
 }
 // end while
 if ($gcac_related_visit) {
     $grow = sqlQuery("SELECT COUNT(*) AS count FROM forms " . "WHERE pid = '{$patient_id}' AND encounter = '{$encounter}' AND " . "deleted = 0 AND formdir = 'LBFgcac'");
     if (empty($grow['count'])) {
         // if there is no gcac form
         postError('GCAC visit form is missing');
     }
 }
 // end if
 if (!$billed) {
     postError($GLOBALS['simplified_demographics'] ? 'Not checked out' : 'Not billed');
 }
 if (!$encounter) {
     postError('No visit');
 }
 if (!$charges) {
     $billed = "";
 }
 $docrow['charges'] += $charges;
 $docrow['copays'] += $copays;
 if ($encounter) {
     ++$docrow['encounters'];
 }
 if ($details) {
     $xml_string .= "<apptvisits>";
     if ($docname == $docrow['docname']) {
         $docname;
     }
     $xml_string .= "<practitioner>" . $docname . "</practitioner>";
Esempio n. 8
0
		$arre_cliente['informacion']["col"] = $_POST[colonia];
		$arre_cliente['informacion']["cp"] = $_POST[cp];
		# de la facturacion
		$arre_cliente['informacion']["municipio"] = $_POST[ciudad];
		$arre_cliente['informacion']["state"] = $_POST[estado];
		$arre_cliente['informacion']["country"] = "MEXICO";
		
		
		$miClase = new NotaCreditoElectronica();
		$miClase->setDatos($arre_cliente,$empresa);
		$arre = $miClase->crearNotaCredito();
		
		$s = "update notacredito set xml='".$arre[1]."', cadena='".$arre[2]."', 
		subtotal='$var_subtotal',iva='$var_iva',ivaretenido='$var_ivaretenido',total='$var_total'
		where folio = $folio";
		$r = mysql_query($s,$conexion) or postError("$s");
		$mensaje="Los datos han sido guardados correctamente";
		echo "
			<script>
				document.location.href = 'notacredito.php?folionotacredito=$folio&mensaje=$mensaje';
			</script>
		";
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" />
<script src="../../javascript/shortcut.js"></script>
<script src="../../javascript/ventanas/js/ventana-modal-1.3.js"></script>
<script src="../../javascript/ventanas/js/ventana-modal-1.1.1.js"></script>