Início / Optitravel / Finance
VAT Space
This module is meant to evaluate an itinerary and determine its vat space. The following vat spaces are considered: - National (portuguese continent); - National Azores (portuguese azores islands); - National Madeira (portuguese madeira islands); - EU (European Union); - ExtraEU (Extra European Union).
This processo can be tested here (https://dsv.optigest.net:10240/optitravel/online/backoffice/modules/data_management/vat_codes/vat_space_simul.php).
Each of the itinerary stop can be given using iata codes for airports or cities as well as country codes. Here is an example of an itinerary format:
class \Finantial\vat_space
public function getVatSpaceFromItinerary($itinerary, $db, $debug = false): array {}
Inputs:
$itinerary = array(
[0] => array(
[type] => cityOrAirport
[code] => PAR
),
[1] => array(
[type] => cityOrAirport
[code] => ORY
),
[2] => array(
[type] => country
[code] => PT
),
);
Output:
array (
[status] => OK
[vat_space] => EU
)
These are the vat_space attribute return values: National, National Azores, National Madeira, EU, ExtraEU, Undefined.
Undefined is returned when the process is unable to determine the vat space.
From the vat space attribute it is possible to get the service code associated with it using the following code. These service codes are configured in the vat_space_service table and can, optionally, be defined by store.
function getServiceCodeFromVatSpace($store, $serviceTypesArr, $vatSpace, $db): array {}
Inputs:
$serviceTypesArr = array(
[0] => FlightFare
[1] => FlightTax
)
Outputs:
array (
[status] => OK
[services] => array(
[FlightFare] => AVIC
[FlightTax] => TAX
)
)
↑ (Última atualização: 05/11/2024)