
FieldError at /clients/filtered/

Expression contains mixed types: DecimalField, IntegerField. You must set output_field.

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/clients/filtered/?status=active
Django Version: 	5.2.4
Exception Type: 	FieldError
Exception Value: 	

Expression contains mixed types: DecimalField, IntegerField. You must set output_field.

Exception Location: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\db\models\expressions.py, line 365, in _resolve_output_field
Raised during: 	users.views.filtered_clients
Python Executable: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\python.exe
Python Version: 	3.13.5
Python Path: 	

['C:\\Users\\phing\\Desktop\\branch-system',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\DLLs',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages']

Server time: 	Tue, 30 Sep 2025 04:13:15 +0300
Error during template rendering

In template C:\Users\phing\Desktop\branch-system\templates\users\filtered_clients.html, error at line 93
Expression contains mixed types: DecimalField, IntegerField. You must set output_field.
83 	    <div class="bg-white overflow-hidden shadow rounded-lg">
84 	        <div class="p-5">
85 	            <div class="flex items-center">
86 	                <div class="flex-shrink-0">
87 	                    <i class="fas fa-handshake text-gray-400 text-2xl"></i>
88 	                </div>
89 	                <div class="ml-5 w-0 flex-1">
90 	                    <dl>
91 	                        <dt class="text-sm font-medium text-gray-500 truncate">With Active Loans</dt>
92 	                        <dd class="text-lg font-medium text-gray-900">
93 	                            {% for client in clients %}

TemplateSyntaxError at /reports/portfolio-details/

Invalid filter: 'sub'

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/reports/portfolio-details/
Django Version: 	5.2.4
Exception Type: 	TemplateSyntaxError
Exception Value: 	

Invalid filter: 'sub'

Exception Location: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\template\base.py, line 615, in find_filter
Raised during: 	reports.views.portfolio_details
Python Executable: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\python.exe
Python Version: 	3.13.5
Python Path: 	

['C:\\Users\\phing\\Desktop\\branch-system',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\DLLs',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages']

Server time: 	Tue, 30 Sep 2025 04:14:05 +0300
Error during template rendering

In template C:\Users\phing\Desktop\branch-system\templates\reports\portfolio_details.html, error at line 144
Invalid filter: 'sub'
134 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
135 	                        KES {{ loan.principal_amount|floatformat:2|intcomma }}
136 	                    </td>
137 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
138 	                        KES {{ loan.total_amount|floatformat:2|intcomma }}
139 	                    </td>
140 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
141 	                        KES {{ loan.amount_paid|floatformat:2|intcomma }}
142 	                    </td>
143 	                    <td class="px-6 py-4 whitespace-nowrap">
144 	                        {% with outstanding=loan.total_amount|sub:loan.amount_paid %}

TemplateSyntaxError at /reports/portfolio-details/

Invalid filter: 'sub'

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/reports/portfolio-details/
Django Version: 	5.2.4
Exception Type: 	TemplateSyntaxError
Exception Value: 	

Invalid filter: 'sub'

Exception Location: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\template\base.py, line 615, in find_filter
Raised during: 	reports.views.portfolio_details
Python Executable: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\python.exe
Python Version: 	3.13.5
Python Path: 	

['C:\\Users\\phing\\Desktop\\branch-system',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\DLLs',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages']

Server time: 	Tue, 30 Sep 2025 04:14:20 +0300
Error during template rendering

In template C:\Users\phing\Desktop\branch-system\templates\reports\portfolio_details.html, error at line 144
Invalid filter: 'sub'
134 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
135 	                        KES {{ loan.principal_amount|floatformat:2|intcomma }}
136 	                    </td>
137 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
138 	                        KES {{ loan.total_amount|floatformat:2|intcomma }}
139 	                    </td>
140 	                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
141 	                        KES {{ loan.amount_paid|floatformat:2|intcomma }}
142 	                    </td>
143 	                    <td class="px-6 py-4 whitespace-nowrap">
144 	                        {% with outstanding=loan.total_amount|sub:loan.amount_paid %}

FieldError at /clients/filtered/

Expression contains mixed types: DecimalField, IntegerField. You must set output_field.

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/clients/filtered/?status=all
Django Version: 	5.2.4
Exception Type: 	FieldError
Exception Value: 	

Expression contains mixed types: DecimalField, IntegerField. You must set output_field.

Exception Location: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\db\models\expressions.py, line 365, in _resolve_output_field
Raised during: 	users.views.filtered_clients
Python Executable: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\python.exe
Python Version: 	3.13.5
Python Path: 	

['C:\\Users\\phing\\Desktop\\branch-system',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\DLLs',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages']

Server time: 	Tue, 30 Sep 2025 04:14:41 +0300
Error during template rendering

In template C:\Users\phing\Desktop\branch-system\templates\users\filtered_clients.html, error at line 93
Expression contains mixed types: DecimalField, IntegerField. You must set output_field.
83 	    <div class="bg-white overflow-hidden shadow rounded-lg">
84 	        <div class="p-5">
85 	            <div class="flex items-center">
86 	                <div class="flex-shrink-0">
87 	                    <i class="fas fa-handshake text-gray-400 text-2xl"></i>
88 	                </div>
89 	                <div class="ml-5 w-0 flex-1">
90 	                    <dl>
91 	                        <dt class="text-sm font-medium text-gray-500 truncate">With Active Loans</dt>
92 	                        <dd class="text-lg font-medium text-gray-900">
93 	                            {% for client in clients %}

TemplateSyntaxError at /reports/

default requires 2 arguments, 1 provided

Request Method: 	GET
Request URL: 	http://127.0.0.1:8000/reports/
Django Version: 	5.2.4
Exception Type: 	TemplateSyntaxError
Exception Value: 	

default requires 2 arguments, 1 provided

Exception Location: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\Lib\site-packages\django\template\base.py, line 768, in args_check
Raised during: 	reports.views.unified_dashboard
Python Executable: 	C:\Users\phing\AppData\Local\Programs\Python\Python313\python.exe
Python Version: 	3.13.5
Python Path: 	

['C:\\Users\\phing\\Desktop\\branch-system',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\python313.zip',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\DLLs',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313',
 'C:\\Users\\phing\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages']

Server time: 	Tue, 30 Sep 2025 04:15:09 +0300
Error during template rendering

In template C:\Users\phing\Desktop\branch-system\templates\reports\unified_dashboard.html, error at line 575
default requires 2 arguments, 1 provided
565 	    });
566 	
567 	    // Loan Status Distribution Chart
568 	    const statusCtx = document.getElementById('loanStatusChart').getContext('2d');
569 	    chartInstances.loanStatusChart = new Chart(statusCtx, {
570 	        type: 'doughnut',
571 	        data: {
572 	            labels: ['Active', 'Due Today', 'Overdue', 'Completed'],
573 	            datasets: [{
574 	                data: [
575 	                    {{ dashboard_data.summary_metrics.total_active_loans |default: 0 }},
