Skip to content

Commit d7fa1d6

Browse files
committed
1.0.12
- Döküman getirme düzenlendi - Getirilen dökümanı açma ve pdf olarak çıktı alam eklendi - Cem de yanımdaydı
1 parent ecce6b7 commit d7fa1d6

File tree

2 files changed

+52
-32
lines changed

2 files changed

+52
-32
lines changed

composer.json

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
{
2-
"name":"hasokeyk/elogo",
3-
"description":"elogo ile fatura kesme i\u0000lemi yapar",
4-
"type":"library",
5-
"require":{
6-
"guzzlehttp/guzzle":"^7.0.1",
7-
"php": ">=7.0.0"
8-
},
9-
"autoload":{
10-
"files":[
11-
"src/elogo_api.php",
12-
"src/elogo_src/autoload.php"
13-
]
14-
},
15-
"authors":[
16-
{
17-
"name":"Hasan Yüksektepe",
18-
19-
}
20-
],
21-
"minimum-stability":"stable"
2+
"name": "hasokeyk/elogo",
3+
"description": "elogo ile fatura kesme i\u0000lemi yapar",
4+
"type": "library",
5+
"require": {
6+
"guzzlehttp/guzzle": "^7.0.1",
7+
"php": ">=7.0.0",
8+
"ext-zip": "*"
9+
},
10+
"autoload": {
11+
"files": [
12+
"src/elogo_api.php",
13+
"src/elogo_src/autoload.php"
14+
]
15+
},
16+
"authors": [
17+
{
18+
"name": "Hasan Yüksektepe",
19+
"email": "[email protected]"
20+
}
21+
],
22+
"minimum-stability": "stable"
2223
}

src/elogo_api.php

+31-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
class elogo_api{
1212

13-
public $login = null;
14-
public $service = null;
15-
public $session_id = null;
16-
public $my_company = null;
13+
public $login = null;
14+
public $service = null;
15+
public $session_id = null;
16+
public $my_company = null;
1717
public $customer_company = null;
18-
public $invoice = null;
19-
public $efatura_xslt = (__DIR__).'/invoice_templates/CB9E5959-B6F9-4B28-99A8-A80006B3DE6B.xslt';
20-
public $earsiv_xslt = (__DIR__).'/invoice_templates/7141796B-2A35-4C87-9413-DC1867DDC8CC.xslt';
21-
public $xml_path = (__DIR__).'/';
22-
public $zip_path = (__DIR__).'/';
23-
public $invoce_prefix = 'HSN';
18+
public $invoice = null;
19+
public $efatura_xslt = (__DIR__).'/invoice_templates/CB9E5959-B6F9-4B28-99A8-A80006B3DE6B.xslt';
20+
public $earsiv_xslt = (__DIR__).'/invoice_templates/7141796B-2A35-4C87-9413-DC1867DDC8CC.xslt';
21+
public $xml_path = (__DIR__).'/';
22+
public $zip_path = (__DIR__).'/';
23+
public $invoce_prefix = 'HSN';
2424

2525
public function __construct($username, $password, $test = false){
2626

@@ -115,14 +115,14 @@ public function get_documents($document_type = 'EINVOICE'){
115115

116116
}
117117

118-
public function get_documents_data($document_type = 'EINVOICE', $format = 'PDF', $is_cancel = false){
118+
public function get_documents_data($invoice_number = null, $document_type = 'EINVOICE', $format = 'PDF', $is_cancel = false){
119119

120120
try{
121121
$result = $this->service->GetDocumentData([
122122
'DOCUMENTTYPE='.$document_type,
123123
'DATAFORMAT='.$format,
124124
'ISCANCEL='.$is_cancel ? '1' : '0',
125-
], $this->session_id);
125+
], $invoice_number);
126126
return [
127127
'status' => 'success',
128128
'message' => $result,
@@ -141,6 +141,25 @@ public function get_documents_data($document_type = 'EINVOICE', $format = 'PDF',
141141

142142
}
143143

144+
public function unzip($name = null, $binary = null){
145+
if($binary != null){
146+
$binary = base64_decode($binary);
147+
148+
$file_full_name = tempnam(sys_get_temp_dir(), 'pdf');
149+
$file_temp_path = sys_get_temp_dir();
150+
file_put_contents($file_full_name, $binary);
151+
152+
$zip = new ZipArchive;
153+
if($zip->open($file_full_name) === TRUE){
154+
$zip->extractTo($file_temp_path);
155+
$zip->close();
156+
return file_get_contents($file_temp_path.'/'.$name.'.pdf');
157+
}
158+
159+
}
160+
return false;
161+
}
162+
144163
public function get_company_info($vkn_tcn = null){
145164

146165
$param = [];

0 commit comments

Comments
 (0)