mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Remove debug code and fix minor bugs
This commit is contained in:
parent
5a6bd0d0d0
commit
b5a948583e
@ -184,7 +184,14 @@ class ExpenseController extends BaseController
|
||||
|
||||
public function store(CreateExpenseRequest $request)
|
||||
{
|
||||
$expense = $this->expenseService->save($request->input());
|
||||
$data = $request->input();
|
||||
$data['documents'] = $request->file('documents');
|
||||
|
||||
if(!$this->checkUpdatePermission($data, $response)){
|
||||
return $response;
|
||||
}
|
||||
|
||||
$expense = $this->expenseService->save($data);
|
||||
|
||||
Session::flash('message', trans('texts.created_expense'));
|
||||
|
||||
|
@ -243,7 +243,6 @@ class InvoiceController extends BaseController
|
||||
$invoice = $account->createInvoice($entityType, $clientId);
|
||||
$invoice->public_id = 0;
|
||||
|
||||
$invoice->expenses = Expense::scope([2])->with('documents')->get();
|
||||
if(Session::get('expenses')){
|
||||
$invoice->expenses = Expense::scope(Session::get('expenses'))->with('documents')->get();
|
||||
}
|
||||
@ -372,6 +371,7 @@ class InvoiceController extends BaseController
|
||||
public function store(SaveInvoiceWithClientRequest $request)
|
||||
{
|
||||
$data = $request->input();
|
||||
$data['documents'] = $request->file('documents');
|
||||
|
||||
if(!$this->checkUpdatePermission($data, $response)){
|
||||
return $response;
|
||||
|
@ -153,6 +153,8 @@ class ExpenseRepository extends BaseRepository
|
||||
$expense->exchange_rate = round($rate, 4);
|
||||
$expense->amount = round(Utils::parseFloat($input['amount']), 2);
|
||||
|
||||
$expense->save();
|
||||
|
||||
// Documents
|
||||
$document_ids = !empty($input['document_ids'])?array_map('intval', $input['document_ids']):array();;
|
||||
foreach ($document_ids as $document_id){
|
||||
@ -190,8 +192,6 @@ class ExpenseRepository extends BaseRepository
|
||||
}
|
||||
}
|
||||
|
||||
$expense->save();
|
||||
|
||||
return $expense;
|
||||
}
|
||||
|
||||
|
@ -273,6 +273,7 @@
|
||||
|
||||
self.expense_currency_id = ko.observable();
|
||||
self.invoice_currency_id = ko.observable();
|
||||
self.documents = ko.observableArray();
|
||||
self.amount = ko.observable();
|
||||
self.exchange_rate = ko.observable(1);
|
||||
self.should_be_invoiced = ko.observable();
|
||||
|
Loading…
x
Reference in New Issue
Block a user