Topic: Generating each invoice like xml to TAX GOVERMENT server in my country

Hi,

In my country from next month we will be required to send XML to Government server asking code for validate legal invoice. 

Several providers are doing this service like separate site for invoice. Nevertheless, this is not good for me, duplicate work.  This is the reason I am looking for advice for include in code of frontaccounting for sending this info to API already created, and save time with only on software doing both works.  I have code in PHP working very good with API in testing server, but when I add this code to actual invoicing code of frontaccounting, I cannot be able to realize complete process in destination server of testing.  Can you let me know your opinion about important steps in my situation.  Thanks.

Re: Generating each invoice like xml to TAX GOVERMENT server in my country

THIS IS MY CODE SPECIFIC WORKING GOOD ALONE

function aplicafe() {
    //API Url
$url = 'https://XXXX/api_recepcion.php';
 
//Initiate cURL.
$ch = curl_init($url);
 
 //SQL DE CONSULTA   PARA ARMAR   $strjson
    
    $strjson = '{
  "usuario": "XXXXXX@XXXXXX.net",
  "clave": "XXXXXXX",
  "cedula": "111111111",
  "sucursal": "001",
  "cli_nombre": "John  Doe",
  "cli_cedula": "304490949",
  "cli_tipo": "01",
  "plazo": "0",
  "moneda": "2",
  "mediopago": "4",
  "tipopago": "1",
  "documento": "10",
  "observación": "",
  "detalle": [
    {
      "codigo": "6",
      "unidad": "Sp",
      "descripcion": "Configuracion de sitio web ",
      "cantidad": "1 ",
      "precio": "10.00",
      "descuento": 0,
      "impuesto": 13,
      "tipo": 2
    }
  ]
}';
    
    
    
//Encode the array into JSON.
$jsonDataEncoded = json_encode($strjson);
 
//Tell cURL that we want to send a POST request.
curl_setopt($ch, CURLOPT_POST, 1);
 
//Attach our encoded JSON string to the POST fields.
curl_setopt($ch, CURLOPT_POSTFIELDS, $strjson );
 
//Set the content type to application/json
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); 
 
//Execute the request
$result = curl_exec($ch);
    return $result;
}

Re: Generating each invoice like xml to TAX GOVERMENT server in my country

Map the JSON / XML output to the FrontAccounting table fields / computed fields in English using the Standard US chart of accounts.