Adds entered_by to manual payments. Closes #22.

This commit is contained in:
Christopher Neugebauer 2016-04-25 16:06:29 +10:00
parent bf053242de
commit 42912519f1
3 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-25 06:05
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('registrasion', '0025_auto_20160425_0411'),
]
operations = [
migrations.AddField(
model_name='manualpayment',
name='entered_by',
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
preserve_default=False,
),
]

View file

@ -220,6 +220,8 @@ class ManualPayment(PaymentBase):
class Meta:
app_label = "registrasion"
entered_by = models.ForeignKey(User)
class CreditNote(PaymentBase):
''' Credit notes represent money accounted for in the system that do not

View file

@ -669,6 +669,7 @@ def manual_payment(request, invoice_id):
if request.POST and form.is_valid():
form.instance.invoice = inv
form.instance.entered_by = request.user
form.save()
current_invoice.update_status()
form = forms.ManualPaymentForm(prefix=FORM_PREFIX)