Closed Mailcamp closed 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; }
You could filter on workflow_id to detect if a certain workflow is linked to the sales invoice.
thanks! :)
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; }