Revised the debit_amount and credit_amount pseudo property in the Record data model in the accounting application.
This commit is contained in:
parent
fe22f64b64
commit
f3e2280041
@ -296,10 +296,10 @@ class Record(DirtyFieldsMixin, models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def debit_amount(self):
|
def debit_amount(self):
|
||||||
"""The debit amount of this accounting record"""
|
"""The debit amount of this accounting record."""
|
||||||
if self._debit_amount is not None:
|
if self._debit_amount is None:
|
||||||
|
self._debit_amount = self.amount if not self.is_credit else None
|
||||||
return self._debit_amount
|
return self._debit_amount
|
||||||
return self.amount if not self.is_credit else None
|
|
||||||
|
|
||||||
@debit_amount.setter
|
@debit_amount.setter
|
||||||
def debit_amount(self, value):
|
def debit_amount(self, value):
|
||||||
@ -307,10 +307,10 @@ class Record(DirtyFieldsMixin, models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def credit_amount(self):
|
def credit_amount(self):
|
||||||
"""The credit amount of this accounting record"""
|
"""The credit amount of this accounting record."""
|
||||||
if self._credit_amount is not None:
|
if self._credit_amount is None:
|
||||||
|
self._credit_amount = self.amount if self.is_credit else None
|
||||||
return self._credit_amount
|
return self._credit_amount
|
||||||
return self.amount if self.is_credit else None
|
|
||||||
|
|
||||||
@credit_amount.setter
|
@credit_amount.setter
|
||||||
def credit_amount(self, value):
|
def credit_amount(self, value):
|
||||||
|
Loading…
Reference in New Issue
Block a user