Beispiel #1
0
 def register(self,
              ourParty,
              otherParty,
              debitAccount,
              creditAccount,
              customerAccount=None):
     transaction = self.transaction()
     assert transaction is not None, "document must be tracked!"
     #The persons or subjects related with te document that are not self
     #(such as client in invoice or provider in alienInvoice) must be
     #called otherParty so their value can be assigned in register
     self.setOtherParty(otherParty)
     self.customerAccount = customerAccount
     entry = AccountingEntry(customerAccount=customerAccount)
     entry.pointOfSale = ourParty
     entry.recordDate = now()
     transaction.track(entry)
     entry.debit(self.amount, debitAccount)
     entry.credit(self.amount, creditAccount)
Beispiel #2
0
 def setUp(self):
     super(TestAccountingEntry, self).setUp()
     self.trans = Transaction()
     ##customer
     self.customer = CustomerAccount(name="Juan Customer")
     
     self.acEntry = AccountingEntry( number=1, pos=PointOfSale(), customerAccount=self.customer)
     self.trans.track(self.acEntry)
     ##from
     self.debit = MovementAccount(name="Sales")
     ##to
     self.credit = MovementAccount(name="Petty Cash")
     
     self.amount = 175.5
     self.otherAmount = 180
     
     self.trans.track(self.debit)
     self.trans.track(self.credit)
     self.trans.track(self.customer)