This commit is contained in:
parent
b62fa2b3b5
commit
a93ca78c8a
|
@ -2,3 +2,5 @@
|
|||
25ef1599be197445f48680306846bbfb19590502
|
||||
# misc: apply double-quote-string-fixer (#79788)
|
||||
f1941a3ad8fd726321ce19b2e0ce22a2a5911a6c
|
||||
# apply new pre-commit hooks (#85632)
|
||||
42ad175c4b191655a907ccae03c817f631a4dcbb
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
debian/barbacompta-manage /usr/bin
|
||||
debian/barbacompta.service /lib/systemd/system
|
||||
debian/config.py /etc/barbacompta
|
||||
debian/uwsgi.ini /etc/barbacompta
|
||||
debian/barbacompta.service /lib/systemd/system
|
||||
|
|
|
@ -2,28 +2,37 @@ Source: barbacompta
|
|||
Section: python
|
||||
Priority: optional
|
||||
Maintainer: Benjamin Dauvergne <bdauvergne@entrouvert.com>
|
||||
Build-Depends: python3-setuptools, python3-all, python3-django, debhelper-compat (= 12), dh-python, sassc
|
||||
Build-Depends: debhelper-compat (= 12),
|
||||
dh-python,
|
||||
python3-all,
|
||||
python3-django,
|
||||
python3-setuptools,
|
||||
sassc,
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://dev.entrouvert.org/projects/barbacompta
|
||||
|
||||
Package: python3-barbacompta
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${python3:Depends},
|
||||
python3-django (>= 2:3.2),
|
||||
python3-cairosvg,
|
||||
python3-facturx,
|
||||
python3-xstatic-select2,
|
||||
python3-gadjo,
|
||||
python3-django-mellon,
|
||||
weasyprint,
|
||||
python3-caldav,
|
||||
Depends: python3-cairosvg,
|
||||
python3-caldav,
|
||||
python3-django (>= 2:3.2),
|
||||
python3-django-mellon,
|
||||
python3-facturx,
|
||||
python3-gadjo,
|
||||
python3-xstatic-select2,
|
||||
weasyprint,
|
||||
${misc:Depends},
|
||||
${python3:Depends},
|
||||
Description: Logiciel de compta/facturation interne
|
||||
|
||||
Package: barbacompta
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends},
|
||||
python3-barbacompta (= ${binary:Version}),
|
||||
python3-psycopg2
|
||||
Depends: python3-barbacompta (= ${binary:Version}),
|
||||
python3-psycopg2,
|
||||
${misc:Depends},
|
||||
Description: Logiciel de compta/facturation interne
|
||||
Recommends: nginx, uwsgi, uwsgi-plugin-python3, python3-uwsgidecorators
|
||||
Suggests: postgresql
|
||||
Recommends: nginx,
|
||||
python3-uwsgidecorators,
|
||||
uwsgi,
|
||||
uwsgi-plugin-python3,
|
||||
Suggests: postgresql,
|
||||
|
|
|
@ -22,7 +22,7 @@ import zipfile
|
|||
from django.core.exceptions import PermissionDenied
|
||||
from django.http import HttpResponse
|
||||
from django.template import Context, Template
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
def export_as_csv(modeladmin, request, queryset):
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.chorus.validators
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
def validate_luhn(string_value, length=None):
|
||||
|
|
|
@ -70,16 +70,14 @@ class LigneBanquePopAdmin(admin.ModelAdmin):
|
|||
actions = [actions.export_as_csv]
|
||||
list_filter = (MontantAffecteFilter,)
|
||||
|
||||
@admin.display(description='Montant')
|
||||
def column_montant(self, obj):
|
||||
return amountformat(obj.montant)
|
||||
|
||||
column_montant.short_description = 'Montant'
|
||||
|
||||
@admin.display(description='Montant non affecté')
|
||||
def column_montant_non_affecte(self, obj):
|
||||
return amountformat(obj.montant_non_affecte())
|
||||
|
||||
column_montant_non_affecte.short_description = 'Montant non affecté'
|
||||
|
||||
def lookup_allowed(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge les fichiers CSVs'
|
||||
HEADER = [
|
||||
|
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge le solde courant'
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
|||
|
||||
can_import_django_settings = True
|
||||
output_transaction = True
|
||||
requires_system_checks = True
|
||||
requires_system_checks = '__all__'
|
||||
args = '<csv_file> <csv_file>...'
|
||||
help = 'Charge le solde courant'
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contenttypes', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_banque', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block object-tools %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
<ul class="object-tools">
|
||||
<li><a href="history/" class="historylink">{% trans "History" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_payment_add" %}?ligne_banque_pop={{original.id}}&montant_affecte={{original.montant_non_affecte|stringformat:"f"}}" class="historylink">Ajouter comme paiement</a></li>
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
<ul class="object-tools">
|
||||
<li><a href="history/" class="historylink">{% trans "History" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_payment_add" %}?ligne_banque_pop={{original.id}}&montant_affecte={{original.montant_non_affecte|stringformat:"f"}}" class="historylink">Ajouter comme paiement</a></li>
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
{% load eo_facture %}
|
||||
<div class="module" id="finances">
|
||||
<h2>Finance</h2>
|
||||
<p>Solde: {{ solde|amountformat }} €</p>
|
||||
<table class="table">
|
||||
<h2>Finance</h2>
|
||||
<p>Solde: {{ solde|amountformat }} €</p>
|
||||
<table class="table">
|
||||
<thead><th class="mois">Mois</th><th class="montant">Encaissements</th><th>Dépenses</th><th>Solde</th></thead>
|
||||
<tbody>
|
||||
{% for periode in finances %}
|
||||
<tr>
|
||||
<td class="mois"><a href="{{ periode.lien_date }}">{{ periode.date|date:"M Y" }}<a/></td>
|
||||
<td class="montant"><a href="{{ periode.lien_encaissement }}">{{periode.encaissement|amountformat}} €</a></td>
|
||||
<td class="montant"><a href="{{ periode.lien_depense }}">{{periode.depense|amountformat}} €</a></td>
|
||||
<td class="montant">{{periode.solde|amountformat}} €</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<tbody>
|
||||
{% for periode in finances %}
|
||||
<tr>
|
||||
<td class="mois"><a href="{{ periode.lien_date }}">{{ periode.date|date:"M Y" }}<a/></td>
|
||||
<td class="montant"><a href="{{ periode.lien_encaissement }}">{{periode.encaissement|amountformat}} €</a></td>
|
||||
<td class="montant"><a href="{{ periode.lien_depense }}">{{periode.depense|amountformat}} €</a></td>
|
||||
<td class="montant">{{periode.solde|amountformat}} €</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% load eo_facture %}
|
||||
<div id="ligne_banque_pop_total">
|
||||
<p>Crédit: {{ credit|amountformat }} €</p>
|
||||
<p>Débit: {{ debit|amountformat }} €</p>
|
||||
<p>Total: {{ total|amountformat }} €</p>
|
||||
<p>Crédit: {{ credit|amountformat }} €</p>
|
||||
<p>Débit: {{ debit|amountformat }} €</p>
|
||||
<p>Total: {{ total|amountformat }} €</p>
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,6 @@ from io import BytesIO
|
|||
|
||||
from adminsortable2.admin import SortableInlineAdminMixin
|
||||
from django import http
|
||||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.contrib.humanize.templatetags.humanize import ordinal
|
||||
|
@ -30,7 +29,7 @@ from django.db.models import Exists, OuterRef, TextField
|
|||
from django.forms import Textarea
|
||||
from django.forms.models import BaseInlineFormSet
|
||||
from django.shortcuts import render
|
||||
from django.urls import path, reverse
|
||||
from django.urls import path, re_path, reverse
|
||||
from django.utils.html import format_html
|
||||
|
||||
import eo_gestion.admin
|
||||
|
@ -210,6 +209,10 @@ class ClientAdmin(admin.ModelAdmin):
|
|||
css = {'all': ('css/client.css',)}
|
||||
|
||||
|
||||
@admin.display(
|
||||
description='Client',
|
||||
ordering='client',
|
||||
)
|
||||
def show_client(obj):
|
||||
if obj.client:
|
||||
url = reverse('admin:eo_facture_client_change', args=[obj.client.id])
|
||||
|
@ -218,10 +221,6 @@ def show_client(obj):
|
|||
return ''
|
||||
|
||||
|
||||
show_client.short_description = 'Client'
|
||||
show_client.admin_order_field = 'client'
|
||||
|
||||
|
||||
class MyContratsFilter(admin.SimpleListFilter):
|
||||
title = 'CPF'
|
||||
parameter_name = 'cpf'
|
||||
|
@ -278,11 +277,10 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
actions = [actions.export_references_as_fodt]
|
||||
autocomplete_fields = ['client']
|
||||
|
||||
@admin.display(description='Montant')
|
||||
def column_montant(self, obj):
|
||||
return amountformat(obj.montant())
|
||||
|
||||
column_montant.short_description = 'Montant'
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super().get_queryset(request)
|
||||
return qs.prefetch_related('prestations', 'factures__lignes', 'tags')
|
||||
|
@ -362,7 +360,7 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
duplicate_view = self.admin_site.admin_view(self.duplicate)
|
||||
facturer_echeance_view = self.admin_site.admin_view(self.facturer_echeance)
|
||||
my_urls = [
|
||||
url(r'^(.+)/duplicate/$', duplicate_view, name='eo_facture_contrat_duplicate'),
|
||||
re_path(r'^(.+)/duplicate/$', duplicate_view, name='eo_facture_contrat_duplicate'),
|
||||
path(
|
||||
'<path:object_id>/facturer-echeance/',
|
||||
facturer_echeance_view,
|
||||
|
@ -372,13 +370,11 @@ class ContratAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
return my_urls + urls
|
||||
|
||||
|
||||
@admin.display(description='Ordre')
|
||||
def index(facture):
|
||||
return format_html('{0}', ordinal(facture.index()))
|
||||
|
||||
|
||||
index.short_description = 'Ordre'
|
||||
|
||||
|
||||
class FactureAdmin(LookupAllowed, admin.ModelAdmin):
|
||||
form = forms.FactureForm
|
||||
inlines = [LigneInline, PaymentInline]
|
||||
|
@ -423,29 +419,25 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
actions = [actions.export_invoices_as_zip]
|
||||
autocomplete_fields = ['client']
|
||||
|
||||
@admin.display(description='Code')
|
||||
def column_code(self, obj):
|
||||
if obj.montant < 0:
|
||||
return 'Avoir %s' % obj.code()
|
||||
else:
|
||||
return obj.code()
|
||||
|
||||
column_code.short_description = 'Code'
|
||||
|
||||
@admin.display(description='Montant')
|
||||
def column_montant(self, obj):
|
||||
return amountformat(obj.montant)
|
||||
|
||||
column_montant.short_description = 'Montant'
|
||||
|
||||
@admin.display(description='Montant TTC')
|
||||
def column_montant_ttc(self, obj):
|
||||
return amountformat(obj.montant_ttc)
|
||||
|
||||
column_montant_ttc.short_description = 'Montant TTC'
|
||||
|
||||
@admin.display(description='Solde')
|
||||
def column_solde(self, obj):
|
||||
return amountformat(obj.solde())
|
||||
|
||||
column_solde.short_description = 'Solde'
|
||||
|
||||
def has_delete_permission(self, request, obj=None):
|
||||
# ne pas supprimer les factures émises
|
||||
if obj and not obj.proforma:
|
||||
|
@ -521,29 +513,31 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
def get_urls(self):
|
||||
urls = super().get_urls()
|
||||
my_urls = [
|
||||
url(r'^view/([^/]*)', views.facture),
|
||||
url(
|
||||
r'^add_simple/$',
|
||||
re_path(r'^view/([^/]*)', views.facture),
|
||||
path(
|
||||
'add_simple/',
|
||||
self.admin_site.admin_view(self.add_simple),
|
||||
name='eo_facture_facture_add_simple',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^(.+)/view_pdf/',
|
||||
self.admin_site.admin_view(views.facture_pdf),
|
||||
name='eo_facture_facture_print',
|
||||
),
|
||||
url(r'^(.+)/view/$', self.admin_site.admin_view(views.facture), name='eo_facture_facture_html'),
|
||||
url(
|
||||
re_path(
|
||||
r'^(.+)/view/$', self.admin_site.admin_view(views.facture), name='eo_facture_facture_html'
|
||||
),
|
||||
re_path(
|
||||
r'^(.+)/send-to-chorus/',
|
||||
self.admin_site.admin_view(views.send_to_chorus),
|
||||
name='eo_facture_facture_send_to_chorus',
|
||||
),
|
||||
url(
|
||||
r'^sheet/$',
|
||||
path(
|
||||
'sheet/',
|
||||
self.admin_site.admin_view(self.sheet),
|
||||
name='eo_facture_facture_sheet',
|
||||
),
|
||||
url(
|
||||
re_path(
|
||||
r'^(.+)/cancel/',
|
||||
self.admin_site.admin_view(views.cancel),
|
||||
name='eo_facture_facture_cancel',
|
||||
|
@ -551,13 +545,13 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
]
|
||||
return my_urls + urls
|
||||
|
||||
@admin.display(description='Client')
|
||||
def show_client(self, obj):
|
||||
if obj.client:
|
||||
url = reverse('admin:eo_facture_client_change', args=[obj.client.id])
|
||||
return format_html('<a href="{0}">{1}</a>', url, obj.client)
|
||||
|
||||
show_client.short_description = 'Client'
|
||||
|
||||
@admin.display(description='Contrat / Intitulé')
|
||||
def show_contrat(self, obj):
|
||||
if obj.contrat:
|
||||
url = reverse('admin:eo_facture_contrat_change', args=[obj.contrat.id])
|
||||
|
@ -567,8 +561,6 @@ class FactureAdmin(LookupAllowed, admin.ModelAdmin):
|
|||
return format_html('<a href="{0}">{1}</a>', url, obj.contrat)
|
||||
return format_html('Pas de contrat<br />{0}', obj.intitule)
|
||||
|
||||
show_contrat.short_description = 'Contrat / Intitulé'
|
||||
|
||||
# adapt get_object and get_changelist_instance to produce and accept URL
|
||||
# with facture's code
|
||||
FACTURE_RE = re.compile('^F(?P<year>20[0-9]{2})(?P<ordre>[0-9]{4})$')
|
||||
|
|
|
@ -21,7 +21,7 @@ from django import forms
|
|||
from django.core import validators
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class PercentagePerYear(list):
|
||||
|
|
|
@ -9,7 +9,6 @@ import eo_gestion.eo_facture.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_banque', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0001_initial'),
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0002_facture_account_on_previous_period'),
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0003_client_picture'),
|
||||
]
|
||||
|
|
|
@ -19,7 +19,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0004_contrat_public_description'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0005_contrat_image'),
|
||||
]
|
||||
|
|
|
@ -21,7 +21,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0006_client_contacts'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.eo_facture.validators
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0007_auto_20191009_1335'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('chorus', '__first__'),
|
||||
('eo_facture', '0008_auto_20200201_1559'),
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0009_client_chorus_structure'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0010_auto_20200316_1616'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0011_contrat_url'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.eo_facture.taggit
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('taggit', '0002_auto_20150616_2121'),
|
||||
('eo_facture', '0012_client_active'),
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0013_contrat_tags'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0014_facture_annulation'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0015_add_fields_for_periodic_invoicing'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0016_auto_20220518_1824'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0017_auto_20220518_1827'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0018_client_notes_privees'),
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0019_alter_contrat_client'),
|
||||
]
|
||||
|
|
|
@ -6,7 +6,6 @@ import eo_gestion.eo_facture.models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0021_migrate_data_to_accounting_year'),
|
||||
]
|
||||
|
|
|
@ -34,7 +34,7 @@ from django.db.models.query import QuerySet
|
|||
from django.db.models.signals import post_delete, post_save
|
||||
from django.template.loader import get_template
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from weasyprint import HTML
|
||||
|
||||
from eo_gestion.utils import percentage_str
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
{% load admin_urls i18n %}
|
||||
|
||||
{% block object-tools %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<ul class="object-tools"><li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_changelist" %}?client__id__exact={{ original.id }}">Contrats</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist" %}?client__id__exact={{ original.id }}">Factures</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_add" %}?client={{ original.id }}">Ajouter une facture simple</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_add" %}?tva={{ original.tva|stringformat:".2f" }}&client={{ original.id }}">Ajouter un contrat</a></li>
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<ul class="object-tools"><li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_changelist" %}?client__id__exact={{ original.id }}">Contrats</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist" %}?client__id__exact={{ original.id }}">Factures</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_add" %}?client={{ original.id }}">Ajouter une facture simple</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_add" %}?tva={{ original.tva|stringformat:".2f" }}&client={{ original.id }}">Ajouter un contrat</a></li>
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,41 +2,41 @@
|
|||
{% load admin_urls i18n %}
|
||||
|
||||
{% block object-tools %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<ul class="object-tools"><li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
{% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
|
||||
{% if not original.periodicite %}
|
||||
<li><a href="{% url "admin:eo_facture_contrat_duplicate" original.id %}">Dupliquer</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist" %}?contrat={{ original.id }}">Factures</a></li>
|
||||
{% if original.has_echeance_to_bill %}
|
||||
<li><a href="javascript:document.getElementById('facturer_echeance_form').submit();">Facturer</a></li>
|
||||
<form id="facturer_echeance_form" method="post" action="{% url "admin:eo_facture_contrat_facturer_echeance" original.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="echeance" value="{{ original.next_echeance_to_bill }}"/>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if not original.periodicite %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_add" %}?contrat={{ original.id }}&client={{ original.client.id }}&taux_tva={{ original.tva }}">Ajouter une facture</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_add_simple" %}?contrat={{ original.id }}">Ajouter une facture comme pourcentage du total</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<ul class="object-tools"><li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
{% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
|
||||
{% if not original.periodicite %}
|
||||
<li><a href="{% url "admin:eo_facture_contrat_duplicate" original.id %}">Dupliquer</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist" %}?contrat={{ original.id }}">Factures</a></li>
|
||||
{% if original.has_echeance_to_bill %}
|
||||
<li><a href="javascript:document.getElementById('facturer_echeance_form').submit();">Facturer</a></li>
|
||||
<form id="facturer_echeance_form" method="post" action="{% url "admin:eo_facture_contrat_facturer_echeance" original.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="echeance" value="{{ original.next_echeance_to_bill }}"/>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if not original.periodicite %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_add" %}?contrat={{ original.id }}&client={{ original.client.id }}&taux_tva={{ original.tva }}">Ajouter une facture</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_facture_add_simple" %}?contrat={{ original.id }}">Ajouter une facture comme pourcentage du total</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block after_field_sets %}
|
||||
{% if original.periodicite and original.periodicite_debut %}
|
||||
<fieldset class="module">
|
||||
<h2>Échéances</h2>
|
||||
<div>
|
||||
{% if original.periodicite and original.periodicite_debut %}
|
||||
<fieldset class="module">
|
||||
<h2>Échéances</h2>
|
||||
<div>
|
||||
<ul>
|
||||
{% for echeance in original.periodicite_echeances %}
|
||||
<li>du {{ echeance.1 }} au {{ echeance.2 }}</li>
|
||||
{% endfor %}
|
||||
{% for echeance in original.periodicite_echeances %}
|
||||
<li>du {{ echeance.1 }} au {{ echeance.2 }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
{% load i18n admin_modify static %}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
{% url "admin:jsi18n" as jsi18nurl %}
|
||||
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
|
||||
{{ media }}
|
||||
{% url "admin:jsi18n" as jsi18nurl %}
|
||||
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
|
||||
{{ media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/contrat_duplicate.css" %}" />
|
||||
{{ block.super }}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/contrat_duplicate.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
|
||||
|
@ -17,30 +17,30 @@
|
|||
{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}{% if not is_popup %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="../../../">{% trans "Home" %}</a> ›
|
||||
<a href="../../">{{ app_label|capfirst|escape }}</a> ›
|
||||
{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} ›
|
||||
<a href="../">{{ contrat }}</a> ›
|
||||
{% trans "Duplication" %}
|
||||
</div>
|
||||
<div class="breadcrumbs">
|
||||
<a href="../../../">{% trans "Home" %}</a> ›
|
||||
<a href="../../">{{ app_label|capfirst|escape }}</a> ›
|
||||
{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} ›
|
||||
<a href="../">{{ contrat }}</a> ›
|
||||
{% trans "Duplication" %}
|
||||
</div>
|
||||
{% endif %}{% endblock %}
|
||||
|
||||
{% block content %}<div id="content-main">
|
||||
<form method="post">{% csrf_token %}
|
||||
<div>
|
||||
{% if errors %}
|
||||
<p class="errornote">
|
||||
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
|
||||
</p>
|
||||
{{ adminform.form.non_field_errors }}
|
||||
{% endif %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<input type="submit"/>
|
||||
<form method="post">{% csrf_token %}
|
||||
<div>
|
||||
{% if errors %}
|
||||
<p class="errornote">
|
||||
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
|
||||
</p>
|
||||
{{ adminform.form.non_field_errors }}
|
||||
{% endif %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<input type="submit"/>
|
||||
|
||||
|
||||
</div>
|
||||
</form></div>
|
||||
</div>
|
||||
</form></div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
{% load static %}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
{% url "admin:jsi18n" as jsi18nurl %}
|
||||
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
|
||||
{{ media }}
|
||||
{% url "admin:jsi18n" as jsi18nurl %}
|
||||
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
|
||||
{{ media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/" %}css/forms.css" />{% endblock %}
|
||||
|
@ -15,31 +15,31 @@
|
|||
{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}{% if not is_popup %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="../../../">{% trans "Home" %}</a> ›
|
||||
<a href="../../">{{ app_label|capfirst|escape }}</a> ›
|
||||
{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} ›
|
||||
Rapid' facture
|
||||
</div>
|
||||
<div class="breadcrumbs">
|
||||
<a href="../../../">{% trans "Home" %}</a> ›
|
||||
<a href="../../">{{ app_label|capfirst|escape }}</a> ›
|
||||
{% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} ›
|
||||
Rapid' facture
|
||||
</div>
|
||||
{% endif %}{% endblock %}
|
||||
|
||||
{% block content %}<div id="content-main">
|
||||
<form method="post">{% csrf_token %}
|
||||
<div>
|
||||
{% if errors %}
|
||||
<p class="errornote">
|
||||
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
|
||||
</p>
|
||||
{{ adminform.form.non_field_errors }}
|
||||
{% endif %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<input type="submit"/>
|
||||
<form method="post">{% csrf_token %}
|
||||
<div>
|
||||
{% if errors %}
|
||||
<p class="errornote">
|
||||
{% blocktrans count errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
|
||||
</p>
|
||||
{{ adminform.form.non_field_errors }}
|
||||
{% endif %}
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
<input type="submit"/>
|
||||
|
||||
|
||||
</div>
|
||||
</form></div>
|
||||
</div>
|
||||
</form></div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -2,45 +2,45 @@
|
|||
{% load admin_urls i18n %}
|
||||
|
||||
{% block extrahead %}{{ block.super }}
|
||||
{% if add and not original.client %}
|
||||
{% if not original.contrat or original.contrat.client %}
|
||||
<script type="text/javascript">
|
||||
window.addEventListener("load", function(){
|
||||
let client_selector = document.getElementById("id_client");
|
||||
let client_selector_start_value = client_selector.value;
|
||||
client_selector.onchange = function() {
|
||||
if (client_selector.value && client_selector.value != client_selector_start_value) {
|
||||
let new_url = window.location.origin + "{% url "admin:eo_facture_facture_add" %}?client=" + client_selector.value;
|
||||
if (new_url != window.location) {
|
||||
window.location = new_url;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if add and not original.client %}
|
||||
{% if not original.contrat or original.contrat.client %}
|
||||
<script type="text/javascript">
|
||||
window.addEventListener("load", function(){
|
||||
let client_selector = document.getElementById("id_client");
|
||||
let client_selector_start_value = client_selector.value;
|
||||
client_selector.onchange = function() {
|
||||
if (client_selector.value && client_selector.value != client_selector_start_value) {
|
||||
let new_url = window.location.origin + "{% url "admin:eo_facture_facture_add" %}?client=" + client_selector.value;
|
||||
if (new_url != window.location) {
|
||||
window.location = new_url;
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block object-tools %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
<ul class="object-tools">
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
{% if original.client %}
|
||||
<li><a href="{% url "admin:eo_facture_client_change" original.client.id %}" class="historylink">Client</a></li>
|
||||
{% endif %}
|
||||
{% if original.contrat %}
|
||||
<li><a href="{% url "admin:eo_facture_contrat_change" original.contrat.id %}" class="historylink">Contrat</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{history_url}}../view_pdf/{{ original.filename }}">Imprimer</a></li>
|
||||
{% if original.client.chorus_structure and not original.proforma %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_send_to_chorus" original.id %}">Envoyer à Chorus</a></li>
|
||||
{% endif %}
|
||||
{% if not original.annulation and original.factures_avoir.count == 0 %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_cancel" original.id %}">Annuler</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% if change %}{% if not is_popup %}
|
||||
<ul class="object-tools">
|
||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||
<li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
|
||||
{% if original.client %}
|
||||
<li><a href="{% url "admin:eo_facture_client_change" original.client.id %}" class="historylink">Client</a></li>
|
||||
{% endif %}
|
||||
{% if original.contrat %}
|
||||
<li><a href="{% url "admin:eo_facture_contrat_change" original.contrat.id %}" class="historylink">Contrat</a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{history_url}}../view_pdf/{{ original.filename }}">Imprimer</a></li>
|
||||
{% if original.client.chorus_structure and not original.proforma %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_send_to_chorus" original.id %}">Envoyer à Chorus</a></li>
|
||||
{% endif %}
|
||||
{% if not original.annulation and original.factures_avoir.count == 0 %}
|
||||
<li><a href="{% url "admin:eo_facture_facture_cancel" original.id %}">Annuler</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li><a href="add_simple/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
|
||||
Rapid' facture
|
||||
Rapid' facture
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="sheet/" class="addlink">Export ODS</a></li>
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
{% load eo_facture %}
|
||||
{% if a_facturer %}
|
||||
<div class="module" id="a-facturer">
|
||||
<h2>Reste à facturer</h2>
|
||||
<p>Liste des contrats qu'on a pas facturés depuis un bon moment et pour lesquels il reste un solde à facturer.</p>
|
||||
<p>Montant total: {{ montant|amountformat }} € HT</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th class="contrat">Contrat</th>
|
||||
<th class="pourcentage">Pourcentage facturé</th>
|
||||
<th class="montant">Reste HT</th>
|
||||
<th class="derniere-facture">Depuis</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in a_facturer %}
|
||||
<tr>
|
||||
<td class="contrat">
|
||||
<a href="{% url "admin:eo_facture_contrat_change" l.contrat.id %}">
|
||||
{{ l.contrat.intitule }}
|
||||
<a/>
|
||||
</td>
|
||||
<td class="pourcentage">{{ l.pourcentage|floatformat:2 }} %</td>
|
||||
<td class="montant">{{ l.montant|amountformat }} €</td>
|
||||
<td class="derniere-facture">{{ l.depuis }} jours</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<div class="module" id="a-facturer">
|
||||
<h2>Reste à facturer</h2>
|
||||
<p>Liste des contrats qu'on a pas facturés depuis un bon moment et pour lesquels il reste un solde à facturer.</p>
|
||||
<p>Montant total: {{ montant|amountformat }} € HT</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th class="contrat">Contrat</th>
|
||||
<th class="pourcentage">Pourcentage facturé</th>
|
||||
<th class="montant">Reste HT</th>
|
||||
<th class="derniere-facture">Depuis</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in a_facturer %}
|
||||
<tr>
|
||||
<td class="contrat">
|
||||
<a href="{% url "admin:eo_facture_contrat_change" l.contrat.id %}">
|
||||
{{ l.contrat.intitule }}
|
||||
<a/>
|
||||
</td>
|
||||
<td class="pourcentage">{{ l.pourcentage|floatformat:2 }} %</td>
|
||||
<td class="montant">{{ l.montant|amountformat }} €</td>
|
||||
<td class="derniere-facture">{{ l.depuis }} jours</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
{% load eo_facture %}
|
||||
{% if echeances %}
|
||||
<div class="module" id="echeances">
|
||||
<h2>Contrats récurrents à facturer</h2>
|
||||
<div class="module" id="echeances">
|
||||
<h2>Contrats récurrents à facturer</h2>
|
||||
|
||||
<table id="echeance" class="table">
|
||||
<colgroup>
|
||||
<col class="debut"/>
|
||||
<col class="client"/>
|
||||
<col class="contrat"/>
|
||||
<col class="occurence"/>
|
||||
<col class="periodicite"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<table id="echeance" class="table">
|
||||
<colgroup>
|
||||
<col class="debut"/>
|
||||
<col class="client"/>
|
||||
<col class="contrat"/>
|
||||
<col class="occurence"/>
|
||||
<col class="periodicite"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<th class="debut">Date anniversaire</th>
|
||||
<th class="client">Client</th>
|
||||
<th class="contrat">Contrat</th>
|
||||
<th class="occurence">Échéance</th>
|
||||
<th class="periodicite">Périodicité</th>
|
||||
<th class="facturer"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for echeance in echeances %}
|
||||
<tr>
|
||||
<td class="debut">{{ echeance.debut|date:"d/m/Y" }} - {{ echeance.fin|date:"d/m/Y" }}</td>
|
||||
<td class="client"><a href="{% url "admin:eo_facture_client_change" echeance.contrat.client.id %}">{{ echeance.contrat.client }}</a></td>
|
||||
<td class="contrat">
|
||||
<a href="{% url "admin:eo_facture_contrat_change" echeance.contrat.id %}">
|
||||
{{ echeance.contrat.intitule }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="occurence">{{ echeance.occurrence }} / {{ echeance.contrat.periodicite_nombre_d_echeances }}</td>
|
||||
<td class="periodicite">{{ echeance.contrat.get_periodicite_display }}</td>
|
||||
<td class="facturer">
|
||||
<form method="post" action="{% url "admin:eo_facture_contrat_facturer_echeance" echeance.contrat.id %}">
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for echeance in echeances %}
|
||||
<tr>
|
||||
<td class="debut">{{ echeance.debut|date:"d/m/Y" }} - {{ echeance.fin|date:"d/m/Y" }}</td>
|
||||
<td class="client"><a href="{% url "admin:eo_facture_client_change" echeance.contrat.client.id %}">{{ echeance.contrat.client }}</a></td>
|
||||
<td class="contrat">
|
||||
<a href="{% url "admin:eo_facture_contrat_change" echeance.contrat.id %}">
|
||||
{{ echeance.contrat.intitule }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="occurence">{{ echeance.occurrence }} / {{ echeance.contrat.periodicite_nombre_d_echeances }}</td>
|
||||
<td class="periodicite">{{ echeance.contrat.get_periodicite_display }}</td>
|
||||
<td class="facturer">
|
||||
<form method="post" action="{% url "admin:eo_facture_contrat_facturer_echeance" echeance.contrat.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="echeance" value="{{ echeance.occurrence }}"/>
|
||||
<input type="submit" value="Facturer" style="padding: 2px 3px"/>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
{% load eo_facture %}
|
||||
{% if factures %}
|
||||
<div class="module" id="impayees">
|
||||
<h2>Impayées</h2>
|
||||
<p>Montant total: {{ montant|amountformat }} € TTC ({{montant_ht|amountformat}} € HT) </p>
|
||||
<table id="impayee">
|
||||
<thead>
|
||||
<th>Quoi?</th>
|
||||
<th>Depuis...</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in factures %}
|
||||
{% with l.facture as facture %}
|
||||
<tr class="facture{% if l.encaissements %} encaissement{% endif %}{% if l.vieille %} vieille{% endif %}"><td>
|
||||
<div class="facture"><a href="{% url "admin:eo_facture_facture_change" facture.pk_or_code %}">{{ facture.code }} - {{facture.intitule}}<a/> pour {{ facture.solde|amountformat }} {{ facture.contrat.client.monnaie }} TTC à <a href="{% url "admin:eo_facture_client_change" facture.client.id %}">{{facture.client}}</a></div>
|
||||
</td>
|
||||
<td>{{facture.emission|ago}}</td>
|
||||
</tr>
|
||||
{% if l.encaissements %}
|
||||
{% for encaissement in l.encaissements %}
|
||||
<tr class="encaissements">
|
||||
<td border="0">
|
||||
<a href="{% url "admin:eo_banque_lignebanquepop_change" encaissement.id%}">{{ encaissement.libelle }} - {{ encaissement.reference }} - payé le {{ encaissement.date_valeur }}</a> de {{ encaissement.montant|amountformat }} €</td>
|
||||
<td>
|
||||
<a href="{% url "admin:eo_facture_payment_add" %}?facture={{ facture.id }}&ligne_banque_pop={{ encaissement.id }}&montant_affecte={{ encaissement.montant|stringformat:".2f" }}">Accepter</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="module" id="impayees">
|
||||
<h2>Impayées</h2>
|
||||
<p>Montant total: {{ montant|amountformat }} € TTC ({{montant_ht|amountformat}} € HT) </p>
|
||||
<table id="impayee">
|
||||
<thead>
|
||||
<th>Quoi?</th>
|
||||
<th>Depuis...</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for l in factures %}
|
||||
{% with l.facture as facture %}
|
||||
<tr class="facture{% if l.encaissements %} encaissement{% endif %}{% if l.vieille %} vieille{% endif %}"><td>
|
||||
<div class="facture"><a href="{% url "admin:eo_facture_facture_change" facture.pk_or_code %}">{{ facture.code }} - {{facture.intitule}}<a/> pour {{ facture.solde|amountformat }} {{ facture.contrat.client.monnaie }} TTC à <a href="{% url "admin:eo_facture_client_change" facture.client.id %}">{{facture.client}}</a></div>
|
||||
</td>
|
||||
<td>{{facture.emission|ago}}</td>
|
||||
</tr>
|
||||
{% if l.encaissements %}
|
||||
{% for encaissement in l.encaissements %}
|
||||
<tr class="encaissements">
|
||||
<td border="0">
|
||||
<a href="{% url "admin:eo_banque_lignebanquepop_change" encaissement.id%}">{{ encaissement.libelle }} - {{ encaissement.reference }} - payé le {{ encaissement.date_valeur }}</a> de {{ encaissement.montant|amountformat }} €</td>
|
||||
<td>
|
||||
<a href="{% url "admin:eo_facture_payment_add" %}?facture={{ facture.id }}&ligne_banque_pop={{ encaissement.id }}&montant_affecte={{ encaissement.montant|stringformat:".2f" }}">Accepter</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
{% load eo_facture %}
|
||||
<div class="module" id="income">
|
||||
<table id="income-table" class="table">
|
||||
<table id="income-table" class="table">
|
||||
<caption>Chiffre d'affaire par an</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Année</th>
|
||||
{% for i in income_by_year %}
|
||||
<th>{{ i.year }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Encaissé</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.paid|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Facturé</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.invoiced|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contracté</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.contracted|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sous-traité</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.sous_traite|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.total|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Année</th>
|
||||
{% for i in income_by_year %}
|
||||
<th>{{ i.year }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Encaissé</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.paid|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Facturé</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.invoiced|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Contracté</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.contracted|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sous-traité</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.sous_traite|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total</td>
|
||||
{% for i in income_by_year %}
|
||||
<td>{{ i.total|amountformat }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
{% load eo_facture %}
|
||||
<div class="module" id="module-table-{{name}}">
|
||||
<table id="table-{{name}}" class="table">
|
||||
<table id="table-{{name}}" class="table">
|
||||
<caption>{{title}}</caption>
|
||||
<!-- headers -->
|
||||
<thead>
|
||||
{% for header, header_title in headers %}
|
||||
{% for header, header_title in headers %}
|
||||
<th class="header-{{header}}">{{header_title}}</th>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in table %}
|
||||
{% for row in table %}
|
||||
<tr>
|
||||
{% if row.0.href %}
|
||||
<td><a href="{{ row.0.href }}">{{ row.0 }}</a></td>
|
||||
{% else %}
|
||||
<td>{{ row.0 }}</td>
|
||||
{% endif %}
|
||||
<td class="number-cell">{{ row.1|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.2|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.3|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.4|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.5|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.6|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.7|floatformat:2 }}</td>
|
||||
{% if row.0.href %}
|
||||
<td><a href="{{ row.0.href }}">{{ row.0 }}</a></td>
|
||||
{% else %}
|
||||
<td>{{ row.0 }}</td>
|
||||
{% endif %}
|
||||
<td class="number-cell">{{ row.1|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.2|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.3|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.4|amountformat }}</td>
|
||||
<td class="number-cell">{{ row.5|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.6|floatformat:2 }} %</td>
|
||||
<td class="number-cell">{{ row.7|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</thead>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,81 +1,81 @@
|
|||
{% load eo_facture %}
|
||||
<html>
|
||||
<head>
|
||||
{% if base_uri %}<base href="{{base_uri}}">{% endif %}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Facture {{facture.code}} - {{facture.intitule}}</title>
|
||||
<meta name="author" content="Entr'ouvert">
|
||||
<link href="/static/css/facture.css" media="print" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="date"><table><tr id="code">{% if facture.proforma %}<td class="col1">Devis</td><td class="col2">n°{{ facture.id }}</td>{% else %}
|
||||
<td class="col1">Facture</td><td class="col2">{{facture.code}}</td>{% endif %}</tr>
|
||||
{% if facture.annulation %}
|
||||
<tr id="code">
|
||||
<td class="col1">Annule</td>
|
||||
<td class="col2">{% if facture.annulation.proforma %}devis n°{{facture.annulation.id}}{% else %}{{ facture.annulation.code }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr><td class="col1">Date</td><td class="col2">{{ facture.emission|date:'d/m/Y' }}</td></tr>
|
||||
<tr><td class="col1">{% if facture.proforma %}Valable jusqu'au{% else %}Échéance{% endif %}</td><td class="col2">{{ facture.echeance|date:'d/m/Y' }}</td></tr></table></div>
|
||||
<head>
|
||||
{% if base_uri %}<base href="{{base_uri}}">{% endif %}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Facture {{facture.code}} - {{facture.intitule}}</title>
|
||||
<meta name="author" content="Entr'ouvert">
|
||||
<link href="/static/css/facture.css" media="print" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="date"><table><tr id="code">{% if facture.proforma %}<td class="col1">Devis</td><td class="col2">n°{{ facture.id }}</td>{% else %}
|
||||
<td class="col1">Facture</td><td class="col2">{{facture.code}}</td>{% endif %}</tr>
|
||||
{% if facture.annulation %}
|
||||
<tr id="code">
|
||||
<td class="col1">Annule</td>
|
||||
<td class="col2">{% if facture.annulation.proforma %}devis n°{{facture.annulation.id}}{% else %}{{ facture.annulation.code }}{% endif %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr><td class="col1">Date</td><td class="col2">{{ facture.emission|date:'d/m/Y' }}</td></tr>
|
||||
<tr><td class="col1">{% if facture.proforma %}Valable jusqu'au{% else %}Échéance{% endif %}</td><td class="col2">{{ facture.echeance|date:'d/m/Y' }}</td></tr></table></div>
|
||||
|
||||
<div id="from"><img id="logo-eo" src="/static/img/logo.png" width="160"/><div id="info">
|
||||
Société Coopérative et Participative
|
||||
SARL au capital variable de 15200 €
|
||||
169 rue du château
|
||||
75014 PARIS
|
||||
FRANCE
|
||||
<div id="from"><img id="logo-eo" src="/static/img/logo.png" width="160"/><div id="info">
|
||||
Société Coopérative et Participative
|
||||
SARL au capital variable de 15200 €
|
||||
169 rue du château
|
||||
75014 PARIS
|
||||
FRANCE
|
||||
|
||||
Tél : 01 43 35 01 35
|
||||
Email : gerant@entrouvert.com
|
||||
Web : https://www.entrouvert.com
|
||||
RCS : Paris
|
||||
NAF/APE : 6201Z
|
||||
SIRET : 443 170 139 00036
|
||||
Numéro TVA : FR 08443170139</div></div>
|
||||
<div id="to"><strong>{{ facture.client.nom }}</strong></br>
|
||||
{{ facture.client.adresse|linebreaksbr }}
|
||||
</div>
|
||||
Tél : 01 43 35 01 35
|
||||
Email : gerant@entrouvert.com
|
||||
Web : https://www.entrouvert.com
|
||||
RCS : Paris
|
||||
NAF/APE : 6201Z
|
||||
SIRET : 443 170 139 00036
|
||||
Numéro TVA : FR 08443170139</div></div>
|
||||
<div id="to"><strong>{{ facture.client.nom }}</strong></br>
|
||||
{{ facture.client.adresse|linebreaksbr }}
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<div id="intitule"><h1>{{ facture.intitule }}</h1></div>
|
||||
<div id="notes"><p style="white-space: pre-line">{{ facture.notes }}</p></div>
|
||||
<table id="lignes">
|
||||
<thead><tr><td class="description">Description</td><td class="number">Quantité</td><td class="number" id="unitaire">Prix unitaire</td><td class="number">Prix HT</td></tr></thead>
|
||||
<tbody>
|
||||
{% for ligne in facture.lignes.all %}
|
||||
<tr>
|
||||
<td class="description">{{ ligne.intitule }}</td>
|
||||
<td class="number">{{ ligne.quantite|floatformat:2 }}</td>
|
||||
<td class="number">{{ ligne.prix_unitaire_ht|amountformat }}</td>
|
||||
<td class="number">{{ ligne.montant|amountformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan="3" class="total">Sous-total :</td><td class="number">{{ facture.montant|amountformat }}</td></tr>
|
||||
<tr><td colspan="3" class="total">Total TVA (à {{facture.taux_tva|floatformat:2 }} %) :</td><td class="number">{{ facture.tva|amountformat }}</td></tr>
|
||||
<tr><td colspan="3" class="total">Total TTC :</td><td class="number">{{ facture.montant_ttc|amountformat }}</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<p>Paiement total de {{ facture.montant_ttc|amountformat }} {{ facture.contrat.client.monnaie }} à verser au nom d'Entr'ouvert.</p>
|
||||
<p>Mode de paiement : virement</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="rib">Domiciliation bancaire : BP RIVES MAINE
|
||||
BIC : CCBPFRPPMTG
|
||||
IBAN : FR76 1020 7000 9104 0910 0252 059
|
||||
Code étab. : 10207 Code guichet : 00091 Numéro de compte : 04091002520 Clé RIB : 59</div>
|
||||
<div id="le">Entr'ouvert est membre du
|
||||
<img src="/static/img/logo-le-black.png" width="70"/>
|
||||
</div>
|
||||
<div id="echeance">Passée la date d'échéance ci-dessus, une pénalité de retard
|
||||
sera calculée au taux de 1,5 % par mois conformément à nos conditions
|
||||
générales de vente, voir
|
||||
<a href="https://www.entrouvert.com/fr/conditions-generales-de-vente/">https://www.entrouvert.com/fr/conditions-generales-de-vente/</a></div>
|
||||
<div id="main">
|
||||
<div id="intitule"><h1>{{ facture.intitule }}</h1></div>
|
||||
<div id="notes"><p style="white-space: pre-line">{{ facture.notes }}</p></div>
|
||||
<table id="lignes">
|
||||
<thead><tr><td class="description">Description</td><td class="number">Quantité</td><td class="number" id="unitaire">Prix unitaire</td><td class="number">Prix HT</td></tr></thead>
|
||||
<tbody>
|
||||
{% for ligne in facture.lignes.all %}
|
||||
<tr>
|
||||
<td class="description">{{ ligne.intitule }}</td>
|
||||
<td class="number">{{ ligne.quantite|floatformat:2 }}</td>
|
||||
<td class="number">{{ ligne.prix_unitaire_ht|amountformat }}</td>
|
||||
<td class="number">{{ ligne.montant|amountformat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan="3" class="total">Sous-total :</td><td class="number">{{ facture.montant|amountformat }}</td></tr>
|
||||
<tr><td colspan="3" class="total">Total TVA (à {{facture.taux_tva|floatformat:2 }} %) :</td><td class="number">{{ facture.tva|amountformat }}</td></tr>
|
||||
<tr><td colspan="3" class="total">Total TTC :</td><td class="number">{{ facture.montant_ttc|amountformat }}</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<p>Paiement total de {{ facture.montant_ttc|amountformat }} {{ facture.contrat.client.monnaie }} à verser au nom d'Entr'ouvert.</p>
|
||||
<p>Mode de paiement : virement</p>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="rib">Domiciliation bancaire : BP RIVES MAINE
|
||||
BIC : CCBPFRPPMTG
|
||||
IBAN : FR76 1020 7000 9104 0910 0252 059
|
||||
Code étab. : 10207 Code guichet : 00091 Numéro de compte : 04091002520 Clé RIB : 59</div>
|
||||
<div id="le">Entr'ouvert est membre du
|
||||
<img src="/static/img/logo-le-black.png" width="70"/>
|
||||
</div>
|
||||
<div id="echeance">Passée la date d'échéance ci-dessus, une pénalité de retard
|
||||
sera calculée au taux de 1,5 % par mois conformément à nos conditions
|
||||
générales de vente, voir
|
||||
<a href="https://www.entrouvert.com/fr/conditions-generales-de-vente/">https://www.entrouvert.com/fr/conditions-generales-de-vente/</a></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% load gadjo %}{% include "django/forms/widgets/select.html" %}
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
$('#{{ widget.attrs.id }}').select2({tags: true});
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
$('#{{ widget.attrs.id }}').select2({tags: true});
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -180,7 +180,6 @@ def income_by_clients(user=None, year=None):
|
|||
for contrat in contrats.select_related('client').prefetch_related(
|
||||
'factures', 'factures__lignes', 'prestations'
|
||||
):
|
||||
|
||||
# how much as already been invoiced before previsions
|
||||
adjust = 0
|
||||
invoiced = 0
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
def validate_luhn(string_value, length=None):
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
|
|
|
@ -6,7 +6,6 @@ from django.db import migrations, models
|
|||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('eo_facture', '0019_alter_contrat_client'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
|
|
|
@ -19,7 +19,7 @@ import xml.etree.ElementTree as ET
|
|||
import zipfile
|
||||
from datetime import date, datetime
|
||||
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
NS = {
|
||||
'fo': 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0',
|
||||
|
@ -188,7 +188,7 @@ class WorkCell:
|
|||
value = ''
|
||||
self.worksheet = worksheet
|
||||
self.native_value = value
|
||||
value = force_text(value)
|
||||
value = force_str(value)
|
||||
for i in range(0x20): # remove control characters
|
||||
char = chr(i)
|
||||
if char in ('\t', '\r', '\n'):
|
||||
|
|
|
@ -29,7 +29,7 @@ ALLOWED_HOSTS = ['*']
|
|||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'barbacompta',
|
||||
'USER': '', # Not used with sqlite3.
|
||||
'PASSWORD': '', # Not used with sqlite3.
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
{% block content %}
|
||||
|
||||
<h2>{% trans "Error: page not found" %}</h2>
|
||||
<h2>{% trans "Error: page not found" %}</h2>
|
||||
|
||||
<p>{% trans "The page you requested has not been found on this server." %}
|
||||
<p>{% trans "The page you requested has not been found on this server." %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
{% block content %}
|
||||
|
||||
<h2>{% trans "Server Error" %}</h2>
|
||||
<h2>{% trans "Server Error" %}</h2>
|
||||
|
||||
<p>{% trans "We're sorry but a server error has occurred." %}
|
||||
<p>{% trans "We're sorry but a server error has occurred." %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,28 +4,28 @@
|
|||
{% block title %}{{ title }} | {% trans "Entr'ouvert Gestion" %}{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
<h1 id="site-name">{% trans "Entr'ouvert Gestion" %}</h1>
|
||||
<h1 id="site-name">{% trans "Entr'ouvert Gestion" %}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<meta charset="utf-8"><!-- ☭ -->
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/admin_gestion.css" %}"/>
|
||||
{{ block.super }}
|
||||
<meta charset="utf-8"><!-- ☭ -->
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/admin_gestion.css" %}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_title %}<h1>Gestion de la facturation et des finances</h1>{% endblock %}
|
||||
|
||||
{% block nav-global %}
|
||||
<ul class="menu">
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist"%}?emission__year={% now "Y" %}">Factures {% now "Y" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_client_changelist" %}">Clients</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_client_add" %}">Ajouter un client</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_changelist" %}">Contrats</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_add" %}">Ajouter un contrat</a></li>
|
||||
<li><a href="{% url "admin:eo_banque_lignebanquepop_changelist" %}">Compte en banque</a></li>
|
||||
</ul>
|
||||
<ul class="menu">
|
||||
<li><a href="{% url "admin:eo_facture_facture_changelist"%}?emission__year={% now "Y" %}">Factures {% now "Y" %}</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_client_changelist" %}">Clients</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_client_add" %}">Ajouter un client</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_changelist" %}">Contrats</a></li>
|
||||
<li><a href="{% url "admin:eo_facture_contrat_add" %}">Ajouter un contrat</a></li>
|
||||
<li><a href="{% url "admin:eo_banque_lignebanquepop_changelist" %}">Compte en banque</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block userlinks %}
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
{% load i18n %}
|
||||
{% load eo_banque %}
|
||||
{% block date_hierarchy %}
|
||||
{{ block.super }}
|
||||
{% eo_banque_date_hierarchy cl %}
|
||||
{{ block.super }}
|
||||
{% eo_banque_date_hierarchy cl %}
|
||||
{% endblock %}
|
||||
{% block pagination %}
|
||||
{% total %}
|
||||
{{ block.super }}
|
||||
{% total %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
{% block object-tools %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -5,25 +5,25 @@
|
|||
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
{% echeances %}
|
||||
<div id="content-main">
|
||||
{% echeances %}
|
||||
|
||||
{% if 'cpf' in request.GET %}
|
||||
<a href="?">Afficher tout le monde</a><br />
|
||||
{% if request.GET.cpf == 'True' %}
|
||||
{% if 'cpf' in request.GET %}
|
||||
<a href="?">Afficher tout le monde</a><br />
|
||||
{% if request.GET.cpf == 'True' %}
|
||||
{% income_by_clients user %}
|
||||
{% else %}
|
||||
{% else %}
|
||||
{% income_by_clients %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="?cpf=True">N'afficher que mes clients</a><br />
|
||||
{% income_by_clients %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<a href="?cpf=True">N'afficher que mes clients</a><br />
|
||||
{% income_by_clients %}
|
||||
{% endif %}
|
||||
{% impayees %}
|
||||
{% a_facturer %}
|
||||
{% finances 8 %}
|
||||
</div>
|
||||
{% impayees %}
|
||||
{% a_facturer %}
|
||||
{% finances 8 %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block sidebar_module %}
|
||||
{% income %}
|
||||
{% income %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -11,72 +11,72 @@
|
|||
{% block breadcrumbs %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
<div id="content-main">
|
||||
|
||||
{% if app_list %}
|
||||
{% for app in app_list %}
|
||||
{% if app_list %}
|
||||
{% for app in app_list %}
|
||||
<div class="module">
|
||||
<table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
|
||||
<caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
|
||||
{% for model in app.models %}
|
||||
<tr>
|
||||
{% if model.perms.change %}
|
||||
<th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
|
||||
{% else %}
|
||||
<th scope="row">{{ model.name }}</th>
|
||||
{% endif %}
|
||||
<table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
|
||||
<caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
|
||||
{% for model in app.models %}
|
||||
<tr>
|
||||
{% if model.perms.change %}
|
||||
<th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
|
||||
{% else %}
|
||||
<th scope="row">{{ model.name }}</th>
|
||||
{% endif %}
|
||||
|
||||
{% if model.perms.add %}
|
||||
<td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td>
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
{% if model.perms.add %}
|
||||
<td><a href="{{ model.admin_url }}add/" class="addlink">{% trans 'Add' %}</a></td>
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
|
||||
{% if model.perms.change %}
|
||||
<td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% if model.perms.change %}
|
||||
<td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>{% trans "You don't have permission to edit anything." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>{% trans "You don't have permission to edit anything." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
<div id="content-related">
|
||||
<div id="content-related">
|
||||
{% block sidebar_module %}{% endblock %}
|
||||
<div class="module" id="recent-actions-module">
|
||||
<h2>{% trans 'Recent Actions' %}</h2>
|
||||
<h3>{% trans 'My Actions' %}</h3>
|
||||
{% load log %}
|
||||
{% get_admin_log 10 as admin_log for_user user %}
|
||||
{% if not admin_log %}
|
||||
<p>{% trans 'None available' %}</p>
|
||||
{% else %}
|
||||
<ul class="actionlist">
|
||||
{% for entry in admin_log %}
|
||||
<h2>{% trans 'Recent Actions' %}</h2>
|
||||
<h3>{% trans 'My Actions' %}</h3>
|
||||
{% load log %}
|
||||
{% get_admin_log 10 as admin_log for_user user %}
|
||||
{% if not admin_log %}
|
||||
<p>{% trans 'None available' %}</p>
|
||||
{% else %}
|
||||
<ul class="actionlist">
|
||||
{% for entry in admin_log %}
|
||||
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
|
||||
{% if entry.is_deletion %}
|
||||
{{ entry.object_repr }}
|
||||
{% else %}
|
||||
<a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
|
||||
{% endif %}
|
||||
<br/>
|
||||
{% if entry.content_type %}
|
||||
<span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
|
||||
{% else %}
|
||||
<span class="mini quiet">{% trans 'Unknown content' %}</span>
|
||||
{% endif %}
|
||||
{% if entry.is_deletion %}
|
||||
{{ entry.object_repr }}
|
||||
{% else %}
|
||||
<a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
|
||||
{% endif %}
|
||||
<br/>
|
||||
{% if entry.content_type %}
|
||||
<span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
|
||||
{% else %}
|
||||
<span class="mini quiet">{% trans 'Unknown content' %}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
import django.contrib.admin
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path, re_path
|
||||
from django.views.generic.base import RedirectView
|
||||
|
||||
from . import admin
|
||||
|
@ -26,12 +26,12 @@ from .eo_facture.views import api_references
|
|||
django.contrib.admin.autodiscover()
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^favicon.ico', RedirectView.as_view(), {'url': '/static/img/favicon.ico'}),
|
||||
url(r'^api/references/$', api_references),
|
||||
url(r'^', admin.site.urls),
|
||||
re_path(r'^favicon.ico', RedirectView.as_view(), {'url': '/static/img/favicon.ico'}),
|
||||
path('api/references/', api_references),
|
||||
re_path(r'^', admin.site.urls),
|
||||
]
|
||||
|
||||
if 'mellon' in settings.INSTALLED_APPS:
|
||||
urlpatterns = [
|
||||
url(r'^accounts/mellon/', include('mellon.urls')),
|
||||
path('accounts/mellon/', include('mellon.urls')),
|
||||
] + urlpatterns
|
||||
|
|
|
@ -253,31 +253,26 @@ class SortableAdminMixin(SortableAdminBase):
|
|||
setattr(obj, self.default_order_field, self.get_max_order(request, obj) + 1)
|
||||
super().save_model(request, obj, form, change)
|
||||
|
||||
@admin.action(description=_('Move selected to specific page'))
|
||||
def move_to_exact_page(self, request, queryset):
|
||||
self._bulk_move(request, queryset, self.EXACT)
|
||||
|
||||
move_to_exact_page.short_description = _('Move selected to specific page')
|
||||
|
||||
@admin.action(description=_('Move selected ... pages back'))
|
||||
def move_to_back_page(self, request, queryset):
|
||||
self._bulk_move(request, queryset, self.BACK)
|
||||
|
||||
move_to_back_page.short_description = _('Move selected ... pages back')
|
||||
|
||||
@admin.action(description=_('Move selected ... pages forward'))
|
||||
def move_to_forward_page(self, request, queryset):
|
||||
self._bulk_move(request, queryset, self.FORWARD)
|
||||
|
||||
move_to_forward_page.short_description = _('Move selected ... pages forward')
|
||||
|
||||
@admin.action(description=_('Move selected to first page'))
|
||||
def move_to_first_page(self, request, queryset):
|
||||
self._bulk_move(request, queryset, self.FIRST)
|
||||
|
||||
move_to_first_page.short_description = _('Move selected to first page')
|
||||
|
||||
@admin.action(description=_('Move selected to last page'))
|
||||
def move_to_last_page(self, request, queryset):
|
||||
self._bulk_move(request, queryset, self.LAST)
|
||||
|
||||
move_to_last_page.short_description = _('Move selected to last page')
|
||||
|
||||
def _move_item(self, request, startorder, endorder):
|
||||
extra_model_filters = self.get_extra_model_filters(request)
|
||||
return self.move_item(startorder, endorder, extra_model_filters)
|
||||
|
@ -312,7 +307,6 @@ class SortableAdminMixin(SortableAdminBase):
|
|||
try:
|
||||
obj = model.objects.get(**obj_filters)
|
||||
except model.MultipleObjectsReturned:
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
raise model.MultipleObjectsReturned(
|
||||
"Detected non-unique values in field '{rank_field}' used for sorting this model.\n"
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "admin/change_list.html" %}
|
||||
|
||||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
<script type="application/json" id="admin_sortable2_config">
|
||||
{
|
||||
"default_order_direction": "{{ default_order_direction }}",
|
||||
"update_url": "{{ sortable_update_url }}",
|
||||
"current_page": {{ cl.page_num | add:'1' }},
|
||||
"total_pages": {{ cl.paginator.num_pages }}
|
||||
}
|
||||
</script>
|
||||
{{ block.super }}
|
||||
<script type="application/json" id="admin_sortable2_config">
|
||||
{
|
||||
"default_order_direction": "{{ default_order_direction }}",
|
||||
"update_url": "{{ sortable_update_url }}",
|
||||
"current_page": {{ cl.page_num | add:'1' }},
|
||||
"total_pages": {{ cl.paginator.num_pages }}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<fieldset class="module aligned {{ fieldset.classes }}">
|
||||
{% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
|
||||
{% if fieldset.description %}
|
||||
<div class="description">{{ fieldset.description|safe }}</div>
|
||||
{% endif %}
|
||||
{% for line in fieldset %}
|
||||
{% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
|
||||
{% if fieldset.description %}
|
||||
<div class="description">{{ fieldset.description|safe }}</div>
|
||||
{% endif %}
|
||||
{% for line in fieldset %}
|
||||
{# Its an ugly hack to hide hidden input fields using style "display: none;", but unless https://code.djangoproject.com/ticket/11277 is solved, it currently the only possible workaround #}
|
||||
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if field.field.is_hidden %} is_hidden{% endif %}{% endfor %}">
|
||||
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
|
||||
{% for field in line %}
|
||||
{% if field.field.is_hidden %}{{ field.field }}{% else %}
|
||||
<div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>
|
||||
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
|
||||
{% if field.is_checkbox %}
|
||||
{{ field.field }}{{ field.label_tag }}
|
||||
{% else %}
|
||||
{{ field.label_tag }}
|
||||
{% if field.is_readonly %}
|
||||
<p>{{ field.contents|linebreaksbr }}</p>
|
||||
{% else %}
|
||||
{{ field.field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if field.field.is_hidden %} is_hidden{% endif %}{% endfor %}">
|
||||
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
|
||||
{% for field in line %}
|
||||
{% if field.field.is_hidden %}{{ field.field }}{% else %}
|
||||
<div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>
|
||||
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
|
||||
{% if field.is_checkbox %}
|
||||
{{ field.field }}{{ field.label_tag }}
|
||||
{% else %}
|
||||
{{ field.label_tag }}
|
||||
{% if field.is_readonly %}
|
||||
<p>{{ field.contents|linebreaksbr }}</p>
|
||||
{% else %}
|
||||
{{ field.field }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if field.field.help_text %}
|
||||
<p class="help">{{ field.field.help_text|safe }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
{% load i18n admin_urls static %}
|
||||
<div class="inline-group sortable" id="{{ inline_admin_formset.formset.prefix }}-group">
|
||||
<fieldset class="module {{ inline_admin_formset.classes }}">
|
||||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
|
||||
{{ inline_admin_formset.formset.management_form }}
|
||||
{{ inline_admin_formset.formset.non_form_errors }}
|
||||
<fieldset class="module {{ inline_admin_formset.classes }}">
|
||||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
|
||||
{{ inline_admin_formset.formset.management_form }}
|
||||
{{ inline_admin_formset.formset.non_form_errors }}
|
||||
|
||||
{% for inline_admin_form in inline_admin_formset %}<div class="inline-related{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
||||
<h3><b>{{ inline_admin_formset.opts.verbose_name|capfirst }}:</b> <span class="inline_label">{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>{% endif %}
|
||||
{% else %}#{{ forloop.counter }}{% endif %}</span>
|
||||
{% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
|
||||
{% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
|
||||
</h3>
|
||||
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% include "adminsortable2/includes/fieldset.html" %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||
{{ inline_admin_form.fk_field.field }}
|
||||
</div>{% endfor %}
|
||||
</fieldset>
|
||||
{% for inline_admin_form in inline_admin_formset %}<div class="inline-related{% if inline_admin_form.original or inline_admin_form.show_url %} has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form last-related{% endif %}" id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
||||
<h3><b>{{ inline_admin_formset.opts.verbose_name|capfirst }}:</b> <span class="inline_label">{% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} <a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>{% endif %}
|
||||
{% else %}#{{ forloop.counter }}{% endif %}</span>
|
||||
{% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
|
||||
{% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
|
||||
</h3>
|
||||
{% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% include "adminsortable2/includes/fieldset.html" %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||
{{ inline_admin_form.fk_field.field }}
|
||||
</div>{% endfor %}
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<script type="application/json" class="inline-stacked-config">
|
||||
{
|
||||
"prefix": "{{ inline_admin_formset.formset.prefix|escapejs }}",
|
||||
"deleteText": "{% filter escapejs %}{% trans "Remove" %}{% endfilter %}",
|
||||
"addText": "{% filter escapejs %}{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}{% endfilter %}"
|
||||
}
|
||||
{
|
||||
"prefix": "{{ inline_admin_formset.formset.prefix|escapejs }}",
|
||||
"deleteText": "{% filter escapejs %}{% trans "Remove" %}{% endfilter %}",
|
||||
"addText": "{% filter escapejs %}{% blocktrans with verbose_name=inline_admin_formset.opts.verbose_name|capfirst %}Add another {{ verbose_name }}{% endblocktrans %}{% endfilter %}"
|
||||
}
|
||||
</script>
|
||||
<div class="default_order_field" default_order_field="{{ inline_admin_formset.formset.default_order_field }}" default_order_direction="{{ inline_admin_formset.formset.default_order_direction }}"></div>
|
||||
|
|
|
@ -1,82 +1,82 @@
|
|||
{% load i18n admin_urls static admin_modify %}
|
||||
<div class="inline-group sortable" id="{{ inline_admin_formset.formset.prefix }}-group">
|
||||
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
|
||||
{{ inline_admin_formset.formset.management_form }}
|
||||
<fieldset class="module {{ inline_admin_formset.classes }}">
|
||||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
|
||||
{{ inline_admin_formset.formset.non_form_errors }}
|
||||
<table>
|
||||
<thead><tr><th>{% trans "Sort" %}</th>
|
||||
{% for field in inline_admin_formset.fields %}
|
||||
{% if not field.widget.is_hidden %}
|
||||
<th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
|
||||
{% if field.help_text %} <img src="{% static "admin/img/icon-unknown.svg" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
|
||||
</tr></thead>
|
||||
{{ inline_admin_formset.formset.management_form }}
|
||||
<fieldset class="module {{ inline_admin_formset.classes }}">
|
||||
<h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
|
||||
{{ inline_admin_formset.formset.non_form_errors }}
|
||||
<table>
|
||||
<thead><tr><th>{% trans "Sort" %}</th>
|
||||
{% for field in inline_admin_formset.fields %}
|
||||
{% if not field.widget.is_hidden %}
|
||||
<th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
|
||||
{% if field.help_text %} <img src="{% static "admin/img/icon-unknown.svg" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
|
||||
</tr></thead>
|
||||
|
||||
<tbody>
|
||||
{% for inline_admin_form in inline_admin_formset %}
|
||||
{% if inline_admin_form.form.non_field_errors %}
|
||||
<tr><td colspan="{{ inline_admin_form|cell_count|add:1 }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
|
||||
{% endif %}
|
||||
<tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}"
|
||||
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
||||
<td class="drag"> </td>
|
||||
<td class="original">
|
||||
{% if inline_admin_form.original or inline_admin_form.show_url %}<p>
|
||||
{% if inline_admin_form.original %}
|
||||
{{ inline_admin_form.original }}
|
||||
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>{% endif %}
|
||||
{% endif %}
|
||||
{% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
|
||||
</p>{% endif %}
|
||||
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||
{{ inline_admin_form.fk_field.field }}
|
||||
{% spaceless %}
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% for line in fieldset %}
|
||||
{% for field in line %}
|
||||
{% if field.field.is_hidden %} {{ field.field }} {% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endspaceless %}
|
||||
</td>
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% for line in fieldset %}
|
||||
{% for field in line %}
|
||||
{% if not field.field.is_hidden %}
|
||||
<td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}>
|
||||
{% if field.is_readonly %}
|
||||
<p>{{ field.contents }}</p>
|
||||
{% else %}
|
||||
{{ field.field.errors.as_ul }}
|
||||
{{ field.field }}
|
||||
{% endif %}
|
||||
<tbody>
|
||||
{% for inline_admin_form in inline_admin_formset %}
|
||||
{% if inline_admin_form.form.non_field_errors %}
|
||||
<tr><td colspan="{{ inline_admin_form|cell_count|add:1 }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
|
||||
{% endif %}
|
||||
<tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last and inline_admin_formset.has_add_permission %} empty-form{% endif %}"
|
||||
id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
|
||||
<td class="drag"> </td>
|
||||
<td class="original">
|
||||
{% if inline_admin_form.original or inline_admin_form.show_url %}<p>
|
||||
{% if inline_admin_form.original %}
|
||||
{{ inline_admin_form.original }}
|
||||
{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="inlinechangelink">{% trans "Change" %}</a>{% endif %}
|
||||
{% endif %}
|
||||
{% if inline_admin_form.show_url %}<a href="{{ inline_admin_form.absolute_url }}">{% trans "View on site" %}</a>{% endif %}
|
||||
</p>{% endif %}
|
||||
{% if inline_admin_form.needs_explicit_pk_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
|
||||
{{ inline_admin_form.fk_field.field }}
|
||||
{% spaceless %}
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% for line in fieldset %}
|
||||
{% for field in line %}
|
||||
{% if field.field.is_hidden %} {{ field.field }} {% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endspaceless %}
|
||||
</td>
|
||||
{% for fieldset in inline_admin_form %}
|
||||
{% for line in fieldset %}
|
||||
{% for field in line %}
|
||||
{% if not field.field.is_hidden %}
|
||||
<td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}>
|
||||
{% if field.is_readonly %}
|
||||
<p>{{ field.contents }}</p>
|
||||
{% else %}
|
||||
{{ field.field.errors.as_ul }}
|
||||
{{ field.field }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_formset.formset.can_delete %}
|
||||
<td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% if inline_admin_formset.formset.can_delete %}
|
||||
<td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="application/json" class="inline-tabular-config">
|
||||
{
|
||||
"prefix": "{{ inline_admin_formset.formset.prefix|escapejs }}",
|
||||
"addText": "{% filter escapejs %}{% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}{% endfilter %}",
|
||||
"deleteText": "{% filter escapejs %}{% trans 'Remove' %}{% endfilter %}"
|
||||
}
|
||||
{
|
||||
"prefix": "{{ inline_admin_formset.formset.prefix|escapejs }}",
|
||||
"addText": "{% filter escapejs %}{% blocktrans with inline_admin_formset.opts.verbose_name|capfirst as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}{% endfilter %}",
|
||||
"deleteText": "{% filter escapejs %}{% trans 'Remove' %}{% endfilter %}"
|
||||
}
|
||||
</script>
|
||||
<div class="default_order_field" default_order_field="{{ inline_admin_formset.formset.default_order_field }}" default_order_direction="{{ inline_admin_formset.formset.default_order_direction }}"></div>
|
||||
|
|
|
@ -20,7 +20,7 @@ ALLOWED_HOSTS = ['localhost']
|
|||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'barbacompta',
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue