diff --git a/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php b/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php index dabdbeabc..fe2581fbe 100644 --- a/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php +++ b/frontend/payments/cebelica/InvoiceFox/cebelcaApi.php @@ -112,27 +112,35 @@ function ustvariPredracun($api,$podatki,$lang='si') { ); } + // Pri sklicevanju na 30. clen mora na racunu pisati drzava + $country = ($podatki['podjetjeime'] == "" && $podatki['ddv'] != 1) ? $podatki['drzava'] : ''; + // dodaj partnerja - $r = $api->assurePartner(array( - 'name' => $arr['name'], - 'street' => $arr['street'], - 'postal' => $arr['postal'], - 'city' => $arr['city'], - 'vatid' => $arr['vatid'], - 'phone' => $podatki['telefon'], - 'website' => '', - 'email' => $podatki['email'], - 'notes' => '', - 'vatbound' => $vatbound, - 'custaddr' => '', - 'payment_period' => 1, - 'street2' => '', - 'country' => '') + $r = $api->assurePartner( + array( + 'name' => $arr['name'], + 'street' => $arr['street'], + 'postal' => $arr['postal'], + 'city' => $arr['city'], + 'vatid' => $arr['vatid'], + 'phone' => $podatki['telefon'], + 'website' => '', + 'email' => $podatki['email'], + 'notes' => '', + 'vatbound' => $vatbound, + 'custaddr' => '', + 'payment_period' => 1, + 'street2' => '', + 'country' => $country + ) ); - - if ($r->isOk()) { // partner ustrezno dodan + + // partner ustrezno dodan + if ($r->isOk()) { + $clientIdA = $r->getData(); - $clientId=0; + $clientId=0; + if(isset($clientIdA[0]['id'])) $clientId = $clientIdA[0]['id']; diff --git a/frontend/payments/classes/class.UserNarocilaCebelica.php b/frontend/payments/classes/class.UserNarocilaCebelica.php index 7b63c6da2..39ac710c3 100644 --- a/frontend/payments/classes/class.UserNarocilaCebelica.php +++ b/frontend/payments/classes/class.UserNarocilaCebelica.php @@ -181,6 +181,8 @@ class UserNarocilaCebelica{ 'telefon' => $this->narocilo['phone'], + 'drzava' => $this->narocilo['podjetje_drzava'], + 'podjetjeime' => $this->narocilo['podjetje_ime'], 'podjetjenaslov'=> $this->narocilo['podjetje_naslov'], 'podjetjepostna'=> $this->narocilo['podjetje_postna'],