Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mayoz authored Dec 28, 2016
1 parent 94be804 commit bd722f8
Showing 1 changed file with 46 additions and 33 deletions.
79 changes: 46 additions & 33 deletions src/Bundle/Sale.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function get($page = 1, $limit = 25)
{
return $this->client->call("sales_invoices", [
'page' => $page,
'per_page' => $limit
'per_page' => $limit,
], 'GET');
}

Expand All @@ -47,7 +47,7 @@ public function get($page = 1, $limit = 25)
public function create(array $params)
{
return $this->client->call("sales_invoices", [
'sales_invoice' => $params
'sales_invoice' => $params,
], 'POST');
}

Expand All @@ -72,7 +72,7 @@ public function find($id)
public function update($id, array $params)
{
return $this->client->call("sales_invoices/{$id}", [
'sales_invoice' => $params
'sales_invoice' => $params,
], 'PUT');
}

Expand All @@ -86,7 +86,7 @@ public function update($id, array $params)
public function paid($id, array $params)
{
return $this->client->call("sales_invoices/{$id}/payments", [
'payment' => $params
'payment' => $params,
], 'POST');
}

Expand Down Expand Up @@ -121,57 +121,70 @@ public function delete($id)
public function trashed($timestamp)
{
return $this->client->call("sales_invoices/deleted_objects", array_filter([
'last_synch' => $timestamp
'last_synch' => $timestamp,
]), 'GET');
}

/** Retrieve invoice e invoice type

/**
* Create a new e-invoice record.
*
* @param Sales invoice id}
* @param int $id
* @param array $params
* @return array
*/
public function eDocumentType($invoiceID){
return $this->client->call("sales_invoices/{$invoiceID}/e_document_type",[],'GET');
public function createEInvoice($id, array $params)
{
return $this->client->call("sales_invoices/{$id}/e_invoice", [
'e_invoice' => $params,
], 'POST');
}

/** Retrieve e_invoice inboxes
/**
* Create a new e-archive record.
*
* @param vkn
* @param int $id
* @param array $params
* @return array
*/
public function eInvoiceInboxes($vkn){
return $this->client->call("e_invoice_inboxes",["vkn"=>$vkn],'GET');
public function createEArchive($id, array $params)
{
return $this->client->call("sales_invoices/{$id}/e_archive", [
'e_archive' => $params,
], 'POST');
}

/** Retrieve invoice e invoice status

/**
* Retrieve the e-invoice's document type.
*
* @param Sales invoice id
* @param int $id
* @return array
*/
public function eDocumentStatus($invoiceID){
return $this->client->call("sales_invoices/{$invoiceID}/e_document_status",[],'GET');
public function getEInvoiceType($id)
{
return $this->client->call("sales_invoices/{$id}/e_document_type", null, 'GET');
}

/** Create a e_archive invoice from sale invoice
/**
* Retrieve the invoice's document status.
*
* @param Sales invoice id
* @param int $id
* @return array
*/
public function eArchive($invoiceID,$eArchiveInformation){
return $this->client->call("sales_invoices/{$invoiceID}/e_archive",[
'e_archive'=>$eArchiveInformation
],'POST');
public function getEInvoiceStatus($id)
{
return $this->client->call("sales_invoices/{$id}/e_document_status", null, 'GET');
}


/** Create a e_invoice from sale invoice
/**
* Retrieve the e-invoice's inbox details.
*
* @param Sales invoice id
* @param string $vatId
* @return array
*/
public function eInvoice($invoiceID,$eInvoiceInformation){
return $this->client->call("sales_invoices/{$invoiceID}/e_invoice",[
'e_invoice'=>$eInvoiceInformation
],'POST');
public function getEInvoiceInboxes($taxNumber)
{
return $this->client->call("e_invoice_inboxes",[
'vkn' => $taxNumber,
], 'GET');
}
}

0 comments on commit bd722f8

Please sign in to comment.