Skip to content

Commit

Permalink
\Merge branch 'v5-develop' into v5-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed May 27, 2022
2 parents 6dc9a4c + 418c7c2 commit 373cac1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ jobs:
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
sudo find ./ -type d -exec chmod 755 {} \;
- name: Prepare React FrontEnd
run: |
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/ui.git
cd ui
git checkout main
npm i
npm run build
cp -r dist/react/* ../public/react
cd ..
rm -rf ui
- name: Prepare JS/CSS assets
run: |
npm i
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/InvoiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ public function create(CreateInvoiceRequest $request)
public function store(StoreInvoiceRequest $request)
{

// $client = Client::find($request->input('client_id'));

$invoice = $this->invoice_repo->save($request->all(), InvoiceFactory::create(auth()->user()->company()->id, auth()->user()->id));

$invoice = $invoice->service()
Expand Down
2 changes: 1 addition & 1 deletion app/Http/ValidationRules/Payment/ValidInvoicesRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function checkInvoicesAreHomogenous()
return false;
}

$inv = Invoice::whereId($invoice['invoice_id'])->first();
$inv = Invoice::withTrashed()->whereId($invoice['invoice_id'])->first();

if (! $inv) {

Expand Down
7 changes: 5 additions & 2 deletions app/Services/Invoice/HandleCancellation.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function run()

//adjust client balance
$this->invoice->client->service()->updateBalance($adjustment)->save();
$this->invoice->fresh();

$this->invoice->service()->workFlow()->save();

Expand Down Expand Up @@ -78,7 +79,8 @@ public function reverse()
$adjustment = $cancellation->adjustment * -1;

$this->invoice->ledger()->updateInvoiceBalance($adjustment, "Invoice {$this->invoice->number} reversal");

$this->invoice->fresh();

/* Reverse the invoice status and balance */
$this->invoice->balance += $adjustment;
$this->invoice->status_id = $cancellation->status_id;
Expand All @@ -90,7 +92,8 @@ public function reverse()
unset($backup->cancellation);
$this->invoice->backup = $backup;
$this->invoice->saveQuietly();

$this->invoice->fresh();

return $this->invoice;
}

Expand Down

0 comments on commit 373cac1

Please sign in to comment.