Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = 'invoice';
- $data_send = array();
- $data_send['companyVatCode'] = $this->companyVatCode;
- $data_send['issueDate'] = date('Y-m-d');
- $data_send['seriesName'] = 'RO-SRV';
- $amount = number_format((int)$order['amount'] / 1.21, 2);
- if ($user_info['judet'] == 'Bucureşti'){
- $sector = ', '.$user_info['sector'];
- } else {
- $sector = '';
- }
- if ($user_info['legal'] == 1) {
- $data_send['client'] = array(
- 'name' => transliteration_text($user_info['companiei']),
- "vatCode" => $user_info['CUI'],
- 'address' => transliteration_text($user_info['address']),
- 'email' => $user_info['email'],
- 'country' => "Romania",
- 'county' => transliteration_text($user_info['judet']),
- 'city' => transliteration_text($user_info['city']),
- 'phone' => $user_info['phone'],
- "isTaxPayer" => true
- );
- } else {
- $data_send['client'] = array(
- 'name' => transliteration_text($user_info['name']),
- 'email' => $user_info['email'],
- 'address' => transliteration_text($user_info['address']),
- 'country' => "Romania",
- 'county' => transliteration_text($user_info['judet']),
- 'city' => transliteration_text($user_info['city']),
- 'phone' => $user_info['phone'],
- 'vatCode' => "-",
- "isTaxPayer" => false
- );
- }
- $data_send['products'][] = array(
- "name" => 'Plata pentru serviciile de acces la stații de alimentare a bateriilor vehiculelor electrice',
- "code" => 1,
- "measuringUnitName" => "buc",
- "currency" => "RON",
- "quantity" => 1,
- "price" => $amount,
- "taxPercentage" => 21
- );
- $json_send = json_encode($data_send);
- $response = $this->curl_init($url, 'POST', $json_send);
Advertisement
Add Comment
Please, Sign In to add comment