Esempio n. 1
0
    def __init__(self, book=None, invoice=None, date=None, instance=None):
        """Invoice Entry constructor
        
        You must provide a book or be initizing this with an existing
        swig proxy object via the instance keyword argument.

        The optional invoice argument can be set to a Bill or Invoice
        that you would like to associate the entry with. You might as well
        assign one now, as an Entry can't exist without one, but you can
        always use Invoice.AddEntry or Bill.AddEntry later on.

        By default, the entry will be set to today's date unless you
        override with the date argument.
        """
        if instance == None:
            if book == None:
                raise Exception(
                    "you must call Entry.__init__  with either a "
                    "book or an existing "
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self, book)

            if date == None:
                date = datetime.date.today()
            self.SetDate(date)
            if invoice != None:
                invoice.AddEntry(self)
        else:

            GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 2
0
    def __init__(self, account=None, percent=True, amount=None, instance=None):
        """TaxTableEntry constructor
        
        You must provide an account, or be initizing this with an existing
        swig proxy object via the instance keyword argument.
        
        You may also optionally set the percent keyword argument to False to get
        a fixed value instead of percentage based tax (which is the default, or
        when percent=True).
        
        The tax will be zero percent or zero unless you set the amount keyword
        argument to a GncNumeric value as well.
        """

        if instance == None:
            if account == None:
                raise Exception(
                    "you must call TaxTableEntry.__init__  with either a "
                    "account or an existing "
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self)
            self.SetAccount(account)
            if percent:
                self.SetType(GNC_AMT_TYPE_PERCENT)
            else:
                self.SetType(GNC_AMT_TYPE_VALUE)
            if amount != None:
                self.SetAmount(amount)
        else:
            GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 3
0
    def __init__(self,
                 book=None,
                 id=None,
                 currency=None,
                 owner=None,
                 date_opened=None,
                 instance=None):
        """Invoice Contstructor

        You must provide a book, id, currency and owner
        (Customer, Job, Employee, Vendor) or an existing swig proxy object
        in the keyword argument instance.

        Optionally, you may provide a date the invoice is opened on
        (datetime.date or datetime.datetime), otherwise today's date is used.
        """
        if instance == None:
            if book == None or id == None or currency == None or owner == None:
                raise Exception(
                    "you must call Invoice.__init__ "
                    "with either a book, id, currency and owner, or an existing"
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self, book)
            self.BeginEdit()
            self.SetID(id)
            self.SetCurrency(currency)
            self.SetOwner(owner)
            if date_opened == None:
                date_opened = datetime.date.today()
            self.SetDateOpened(date_opened)
            self.CommitEdit()
        else:
            GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 4
0
    def __init__(self, book=None, invoice=None, date=None, instance=None):
        """Invoice Entry constructor
        
        You must provide a book or be initizing this with an existing
        swig proxy object via the instance keyword argument.

        The optional invoice argument can be set to a Bill or Invoice
        that you would like to associate the entry with. You might as well
        assign one now, as an Entry can't exist without one, but you can
        always use Invoice.AddEntry or Bill.AddEntry later on.

        By default, the entry will be set to today's date unless you
        override with the date argument.
        """
        if instance == None:
            if book==None:
                raise Exception(
                    "you must call Entry.__init__  with either a "
                    "book or an existing "
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self, book)

            if date == None:
                date = datetime.date.today()
            self.SetDate(date)
            if invoice != None:
                invoice.AddEntry(self)
        else:
            GnuCashCoreClass.__init__(self, instance=instance)    
Esempio n. 5
0
    def __init__(self, book=None, id=None, currency=None, owner=None,
                 date_opened=None, instance=None):
        """Invoice Contstructor

        You must provide a book, id, currency and owner
        (Customer, Job, Employee, Vendor) or an existing swig proxy object
        in the keyword argument instance.

        Optionally, you may provide a date the invoice is opened on
        (datetime.date or datetime.datetime), otherwise today's date is used.
        """
        if instance == None:
            if book==None or id==None or currency==None or owner==None:
                raise Exception(
                    "you must call Invoice.__init__ "
                    "with either a book, id, currency and owner, or an existing"
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self, book)
            self.SetID(id)
            self.SetCurrency(currency)
            self.SetOwner(owner)
            if date_opened == None:
                date_opened = datetime.date.today()
            self.SetDateOpened(date_opened)
        else:
            GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 6
0
    def __init__(self, account=None, percent=True, amount=None, instance=None):
        """TaxTableEntry constructor
        
        You must provide an account, or be initizing this with an existing
        swig proxy object via the instance keyword argument.
        
        You may also optionally set the percent keyword argument to False to get
        a fixed value instead of percentage based tax (which is the default, or
        when percent=True).
        
        The tax will be zero percent or zero unless you set the amount keyword
        argument to a GncNumeric value as well.
        """

        if instance == None:
            if account==None:
                raise Exception(
                    "you must call TaxTableEntry.__init__  with either a "
                    "account or an existing "
                    "low level swig proxy in the argument instance")
            GnuCashCoreClass.__init__(self)
            self.SetAccount(account)
            if percent:
                self.SetType(GNC_AMT_TYPE_PERCENT)
            else:
                self.SetType(GNC_AMT_TYPE_VALUE)
            if amount != None:
                self.SetAmount(amount)
        else:
            GnuCashCoreClass.__init__(self, instance=instance)        
Esempio n. 7
0
 def __init__(self, book=None, name=None, first_entry=None, instance=None):
     if instance == None:
         if book == None or name == None or first_entry == None:
             raise Exception(
                 "you must call TaxTable.__init__  with either a "
                 "book, name, and first_entry, or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetName(name)
         self.AddEntry(first_entry)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 8
0
 def __init__(self, book=None, name=None, first_entry=None, instance=None):
     if instance == None:
         if book==None or name==None or first_entry==None:
             raise Exception(
                 "you must call TaxTable.__init__  with either a "
                 "book, name, and first_entry, or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetName(name)
         self.AddEntry(first_entry)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 9
0
 def __init__(self, book=None, id=None, owner=None, name=None,
              instance=None):
     if instance == None:
         if book==None or id==None or owner==None:
             raise Exception(
                 "you must call Job.__init__ "
                 "with either a book, id, and owner or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetID(id)
         self.SetOwner(owner)
         if name != None:
             self.SetName(name)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)    
Esempio n. 10
0
 def __init__(self, book=None, id=None, currency=None, name=None,
              instance=None):
     if instance == None:
         if book==None or id==None or currency==None:
             raise Exception(
                 "you must call GnuCashBusinessEntity.__init__ "
                 "with either a book, id, and currency, or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetID(id)
         self.SetCurrency(currency)
         if name != None:
             self.SetName(name)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)
Esempio n. 11
0
 def __init__(self, book=None, id=None, owner=None, name=None,
              instance=None):
     if instance == None:
         if book==None or id==None or owner==None:
             raise Exception(
                 "you must call Job.__init__ "
                 "with either a book, id, and owner or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetID(id)
         self.SetOwner(owner)
         if name != None:
             self.SetName(name)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)    
Esempio n. 12
0
 def __init__(self, book=None, id=None, currency=None, name=None,
              instance=None):
     if instance == None:
         if book==None or id==None or currency==None:
             raise Exception(
                 "you must call GnuCashBusinessEntity.__init__ "
                 "with either a book, id, and currency, or an existing "
                 "low level swig proxy in the argument instance")
         GnuCashCoreClass.__init__(self, book)
         self.SetID(id)
         self.SetCurrency(currency)
         if name != None:
             self.SetName(name)
     else:
         GnuCashCoreClass.__init__(self, instance=instance)