예제 #1
0
파일: views.py 프로젝트: ropable/ledger
    def doInvoice(self, order_number, total, **kwargs):
        method = self.checkout_session.bpay_method()
        system = self.checkout_session.system()

        icrn_format = self.checkout_session.icrn_format()
        # Generate the string to be used to generate the icrn
        crn_string = '{0}{1}'.format(systemid_check(system), order_number)
        if method == 'crn':
            return invoice_facade.create_invoice_crn(
                order_number, total.incl_tax, crn_string, system,
                self.checkout_session.get_invoice_text()
                if self.checkout_session.get_invoice_text() else '',
                self.checkout_session.payment_method()
                if self.checkout_session.payment_method() else None)
        elif method == 'icrn':
            return invoice_facade.create_invoice_icrn(
                order_number, total.incl_tax, crn_string, icrn_format, system,
                self.checkout_session.get_invoice_text()
                if self.checkout_session.get_invoice_text() else '',
                self.checkout_session.payment_method()
                if self.checkout_session.payment_method() else None)

        else:
            raise ValueError(
                '{0} is not a supported BPAY method.'.format(method))
예제 #2
0
파일: views.py 프로젝트: scottp-dpaw/ledger
 def doInvoice(self,order_number,total,**kwargs):
     method = self.checkout_session.bpay_method()
     system = self.checkout_session.system()
     icrn_format = self.checkout_session.icrn_format()
     # Generate the string to be used to generate the icrn
     crn_string = '{0}{1}'.format(systemid_check(system),order_number)
     if method == 'crn':
         return invoice_facade.create_invoice_crn(
             order_number,
             total.incl_tax,
             crn_string,
             system)
     elif method == 'icrn':
         return invoice_facade.create_invoice_icrn(
             order_number,
             total.incl_tax,
             crn_string,
             icrn_format,
             system)
     else:
         raise ValueError('{0} is not a supported BPAY method.'.format(method))