Merge branch 'master' of https://bitbucket.org/1ka/1ka
This commit is contained in:
commit
1726f01924
@ -295,10 +295,12 @@ class ApiNarocilaController{
|
||||
// Mora placati ddv - cena ostane ista
|
||||
if(UserNarocila::checkPayDDV($podjetje_davcna, $podjetje_drzava)){
|
||||
$this->response['cena'] = $cena;
|
||||
$this->response['ddv'] = true;
|
||||
}
|
||||
// Ne placa ddv - placa samo osnovo
|
||||
else{
|
||||
$this->response['cena'] = number_format(floatval($cena) / 1.22, 2, '.', '');
|
||||
$this->response['ddv'] = false;
|
||||
}
|
||||
|
||||
$this->response['success'] = true;
|
||||
|
@ -1267,7 +1267,11 @@ class UserNarocila{
|
||||
if(!isset($countries_eu[$drzava]))
|
||||
return false;
|
||||
|
||||
// Drugace gre za tujca iz EU - preverimo ce je zavezanec
|
||||
// Drugace gre za tujca iz EU
|
||||
// Pocistimo davcno stevilko - ohranimo samo stevilke ce je vnesel v obliki "DE12345678" -> "12345678"
|
||||
$davcna_stevilka = preg_replace('[\D]', '', $davcna_stevilka);
|
||||
|
||||
// Preverimo, ce je zavezanec
|
||||
$client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");
|
||||
try{
|
||||
$response = $client->checkVat( array('countryCode' => $countries_eu[$drzava], 'vatNumber' => $davcna_stevilka) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user