mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on the dashboard
This commit is contained in:
parent
ce3a510037
commit
ef81549694
@ -22,10 +22,6 @@ class DuplicateSubmissionCheck
|
||||
|
||||
$path = $request->path();
|
||||
|
||||
if (strpos($path, 'charts_and_reports') !== false) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if (in_array($request->method(), ['POST', 'PUT', 'DELETE'])) {
|
||||
$lastPage = session(SESSION_LAST_REQUEST_PAGE);
|
||||
$lastTime = session(SESSION_LAST_REQUEST_TIME);
|
||||
|
@ -111,8 +111,8 @@ class DashboardRepository
|
||||
$timeframe = 'concat(YEAR('.$entityType.'_date), '.$groupBy.'('.$entityType.'_date))';
|
||||
|
||||
$records = DB::table($entityType.'s')
|
||||
->join('clients', 'clients.id', '=', $entityType.'s.client_id')
|
||||
->where('clients.is_deleted', '=', false)
|
||||
->leftJoin('clients', 'clients.id', '=', $entityType.'s.client_id')
|
||||
->whereRaw('(clients.id IS NULL OR clients.is_deleted = 0)')
|
||||
->where($entityType.'s.account_id', '=', $accountId)
|
||||
->where($entityType.'s.is_deleted', '=', false)
|
||||
->where($entityType.'s.'.$entityType.'_date', '>=', $startDate->format('Y-m-d'))
|
||||
@ -320,13 +320,14 @@ class DashboardRepository
|
||||
->where('invoices.is_deleted', '=', false)
|
||||
->where('clients.is_deleted', '=', false)
|
||||
->where('contacts.deleted_at', '=', null)
|
||||
->where('contacts.is_primary', '=', true);
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->whereNotIn('payments.payment_status_id', [PAYMENT_STATUS_VOIDED, PAYMENT_STATUS_FAILED]);
|
||||
|
||||
if (!$viewAll){
|
||||
$payments = $payments->where('payments.user_id', '=', $userId);
|
||||
}
|
||||
|
||||
return $payments->select(['payments.payment_date', 'payments.amount', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id', 'clients.user_id as client_user_id'])
|
||||
return $payments->select(['payments.payment_date', DB::raw('(payments.amount - payments.refunded) as amount'), 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id', 'clients.user_id as client_user_id'])
|
||||
->orderBy('payments.payment_date', 'desc')
|
||||
->take(50)
|
||||
->get();
|
||||
|
@ -31,7 +31,7 @@ Want to find out everything there is to know about how to use your Invoice Ninja
|
||||
email_settings
|
||||
templates_and_reminders
|
||||
client_portal
|
||||
charts_and_reports
|
||||
reports
|
||||
data_visualizations
|
||||
api_tokens
|
||||
user_management
|
||||
|
@ -22,6 +22,7 @@
|
||||
if (window.myChart) {
|
||||
window.myChart.config.data = data;
|
||||
window.myChart.config.options.scales.xAxes[0].time.unit = chartGropuBy.toLowerCase();
|
||||
window.myChart.config.options.scales.xAxes[0].time.round = chartGropuBy.toLowerCase();
|
||||
window.myChart.update();
|
||||
} else {
|
||||
$('#progress-div').hide();
|
||||
@ -63,6 +64,7 @@
|
||||
type: 'time',
|
||||
time: {
|
||||
unit: 'day',
|
||||
round: 'day',
|
||||
},
|
||||
gridLines: {
|
||||
display: false,
|
||||
|
@ -81,8 +81,8 @@ $I->see('Invoice Design');
|
||||
$I->amOnPage('/settings/templates_and_reminders');
|
||||
$I->see('Invoice Email');
|
||||
|
||||
$I->amOnPage('/settings/charts_and_reports');
|
||||
$I->see('Data Visualizations');
|
||||
$I->amOnPage('/settings/reports');
|
||||
$I->see('Report Settings');
|
||||
|
||||
//try to logout
|
||||
//$I->click('#myAccountButton');
|
||||
|
@ -163,7 +163,7 @@ class SettingsCest
|
||||
public function runReport(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('run the report');
|
||||
$I->amOnPage('/settings/charts_and_reports');
|
||||
$I->amOnPage('/settings/reports');
|
||||
|
||||
$I->click('Run');
|
||||
$I->seeResponseCodeIs(200);
|
||||
|
Loading…
x
Reference in New Issue
Block a user