コード例 #1
0
 def testRenegotiated(self):
     branch = self.create_branch(name=u'Branch')
     client = self.create_client(name=u'TestClient')
     renegotiation = PaymentRenegotiation(branch=branch, client=client)
     rows = self.store.find(PaymentRenegotiation, branch_id=branch.id,
                            client=client,
                            status=renegotiation.STATUS_RENEGOTIATED).count()
     self.assertEquals(rows, 0)
     renegotiation.status = renegotiation.STATUS_RENEGOTIATED
     rows = self.store.find(PaymentRenegotiation, branch_id=branch.id,
                            client=client,
                            status=renegotiation.STATUS_RENEGOTIATED).count()
     self.assertEquals(rows, 1)
コード例 #2
0
 def create_payment_renegotiation(self, group=None):
     from stoqlib.domain.payment.renegotiation import PaymentRenegotiation
     return PaymentRenegotiation(responsible=get_current_user(self.store),
                                 branch=get_current_branch(self.store),
                                 group=group or self.create_payment_group(),
                                 client=self.create_client(),
                                 store=self.store)
コード例 #3
0
 def testRenegotiation(self):
     branch = self.create_branch(name=u'Branch')
     client = self.create_client(name=u'TestClient')
     rows = self.store.find(PaymentRenegotiation, branch_id=branch.id,
                            client=client).count()
     self.assertEquals(rows, 0)
     PaymentRenegotiation(branch=branch, client=client)
     rows = self.store.find(PaymentRenegotiation, branch_id=branch.id,
                            client=client).count()
     self.assertEquals(rows, 1)
コード例 #4
0
ファイル: renegotiationwizard.py プロジェクト: tmaxter/stoq
 def _create_model(self, store):
     value = 0  # will be updated in the first step.
     branch = api.get_current_branch(store)
     user = api.get_current_user(store)
     client = self.groups[0].get_parent().client
     # Set person as None to allow renegotiate payments without client.
     person = None
     if client:
         person = client.person
     group = PaymentGroup(payer=person, store=store)
     model = PaymentRenegotiation(total=value,
                                  branch=branch,
                                  responsible=user,
                                  client=client,
                                  group=group,
                                  store=store)
     return model
コード例 #5
0
 def renegotiated(self):
     if self.renegotiated_id:
         return PaymentRenegotiation.get(self.renegotiated_id,
                                         store=self.store)
コード例 #6
0
ファイル: views.py プロジェクト: romaia/stoq
 def renegotiated(self):
     if self.renegotiated_id:
         return PaymentRenegotiation.get(self.renegotiated_id,
                                         store=self.store)