Tresguerras

Tresguerras

[insert_php]
require_once(“/lib/nusoap.php”);

$client = new nusoap_client(“http://intranet.tresguerras.com.mx/WS/Customer/ws_Peri.php?wsdl”, true);

$err = $client->getError();
if($err){
echo ‘

Constructor error

'.$err.'

‘;
}

# =================== OPCION 1 ===================
$datos = array(
“tarifa” => “0”,
“no_bultos_1” => “1”,
“contenido_1” => “20081;02”,
“largo_1” => “.5”,
“ancho_1” => “.5”,
“alto_1” => “.5”,
“peso_1” => “50”,

“cp_origen” => “38110”,
“cp_destino” => “64550”,

“bandera_ead” => “S”,
“bandera_recoleccion” => “S”,
“retencion_iva_cliente” => “S”,

“valor_declarado” => “0”);

/*
# =================== OPCION 2 ===================
$datos = array(
“tarifa” => “3”,
“no_bultos_1” => “1”,
“contenido_1” => “20081;01”,

“cp_origen” => “38110”,
“cp_destino” => “64550”,

“bandera_ead” => “S”,
“bandera_recoleccion” => “S”,
“retencion_iva_cliente” => “S”,

“valor_declarado” => “0”);
*/
$params=array(“DatosForm” => $datos);

# COTIZACION
$result = $client->call(“SetPeri”, $params);

if($client->fault){
echo ‘

Fault

‘;
}else{
$err = $client->getError();
if($err){
echo ‘

Error

'.$err.'

‘;
echo $client->response;
}else{

echo “

RESULADO

              ============ DESGLOSE DE TOTAL =================================
              Flete = ".$result["return"]["flete"]."
              Recoleccion = ".$result["return"]["recoleccion"]."
              Entrga a Domicilio = ".$result["return"]["entrega_ad"]."
              Ocurre = ".$result["return"]["maniobras_ocurre"]."
              Seguro = ".$result["return"]["seguro"]."
              Cpac = ".$result["return"]["cpac"]."
              Otros servicio = ".$result["return"]["otros"]."

              ============ TOTALES ===========================================
              Importe = ".$result["return"]["t_importe"]."
              IVA = ".$result["return"]["iva"]."
              Total = ".$result["return"]["total"]."

              ============ DIAS DE ENTREGA ===================================
              Dias = ".$result["return"]["tarifa_unica"]."

              ============ SECCION DE ERROR ==================================
              Error = ".$result["return"]["error"]."
              Error Descripcion = ".$result["return"]["descripcion_error"]."

              

“;

}
}

[/insert_php]

Pericimbras

Leave a comment

dieciocho + 11 =

X