Skip to content

Commit

Permalink
Merge pull request #17 from Fernien/reminder
Browse files Browse the repository at this point in the history
Added createReminder function
  • Loading branch information
exlo89 authored Mar 13, 2024
2 parents 90239bb + d26228c commit a6b2bc8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/de-de/invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ $items = [
$sevdeskApi->invoice()->create($customerId, $items, $parameters);
```

## Zahlungserinnerung erstellen

Um eine Zahlungserinnerung zu erstellen, verwende die Funktion `createReminder()` und übergebe die SevDesk `invoiceId`.

```php
$sevdeskApi->invoice()->createReminder($invoiceId);
```

## Rechnung herunterladen

Um eine Rechnung runterzuladen, rufe die Funktion `download()` auf mit der Rechnungs ID `$invoiceId` als Parameter.
Expand Down
9 changes: 9 additions & 0 deletions docs/invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ $items = [
$sevdeskApi->invoice()->create($customerId, $items, $parameters);
```

## Create Reminder

To create an invoice use the `createReminder()` function and pass the SevDesk `invoiceId`.

```php
$sevdeskApi->invoice()->createReminder($invoiceId);
```


## Download Invoice

To download pdf file of the giving `$invoiceId`.
Expand Down
18 changes: 18 additions & 0 deletions src/Api/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,24 @@ public function create($contactId, $items, array $parameters = []): SevInvoice
return $sevInvoice;
}

// =========================== create reminder ====================================

/**
* Create invoice reminder.
*
* @param $invoiceId
* @return array
* @throws Exception
*/
public function createReminder($invoiceId): array
{
return $this->_post(Routes::CREATE_REMINDER, [
'invoice' => [
'id' => $invoiceId,
"objectName" => "Invoice"
]
]);
}

// =======================================================================

Expand Down
1 change: 1 addition & 0 deletions src/Api/Utils/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Routes
const INVOICE = 'Invoice';
const SEV_USER = 'SevUser';
const CREATE_INVOICE = self::INVOICE . '/Factory/saveInvoice';
const CREATE_REMINDER = self::INVOICE . '/Factory/createInvoiceReminder';
const STATIC_COUNTRY = 'StaticCountry';
const SEQUENCE = 'SevSequence/Factory/getByType';
}

0 comments on commit a6b2bc8

Please sign in to comment.