mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 21:34:30 -04:00
Small fix for edge case where invoice may appear to be paid
This commit is contained in:
parent
0a25df317e
commit
ac763b3a0a
@ -192,6 +192,8 @@ class InvoiceService
|
|||||||
|
|
||||||
public function handleCancellation()
|
public function handleCancellation()
|
||||||
{
|
{
|
||||||
|
$this->removeUnpaidGatewayFees();
|
||||||
|
|
||||||
$this->invoice = (new HandleCancellation($this->invoice))->run();
|
$this->invoice = (new HandleCancellation($this->invoice))->run();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -199,6 +201,8 @@ class InvoiceService
|
|||||||
|
|
||||||
public function markDeleted()
|
public function markDeleted()
|
||||||
{
|
{
|
||||||
|
$this->removeUnpaidGatewayFees();
|
||||||
|
|
||||||
$this->invoice = (new MarkInvoiceDeleted($this->invoice))->run();
|
$this->invoice = (new MarkInvoiceDeleted($this->invoice))->run();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -213,6 +217,8 @@ class InvoiceService
|
|||||||
|
|
||||||
public function reverseCancellation()
|
public function reverseCancellation()
|
||||||
{
|
{
|
||||||
|
$this->removeUnpaidGatewayFees();
|
||||||
|
|
||||||
$this->invoice = (new HandleCancellation($this->invoice))->reverse();
|
$this->invoice = (new HandleCancellation($this->invoice))->reverse();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -278,11 +284,14 @@ class InvoiceService
|
|||||||
|
|
||||||
public function updateStatus()
|
public function updateStatus()
|
||||||
{
|
{
|
||||||
if ((int)$this->invoice->balance == 0) {
|
if($this->invoice->status_id == Invoice::STATUS_DRAFT)
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
// if ((int)$this->invoice->balance == 0) {
|
||||||
|
|
||||||
$this->setStatus(Invoice::STATUS_PAID)->workFlow();
|
// $this->setStatus(Invoice::STATUS_PAID)->workFlow();
|
||||||
// InvoiceWorkflowSettings::dispatchNow($this->invoice);
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) {
|
if ($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount) {
|
||||||
$this->setStatus(Invoice::STATUS_PARTIAL);
|
$this->setStatus(Invoice::STATUS_PARTIAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user