mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'v5-develop' of https://github.com/turbo124/invoiceninja into v5-develop
This commit is contained in:
commit
17e787f816
@ -36,7 +36,7 @@ class ExpenseFilters extends QueryFilters
|
||||
}
|
||||
|
||||
return $this->builder->where(function ($query) use ($filter) {
|
||||
$query->where('expenses.name', 'like', '%'.$filter.'%')
|
||||
$query->where('expenses.public_notes', 'like', '%'.$filter.'%')
|
||||
->orWhere('expenses.id_number', 'like', '%'.$filter.'%')
|
||||
->orWhere('expenses.custom_value1', 'like', '%'.$filter.'%')
|
||||
->orWhere('expenses.custom_value2', 'like', '%'.$filter.'%')
|
||||
@ -94,7 +94,10 @@ class ExpenseFilters extends QueryFilters
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
||||
if(is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4']))
|
||||
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
||||
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,6 +48,7 @@ class QuotesTable extends Component
|
||||
->where('company_id', $this->company->id)
|
||||
->where('client_id', auth('contact')->user()->client->id)
|
||||
->where('status_id', '<>', Quote::STATUS_DRAFT)
|
||||
->where('is_deleted', 0)
|
||||
->withTrashed()
|
||||
->paginate($this->per_page);
|
||||
|
||||
|
@ -62,20 +62,30 @@ class BaseTransformer
|
||||
public function getClient($client_name, $client_email) {
|
||||
$clients = $this->maps['company']->clients;
|
||||
|
||||
$clients = $clients->where( 'id_number', $client_name );
|
||||
$client_id_search = $clients->where( 'id_number', $client_name );
|
||||
|
||||
if ( $clients->count() >= 1 ) {
|
||||
return $clients->first()->id;
|
||||
if ( $client_id_search->count() >= 1 ) {
|
||||
return $client_id_search->first()->id;
|
||||
nlog("found via id number");
|
||||
}
|
||||
|
||||
$client_name_search = $clients->where( 'name', $client_name );
|
||||
|
||||
if ( $client_name_search->count() >= 1 ) {
|
||||
return $client_name_search->first()->id;
|
||||
nlog("found via name");
|
||||
}
|
||||
|
||||
if ( ! empty( $client_email ) ) {
|
||||
$contacts = ClientContact::where( 'company_id', $this->maps['company']->id )
|
||||
->where( 'email', $client_email );
|
||||
|
||||
if ( $contacts->count() >= 1 ) {
|
||||
return $contacts->first()->client_id;
|
||||
nlog("found via contact");
|
||||
}
|
||||
}
|
||||
nlog("did not find client");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class AutoBill
|
||||
|
||||
nlog("autobill {$this->invoice->id}");
|
||||
|
||||
$this->invoice->service()->autoBill()->save();
|
||||
$this->invoice->service()->autoBill();
|
||||
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
|
@ -145,7 +145,7 @@ class SendRecurring implements ShouldQueue
|
||||
|
||||
if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $invoice->auto_bill_enabled) {
|
||||
nlog("attempting to autobill {$invoice->number}");
|
||||
$invoice->service()->autoBill()->save();
|
||||
$invoice->service()->autoBill();
|
||||
|
||||
}
|
||||
elseif($invoice->client->getSetting('auto_bill_date') == 'on_due_date' && $invoice->auto_bill_enabled) {
|
||||
@ -153,7 +153,7 @@ class SendRecurring implements ShouldQueue
|
||||
if($invoice->due_date && Carbon::parse($invoice->due_date)->startOfDay()->lte(now()->startOfDay())) {
|
||||
|
||||
nlog("attempting to autobill {$invoice->number}");
|
||||
$invoice->service()->autoBill()->save();
|
||||
$invoice->service()->autoBill();
|
||||
|
||||
}
|
||||
|
||||
|
@ -263,12 +263,18 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
|
||||
event('eloquent.created: App\Models\Payment', $payment);
|
||||
|
||||
if ($this->client->getSetting('client_online_payment_notification'))
|
||||
if ($this->client->getSetting('client_online_payment_notification') && in_array($status, [Payment::STATUS_COMPLETED, Payment::STATUS_PENDING
|
||||
]))
|
||||
$payment->service()->sendEmail();
|
||||
|
||||
//todo
|
||||
//catch any payment failures here also and fire a subsequent failure email if necessary? note only need for delayed payment forms
|
||||
//perhaps this type of functionality should be handled higher up to provide better context?
|
||||
|
||||
|
||||
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
|
||||
|
||||
if (property_exists($this->payment_hash->data, 'billing_context')) {
|
||||
if (property_exists($this->payment_hash->data, 'billing_context') && $status == Payment::STATUS_COMPLETED) {
|
||||
$billing_subscription = \App\Models\Subscription::find($this->payment_hash->data->billing_context->subscription_id);
|
||||
|
||||
// To access campaign hash => $this->payment_hash->data->billing_context->campaign;
|
||||
|
@ -161,7 +161,8 @@ class PayPal
|
||||
SystemLog::CATEGORY_GATEWAY_RESPONSE,
|
||||
SystemLog::EVENT_GATEWAY_FAILURE,
|
||||
SystemLog::TYPE_BRAINTREE,
|
||||
$this->braintree->client
|
||||
$this->braintree->client,
|
||||
$this->braintree->client->company
|
||||
);
|
||||
|
||||
throw new PaymentFailed($response->message, 0);
|
||||
|
@ -324,19 +324,18 @@ class MolliePaymentDriver extends BaseDriver
|
||||
/* Harvest Payment Hash*/
|
||||
$payment_hash = PaymentHash::where('hash', $payment->metadata->hash)->first();
|
||||
|
||||
|
||||
$data = [
|
||||
'gateway_type_id' => $payment->metadata->gateway_type_id,
|
||||
'amount' => $amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total,
|
||||
'payment_type' => $payment->metadata->payment_type_id,
|
||||
'transaction_reference' => $payment->id,
|
||||
];
|
||||
|
||||
|
||||
$record = $this->createPayment(
|
||||
$data,
|
||||
$codes[$payment->status]
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,17 +36,6 @@ class TriggeredActions extends AbstractService
|
||||
|
||||
public function run()
|
||||
{
|
||||
// if ($this->request->has('auto_bill') && $this->request->input('auto_bill') == 'true') {
|
||||
// $this->credit = $this->credit->service()->autoBill()->save();
|
||||
// }
|
||||
|
||||
// if ($this->request->has('paid') && $this->request->input('paid') == 'true') {
|
||||
// $this->credit = $this->credit->service()->markPaid()->save();
|
||||
// }
|
||||
|
||||
// if ($this->request->has('amount_paid') && is_numeric($this->request->input('amount_paid')) ) {
|
||||
// $this->credit = $this->credit->service()->applyPaymentAmount($this->request->input('amount_paid'))->save();
|
||||
// }
|
||||
|
||||
if ($this->request->has('send_email') && $this->request->input('send_email') == 'true') {
|
||||
$this->sendEmail();
|
||||
|
@ -130,7 +130,7 @@ class AutoBillInvoice extends AbstractService
|
||||
info("Auto Bill payment captured for ".$this->invoice->number);
|
||||
}
|
||||
|
||||
return $this->invoice->fresh();
|
||||
// return $this->invoice->fresh();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -246,7 +246,7 @@ class InvoiceService
|
||||
|
||||
public function autoBill()
|
||||
{
|
||||
$this->invoice = (new AutoBillInvoice($this->invoice, $this->invoice->company->db))->run();
|
||||
(new AutoBillInvoice($this->invoice, $this->invoice->company->db))->run();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class TriggeredActions extends AbstractService
|
||||
public function run()
|
||||
{
|
||||
if ($this->request->has('auto_bill') && $this->request->input('auto_bill') == 'true') {
|
||||
$this->invoice = $this->invoice->service()->autoBill()->save();
|
||||
$this->invoice->service()->autoBill();
|
||||
}
|
||||
|
||||
if ($this->request->has('paid') && $this->request->input('paid') == 'true') {
|
||||
|
@ -6543,6 +6543,34 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
--------------------------------------------------------------------------------
|
||||
diacritic
|
||||
|
||||
Copyright (c) 2016, Agilord.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the <organization> nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
double-conversion
|
||||
icu
|
||||
|
44
public/flutter_service_worker.js
vendored
44
public/flutter_service_worker.js
vendored
@ -3,38 +3,38 @@ const MANIFEST = 'flutter-app-manifest';
|
||||
const TEMP = 'flutter-temp-cache';
|
||||
const CACHE_NAME = 'flutter-app-cache';
|
||||
const RESOURCES = {
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"version.json": "9c7b0edc83733da56c726678aacd9fd3",
|
||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||
"manifest.json": "ef43d90e57aa7682d7e2cfba2f484a40",
|
||||
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
|
||||
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
|
||||
"main.dart.js": "cf5d5c23d2b786d951713c1167ed4304",
|
||||
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
|
||||
"favicon.ico": "51636d3a390451561744c42188ccd628",
|
||||
"main.dart.js": "4479880bad7e1f303b572d806a9c4555",
|
||||
"/": "87ed144dcf495d9b331539ceeff9c0d3",
|
||||
"assets/NOTICES": "5a96be85b952e4fcd3a6965546c85b7f",
|
||||
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "015400679694f1f51047e46da0e1dc98",
|
||||
"assets/AssetManifest.json": "38d9aea341601f3a5c6fa7b5a1216ea5",
|
||||
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
|
||||
"/": "3f4fb5e405b74e982799377abb8b98aa",
|
||||
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
|
||||
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
|
||||
"assets/AssetManifest.json": "38d9aea341601f3a5c6fa7b5a1216ea5",
|
||||
"assets/assets/images/logo_light.png": "e5f46d5a78e226e7a9553d4ca6f69219",
|
||||
"assets/assets/images/logo_dark.png": "a233ed1d4d0f7414bf97a9a10f11fb0a",
|
||||
"assets/assets/images/icon.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
|
||||
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
|
||||
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
|
||||
"assets/assets/images/payment_types/dinerscard.png": "06d85186ba858c18ab7c9caa42c92024",
|
||||
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
|
||||
"assets/assets/images/payment_types/discover.png": "6c0a386a00307f87db7bea366cca35f5",
|
||||
"assets/assets/images/payment_types/switch.png": "4fa11c45327f5fdc20205821b2cfd9cc",
|
||||
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
|
||||
"assets/assets/images/payment_types/jcb.png": "07e0942d16c5592118b72e74f2f7198c",
|
||||
"assets/assets/images/payment_types/carteblanche.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
|
||||
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
|
||||
"assets/assets/images/payment_types/ach.png": "7433f0aff779dc98a649b7a2daf777cf",
|
||||
"assets/assets/images/payment_types/mastercard.png": "6f6cdc29ee2e22e06b1ac029cb52ef71",
|
||||
"assets/assets/images/payment_types/amex.png": "c49a4247984b3732a4af50a3390aa978",
|
||||
"assets/assets/images/payment_types/switch.png": "4fa11c45327f5fdc20205821b2cfd9cc",
|
||||
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
|
||||
"assets/assets/images/payment_types/visa.png": "3ddc4a4d25c946e8ad7e6998f30fd4e3",
|
||||
"assets/assets/images/google_logo.png": "0f118259ce403274f407f5e982e681c3"
|
||||
"assets/assets/images/payment_types/discover.png": "6c0a386a00307f87db7bea366cca35f5",
|
||||
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
|
||||
"assets/assets/images/payment_types/amex.png": "c49a4247984b3732a4af50a3390aa978",
|
||||
"assets/assets/images/payment_types/mastercard.png": "6f6cdc29ee2e22e06b1ac029cb52ef71",
|
||||
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
|
||||
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
|
||||
"assets/assets/images/google_logo.png": "0f118259ce403274f407f5e982e681c3",
|
||||
"assets/assets/images/icon.png": "090f69e23311a4b6d851b3880ae52541",
|
||||
"assets/assets/images/logo_dark.png": "a233ed1d4d0f7414bf97a9a10f11fb0a",
|
||||
"assets/NOTICES": "4aea723d13add566ca34288c8295b0a4",
|
||||
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "015400679694f1f51047e46da0e1dc98"
|
||||
};
|
||||
|
||||
// The application shell files that are downloaded before a service worker can
|
||||
|
177575
public/main.dart.js
vendored
177575
public/main.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
192864
public/main.foss.dart.js
vendored
192864
public/main.foss.dart.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
172573
public/main.html.dart.js
vendored
172573
public/main.html.dart.js
vendored
File diff suppressed because one or more lines are too long
194826
public/main.next.dart.js
vendored
194826
public/main.next.dart.js
vendored
File diff suppressed because one or more lines are too long
3531
public/main.profile.dart.js
vendored
3531
public/main.profile.dart.js
vendored
File diff suppressed because one or more lines are too long
@ -121,6 +121,17 @@ class ExpenseApiTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testExpenseGetSort()
|
||||
{
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->get('/api/v1/expenses?sort=public_notes|desc');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
|
||||
public function testExpenseNotArchived()
|
||||
{
|
||||
$response = $this->withHeaders([
|
||||
|
@ -38,7 +38,7 @@ class AutoBillInvoiceTest extends TestCase
|
||||
$this->assertEquals($this->client->paid_to_date, 0);
|
||||
$this->assertEquals($this->client->credit_balance, 10);
|
||||
|
||||
$this->invoice->service()->markSent()->autoBill()->save();
|
||||
$this->invoice->service()->markSent()->autoBill();
|
||||
|
||||
$this->assertNotNull($this->invoice->payments());
|
||||
$this->assertEquals(10, $this->invoice->payments()->sum('payments.amount'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user