picqer / moneybird-php-client

PHP Client for Moneybird V2
MIT License
82 stars 77 forks source link

pay in terms search on invoices #56

Closed Mailcamp closed 8 years ago

Mailcamp commented 8 years ago

Is there a way by fetching all salesinvoices if the late and reminded has a workflow pay in terms?

I use this function but i want to add the pay in terms.

/* * find Late and Open SalesInvoices * @return array|bool|string / public function findLateRemindedInvoices() { if ($moneybird = $this->moneybirdClient()) { try { $late_invoices = $moneybird->salesInvoice()->filter([ 'state' => 'late' ]); $reminded_invoices = $moneybird->salesInvoice()->filter([ 'state' => 'reminded' ]); return array_merge($late_invoices, $reminded_invoices); } catch (\Exception $e) { return get_class($e) . ' : ' . $e->getMessage(); } } return false; }

stephangroen commented 8 years ago

You could filter on workflow_id to detect if a certain workflow is linked to the sales invoice.

Mailcamp commented 8 years ago

thanks! :)