Compare commits

..

8 Commits

Author SHA1 Message Date
d662328903 Temporarily fix invoice emailing
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2024-07-06 10:37:44 +10:00
693f247865 Fix handling of discounts in invoiceSummary(), added invoiceSummaryCredit() to show invoices in credit 2024-07-06 09:00:36 +10:00
e836108cf6 Update laravel/leenooks module 2024-07-06 09:00:36 +10:00
c87d73978f User optimisation and code cleanup 2024-07-06 09:00:36 +10:00
ad03cfa677 Optimisations for resellers home page 2024-07-06 09:00:36 +10:00
8e6533fb91 Home page performance optimisations 2024-07-06 09:00:36 +10:00
9e60691a79 Code refactor work. New optimised query to get invoice status summary for an account 2024-07-06 09:00:36 +10:00
a820c1136d Update laravel framework from 9 to 11, removed some old packages 2024-07-06 09:00:36 +10:00
12 changed files with 27 additions and 101 deletions

View File

@ -281,7 +281,7 @@ class Account extends Model implements IDs
DB::raw('SUM(amount) AS payments'),
DB::raw('SUM(fees_amt) AS payment_fees'),
])
->leftjoin('payment_items',['payment_items.payment_id'=>'payments.id'])
->join('payment_items',['payment_items.payment_id'=>'payments.id'])
->where('payments.active',TRUE)
->where('payment_items.active',TRUE)
->groupBy(['payment_items.invoice_id'])
@ -299,7 +299,6 @@ class Account extends Model implements IDs
->leftjoin('invoice_item_taxes',['invoice_item_taxes.invoice_item_id'=>'invoice_items.id'])
->rightjoin('invoices',['invoices.id'=>'invoice_items.invoice_id'])
->where('invoice_items.active',TRUE)
->where('invoice_item_taxes.active',TRUE)
->where('invoices.active',TRUE)
->groupBy(['invoice_items.invoice_id']),
),'p')

View File

@ -47,7 +47,6 @@ return [
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
'verify_peer' => false,
],
'ses' => [

View File

@ -7,7 +7,7 @@
<div class="card-body">
@if(($list=$o->invoiceSummaryDue()->get())->count())
@include('theme.backend.adminlte.invoice.widget.due',['type'=>'account'])
@include('theme.backend.adminlte.invoice.widget.due')
@else
<p>No invoice due</p>

View File

@ -96,7 +96,7 @@
@if($o==$user)
@canany('reseller','wholesaler')
<div class="tab-pane" id="tab-reseller" role="tabpanel">
@include('theme.backend.adminlte.widget.admin.reseller')
@include('theme.backend.adminlte.r.home.widget.home')
</div>
@endcanany
@endif

View File

@ -1,58 +0,0 @@
<!-- Show outstanding invoices -->
<table class="table table-bordered w-100" id="invoices_credit_{{$type}}">
<thead>
<tr>
<th>Account</th>
<th>#</th>
<th>Due</th>
<th class="text-right">Items</th>
<th class="text-right">Discounts</th>
<th class="text-right">Total</th>
<th class="text-right">Payments</th>
<th class="text-right">Balance</th>
</tr>
</thead>
<tbody>
@foreach($list as $oo)
<tr>
<td>{{ $oo->account->name }}</td>
<td><a href="{{ url('u/invoice',$oo->id) }}">{{ $oo->lid }}</a></td>
<td>{{ $oo->due_at->format('Y-m-d') }}</td>
<td class="text-right">${{ number_format($oo->_item+$oo->_tax,2) }}</td>
<td class="text-right">${{ number_format($oo->_discount,2) }}</td>
<td class="text-right">${{ number_format($oo->_total,2) }}</td>
<td class="text-right">${{ number_format($oo->_payment,2) }}</td>
<td class="text-right">${{ number_format($oo->_balance,2) }}</td>
</tr>
@endforeach
</tbody>
</table>
@section('page-styles')
@css(datatables,bootstrap4|rowgroup)
@append
@section('page-scripts')
@js(datatables,bootstrap4|rowgroup)
<script type="text/javascript">
@if($list->count())
$(document).ready(function() {
$('#invoices_credit_{{$type}}').DataTable({
// If we have more than 1 account id, order by account
order: [[0,'asc'],[2,'asc'],[1,'desc']],
rowGroup: {
dataSrc: 0,
},
columnDefs: [
{
targets: [0],
visible: false,
}
],
});
});
@endif
</script>
@append

View File

@ -1,6 +1,6 @@
<!-- $list = Collection[Invoice::class] -->
<!-- $o = Account::class -->
<!-- Show outstanding invoices -->
<table class="table table-bordered w-100" id="invoices_due_{{$type}}">
<table class="table table-bordered w-100" id="invoices_due_{{ $o->id }}">
<thead>
<tr>
<th>Account</th>
@ -34,7 +34,7 @@
<script type="text/javascript">
@if ($list->count())
$(document).ready(function() {
$('#invoices_due_{{$type}}').DataTable({
$('#invoices_due_{{ $o->id }}').DataTable({
// If we have more than 1 account id, order by account
order: [[0,'asc'],[2,'asc'],[1,'desc']],
rowGroup: {

View File

@ -0,0 +1,11 @@
<div class="row">
<div class="col-4">
@include('theme.backend.adminlte.r.account.widgets.list')
</div>
<div class="col-8">
@include('theme.backend.adminlte.r.service.widget.movement')
@include('theme.backend.adminlte.r.invoice.widgets.due')
</div>
</div>

View File

@ -1,3 +1,4 @@
<!-- $o=App\Models\User -->
<!-- Show outstanding invoices for all clients -->
<div class="card card-warning">
<div class="card-header">
@ -6,7 +7,7 @@
<div class="card-body">
@if(($list=\App\Models\Account::InvoicesDue())->count())
@include('theme.backend.adminlte.invoice.widget.due',['type'=>'all'])
@include('theme.backend.adminlte.invoice.widget.due')
@else
<p>No invoice due</p>

View File

@ -1,24 +0,0 @@
<div class="row">
<div class="col-4">
@include('theme.backend.adminlte.account.widget.admin.list')
</div>
<div class="col-8">
@include('theme.backend.adminlte.service.widget.admin.movement')
@include('theme.backend.adminlte.invoice.widget.admin.due')
@can('wholesaler')
<!-- Show outstanding invoices for all clients -->
<div class="card card-secondary">
<div class="card-header">
<h3 class="card-title">Invoices In Credit</h3>
</div>
<div class="card-body">
@include('theme.backend.adminlte.invoice.widget.admin.credit',['list'=>\App\Models\Account::InvoicesCredit(),'type'=>'account'])
</div>
</div>
@endcan
</div>
</div>

View File

@ -1,10 +1,8 @@
<?php
use Illuminate\Support\Facades\Schedule;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use App\Jobs\BroadbandTraffic;
use App\Models\Supplier;
Schedule::job(new BroadbandTraffic(Supplier::find(1)))
->timezone('Australia/Melbourne')
->dailyAt('10:00');
//Artisan::command('inspire', function () {
// $this->comment(Inspiring::quote());
//})->purpose('Display an inspiring quote')->hourly();