mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
776ba51dff
@ -1 +1 @@
|
|||||||
5.4.8
|
5.4.9
|
@ -67,7 +67,7 @@ class InvoiceFilters extends QueryFilters
|
|||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function number(string $number) :Builder
|
public function number(string $number = '') :Builder
|
||||||
{
|
{
|
||||||
return $this->builder->where('number', $number);
|
return $this->builder->where('number', $number);
|
||||||
}
|
}
|
||||||
|
@ -101,16 +101,12 @@ class InvoiceSum
|
|||||||
private function calculateCustomValues()
|
private function calculateCustomValues()
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->total_taxes += $this->valuerTax($this->invoice->custom_surcharge1, $this->invoice->custom_surcharge_tax1);
|
|
||||||
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge1);
|
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge1);
|
||||||
|
|
||||||
// $this->total_taxes += $this->valuerTax($this->invoice->custom_surcharge2, $this->invoice->custom_surcharge_tax2);
|
|
||||||
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge2);
|
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge2);
|
||||||
|
|
||||||
// $this->total_taxes += $this->valuerTax($this->invoice->custom_surcharge3, $this->invoice->custom_surcharge_tax3);
|
|
||||||
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge3);
|
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge3);
|
||||||
|
|
||||||
// $this->total_taxes += $this->valuerTax($this->invoice->custom_surcharge4, $this->invoice->custom_surcharge_tax4);
|
|
||||||
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge4);
|
$this->total_custom_values += $this->valuer($this->invoice->custom_surcharge4);
|
||||||
|
|
||||||
$this->total += $this->total_custom_values;
|
$this->total += $this->total_custom_values;
|
||||||
@ -155,7 +151,7 @@ class InvoiceSum
|
|||||||
*/
|
*/
|
||||||
private function calculateBalance()
|
private function calculateBalance()
|
||||||
{
|
{
|
||||||
//$this->invoice->balance = $this->balance($this->getTotal(), $this->invoice);
|
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -174,22 +170,6 @@ class InvoiceSum
|
|||||||
{
|
{
|
||||||
$this->total += $this->total_taxes;
|
$this->total += $this->total_taxes;
|
||||||
|
|
||||||
// if (is_numeric($this->invoice->custom_value1)) {
|
|
||||||
// $this->total += $this->invoice->custom_value1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (is_numeric($this->invoice->custom_value2)) {
|
|
||||||
// $this->total += $this->invoice->custom_value2;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (is_numeric($this->invoice->custom_value3)) {
|
|
||||||
// $this->total += $this->invoice->custom_value3;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (is_numeric($this->invoice->custom_value4)) {
|
|
||||||
// $this->total += $this->invoice->custom_value4;
|
|
||||||
// }
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,7 +601,18 @@ class CreditController extends BaseController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'email':
|
case 'email':
|
||||||
// EmailCredit::dispatch($credit, $credit->company);
|
|
||||||
|
$credit->invitations->load('contact.client.country', 'credit.client.country', 'credit.company')->each(function ($invitation) use ($credit) {
|
||||||
|
EmailEntity::dispatch($invitation, $credit->company, 'credit');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (! $bulk) {
|
||||||
|
return response()->json(['message'=>'email sent'], 200);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'send_email':
|
||||||
|
|
||||||
$credit->invitations->load('contact.client.country', 'credit.client.country', 'credit.company')->each(function ($invitation) use ($credit) {
|
$credit->invitations->load('contact.client.country', 'credit.client.country', 'credit.company')->each(function ($invitation) use ($credit) {
|
||||||
EmailEntity::dispatch($invitation, $credit->company, 'credit');
|
EmailEntity::dispatch($invitation, $credit->company, 'credit');
|
||||||
|
@ -745,13 +745,7 @@ class InvoiceController extends BaseController
|
|||||||
$this->itemResponse($invoice);
|
$this->itemResponse($invoice);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// case 'reverse':
|
|
||||||
// $invoice = $invoice->service()->handleReversal()->deletePdf()->save();
|
|
||||||
|
|
||||||
// if (! $bulk) {
|
|
||||||
// $this->itemResponse($invoice);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
case 'email':
|
case 'email':
|
||||||
//check query parameter for email_type and set the template else use calculateTemplate
|
//check query parameter for email_type and set the template else use calculateTemplate
|
||||||
|
|
||||||
@ -769,6 +763,24 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'send_email':
|
||||||
|
//check query parameter for email_type and set the template else use calculateTemplate
|
||||||
|
|
||||||
|
|
||||||
|
if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) {
|
||||||
|
$this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
|
||||||
|
} else {
|
||||||
|
$this->reminder_template = $invoice->calculateTemplate('invoice');
|
||||||
|
}
|
||||||
|
|
||||||
|
BulkInvoiceJob::dispatch($invoice, $this->reminder_template);
|
||||||
|
|
||||||
|
if (! $bulk) {
|
||||||
|
return response()->json(['message' => 'email sent'], 200);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
return response()->json(['message' => ctrans('texts.action_unavailable', ['action' => $action])], 400);
|
||||||
break;
|
break;
|
||||||
|
@ -367,6 +367,10 @@ class PurchaseOrderController extends BaseController
|
|||||||
|
|
||||||
$purchase_order = $this->purchase_order_repository->save($request->all(), $purchase_order);
|
$purchase_order = $this->purchase_order_repository->save($request->all(), $purchase_order);
|
||||||
|
|
||||||
|
$purchase_order = $purchase_order->service()
|
||||||
|
->triggeredActions($request)
|
||||||
|
->save();
|
||||||
|
|
||||||
event(new PurchaseOrderWasUpdated($purchase_order, $purchase_order->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new PurchaseOrderWasUpdated($purchase_order, $purchase_order->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
|
||||||
return $this->itemResponse($purchase_order);
|
return $this->itemResponse($purchase_order);
|
||||||
@ -644,6 +648,15 @@ class PurchaseOrderController extends BaseController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'send_email':
|
||||||
|
//check query parameter for email_type and set the template else use calculateTemplate
|
||||||
|
PurchaseOrderEmail::dispatch($purchase_order, $purchase_order->company);
|
||||||
|
|
||||||
|
if (! $bulk) {
|
||||||
|
return response()->json(['message' => 'email sent'], 200);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'add_to_inventory':
|
case 'add_to_inventory':
|
||||||
|
|
||||||
$purchase_order->service()->add_to_inventory();
|
$purchase_order->service()->add_to_inventory();
|
||||||
|
@ -722,6 +722,13 @@ class QuoteController extends BaseController
|
|||||||
|
|
||||||
return response()->json(['message'=> ctrans('texts.sent_message')], 200);
|
return response()->json(['message'=> ctrans('texts.sent_message')], 200);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'send_email':
|
||||||
|
$quote->service()->sendEmail();
|
||||||
|
|
||||||
|
return response()->json(['message'=> ctrans('texts.sent_message')], 200);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'mark_sent':
|
case 'mark_sent':
|
||||||
$quote->service()->markSent()->save();
|
$quote->service()->markSent()->save();
|
||||||
|
|
||||||
|
@ -42,9 +42,6 @@ class StoreExpenseRequest extends Request
|
|||||||
if(!empty($this->client_id))
|
if(!empty($this->client_id))
|
||||||
$rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
$rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||||
|
|
||||||
if(!empty($this->purchase_order_id))
|
|
||||||
$rules['purchase_order_id'] = 'bail|sometimes|exists:purchase_orders,id,company_id,'.auth()->user()->company()->id;
|
|
||||||
|
|
||||||
return $this->globalRules($rules);
|
return $this->globalRules($rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,10 +59,6 @@ class StoreExpenseRequest extends Request
|
|||||||
$input['currency_id'] = (string)auth()->user()->company()->settings->currency_id;
|
$input['currency_id'] = (string)auth()->user()->company()->settings->currency_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists('purchase_order_id', $input) && is_string($input['purchase_order_id'])) {
|
|
||||||
$input['purchase_order_id'] = $this->decodePrimaryKey($input['purchase_order_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(array_key_exists('color', $input) && is_null($input['color']))
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
$input['color'] = '';
|
$input['color'] = '';
|
||||||
|
|
||||||
|
@ -28,13 +28,25 @@ class PurchaseOrderExpense
|
|||||||
{
|
{
|
||||||
|
|
||||||
$expense = ExpenseFactory::create($this->purchase_order->company_id, $this->purchase_order->user_id);
|
$expense = ExpenseFactory::create($this->purchase_order->company_id, $this->purchase_order->user_id);
|
||||||
$expense->amount = $this->purchase_order->amount;
|
|
||||||
|
$expense->amount = $this->purchase_order->uses_inclusive_taxes ? $this->purchase_order->amount : ($this->purchase_order->amount - $this->purchase_order->total_taxes);
|
||||||
|
|
||||||
$expense->date = now();
|
$expense->date = now();
|
||||||
$expense->vendor_id = $this->purchase_order->vendor_id;
|
$expense->vendor_id = $this->purchase_order->vendor_id;
|
||||||
$expense->public_notes = $this->purchase_order->public_notes;
|
$expense->public_notes = $this->purchase_order->public_notes;
|
||||||
$expense->purchase_order_id = $this->purchase_order->id;
|
$expense->uses_inclusive_taxes = $this->purchase_order->uses_inclusive_taxes;
|
||||||
|
$expense->calculate_tax_by_amount = true;
|
||||||
|
|
||||||
|
$tax_map = $this->purchase_order->calc()->getTaxMap();
|
||||||
|
|
||||||
|
$expense->tax_amount1 = $this->purchase_order->total_taxes;
|
||||||
|
$expense->tax_name1 = ctrans("texts.tax");
|
||||||
|
|
||||||
$expense->save();
|
$expense->save();
|
||||||
|
|
||||||
|
$this->purchase_order->expense_id = $expense->id;
|
||||||
|
$this->purchase_order->save();
|
||||||
|
|
||||||
return $expense;
|
return $expense;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,9 @@ class PurchaseOrderService
|
|||||||
{
|
{
|
||||||
$this->markSent();
|
$this->markSent();
|
||||||
|
|
||||||
|
if($this->purchase_order->expense()->exists())
|
||||||
|
return $this;
|
||||||
|
|
||||||
$expense = (new PurchaseOrderExpense($this->purchase_order))->run();
|
$expense = (new PurchaseOrderExpense($this->purchase_order))->run();
|
||||||
|
|
||||||
return $expense;
|
return $expense;
|
||||||
|
@ -14,8 +14,8 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||||
'app_version' => '5.4.8',
|
'app_version' => '5.4.9',
|
||||||
'app_tag' => '5.4.8',
|
'app_tag' => '5.4.9',
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', ''),
|
'api_secret' => env('API_SECRET', ''),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user