'.get_option("User").'
'.get_option("Password").'
'.get_option("CodSer").'
'.get_option("Nombre_Cargue").'
';
$strXMLCobro='
'.get_option("UserCobro").'
'.get_option("PasswordCobro").'
'.get_option("CodSerCobro").'
'.get_option("Nombre_Cargue").'
';
$Ide_CodFacturacionNormal=get_option("CodSer");
$Ide_CodFacturacionCobro=get_option("CodSerCobro");
$Guias=admonpedidosservientrega_SanitizeArrays(isset($_POST["Guias"]) ? (array) $_POST["Guias"] : array());
$ConCobro=admonpedidosservientrega_SanitizeArrays(isset($_POST["ConCobro"]) ? (array) $_POST["ConCobro"] : array());
for($i=0;$i';
if ($ConCobro[$i]==0) {
$strXML.=$strXMLNormal;
$Ide_CodFacturacion=$Ide_CodFacturacionNormal;
}
if ($ConCobro[$i]==1) {
$strXML.=$strXMLCobro;
$Ide_CodFacturacion=$Ide_CodFacturacionCobro;
}
$strXML.="
".$Guias[$i]."
".$Guias[$i]."
".$Ide_CodFacturacion."
1
false
";
$servicio= new admonpedidosservientrega_ServicioWeb_Cliente('http://web.servientrega.com:8081/GeneracionGuias.asmx?wsdl');
$servicio->llamarServicioComplejo('GenerarGuiaSticker',$strXML);
$resultado=admonpedidosservientrega_simplexml_load_string_nons($servicio->respuesta)->soap_Body->GenerarGuiaStickerResponse->GenerarGuiaStickerResult;
$StickersGenerados="";
$StickersErrores="";
if($resultado=='true')
{
$pdf = base64_decode(admonpedidosservientrega_simplexml_load_string_nons($servicio->respuesta)->soap_Body->GenerarGuiaStickerResponse->bytesReport);//$stickerPDF);
//$rutaPDF=_PS_MODULE_DIR_.'stickers/'.$Guias[$i].'sticker.pdf';
//file_put_contents( _PS_MODULE_DIR_.'Servientrega/views/stickers/'.$Guias[$i].'sticker.pdf', $pdf);
file_put_contents( dirname(__FILE__)."/stickers/".$Guias[$i].'sticker.pdf', $pdf);
$estado=8;
$StickersGenerados.=$Guias[$i].",";
echo "
bien".esc_html($StickersGenerados);
}
else
{
$estado=9;
$mensaje="Se presentaron errores en la generación del Sticker";
$StickersErrores.=$Guias[$i];
echo "
mal".esc_html($StickersErrores);
}
$sql="UPDATE wp_PedidoEnvio set idEstado=".$estado." where NroGuia=".$Guias[$i];
$result = $wpdb->get_results($sql);
}
}