|
@@ -6,6 +6,7 @@ from django.contrib import messages
|
|
|
from django.http import HttpResponseRedirect
|
|
|
from django.conf.urls import url
|
|
|
from django.contrib.admin.utils import flatten_fieldsets
|
|
|
+from django import forms
|
|
|
|
|
|
from coin.filtering_queryset import LimitedAdminInlineMixin
|
|
|
from coin.billing.models import Invoice, InvoiceDetail, Payment, PaymentAllocation
|
|
@@ -14,11 +15,22 @@ from django.core.urlresolvers import reverse
|
|
|
import autocomplete_light
|
|
|
|
|
|
|
|
|
+class InvoiceDetailInlineForm(forms.ModelForm):
|
|
|
+ class Meta:
|
|
|
+ model = InvoiceDetail
|
|
|
+ fields = (
|
|
|
+ 'label', 'amount', 'quantity', 'tax',
|
|
|
+ 'offersubscription', 'period_from', 'period_to'
|
|
|
+ )
|
|
|
+ widgets = {'quantity': forms.NumberInput(attrs={'step': 1})}
|
|
|
+
|
|
|
+
|
|
|
class InvoiceDetailInline(LimitedAdminInlineMixin, admin.StackedInline):
|
|
|
model = InvoiceDetail
|
|
|
extra = 0
|
|
|
fields = (('label', 'amount', 'quantity', 'tax'),
|
|
|
('offersubscription', 'period_from', 'period_to'))
|
|
|
+ form = InvoiceDetailInlineForm
|
|
|
|
|
|
def get_filters(self, obj):
|
|
|
"""
|