1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00

\Merge branch 'v5-develop' into v5-stable

This commit is contained in:
David Bomba 2022-05-27 10:12:02 +10:00
commit 373cac16ad
4 changed files with 17 additions and 5 deletions

View File

@ -39,6 +39,17 @@ jobs:
sudo find ./vendor/bin/ -type f -exec chmod +x {} \; sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
sudo find ./ -type d -exec chmod 755 {} \; 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 - name: Prepare JS/CSS assets
run: | run: |
npm i npm i

View File

@ -220,8 +220,6 @@ class InvoiceController extends BaseController
public function store(StoreInvoiceRequest $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 = $this->invoice_repo->save($request->all(), InvoiceFactory::create(auth()->user()->company()->id, auth()->user()->id));
$invoice = $invoice->service() $invoice = $invoice->service()

View File

@ -62,7 +62,7 @@ class ValidInvoicesRules implements Rule
return false; return false;
} }
$inv = Invoice::whereId($invoice['invoice_id'])->first(); $inv = Invoice::withTrashed()->whereId($invoice['invoice_id'])->first();
if (! $inv) { if (! $inv) {

View File

@ -51,6 +51,7 @@ class HandleCancellation extends AbstractService
//adjust client balance //adjust client balance
$this->invoice->client->service()->updateBalance($adjustment)->save(); $this->invoice->client->service()->updateBalance($adjustment)->save();
$this->invoice->fresh();
$this->invoice->service()->workFlow()->save(); $this->invoice->service()->workFlow()->save();
@ -78,6 +79,7 @@ class HandleCancellation extends AbstractService
$adjustment = $cancellation->adjustment * -1; $adjustment = $cancellation->adjustment * -1;
$this->invoice->ledger()->updateInvoiceBalance($adjustment, "Invoice {$this->invoice->number} reversal"); $this->invoice->ledger()->updateInvoiceBalance($adjustment, "Invoice {$this->invoice->number} reversal");
$this->invoice->fresh();
/* Reverse the invoice status and balance */ /* Reverse the invoice status and balance */
$this->invoice->balance += $adjustment; $this->invoice->balance += $adjustment;
@ -90,6 +92,7 @@ class HandleCancellation extends AbstractService
unset($backup->cancellation); unset($backup->cancellation);
$this->invoice->backup = $backup; $this->invoice->backup = $backup;
$this->invoice->saveQuietly(); $this->invoice->saveQuietly();
$this->invoice->fresh();
return $this->invoice; return $this->invoice;
} }