Removalls and offers revenues

This commit is contained in:
2018-06-10 17:31:05 +02:00
parent 8fe98e6ccb
commit c539d03fb6
20 changed files with 449 additions and 158 deletions
@@ -0,0 +1,46 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 10/06/2018
* Time: 15:56
*/
class RemoveInvoices {
private $invoiceID;
private $payments;
private $removeAllowed;
public function __construct( $invoiceID )
{
$this->setInvoiceID($invoiceID);
$this->handle();
}
private function setInvoiceID( $invoiceID )
{
$this->invoiceID = $invoiceID;
}
private function handle()
{
$this->setPayments();
$this->setRemoveAllowed();
}
private function setPayments()
{
$payments = Payment::whereInvoiceId($this->invoiceID);
$this->payments = $payments->count() == 0 ? TRUE : FALSE;
}
private function setRemoveAllowed()
{
$this->removeAllowed = $this->payments;
}
}