GithubHelp home page GithubHelp logo

django-invoice's People

Contributors

chris7 avatar simonluijk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-invoice's Issues

Recurring invoice support

Hello,
Has anyone managed to implement Recurring invoice support for django-invoice as yet?
regards,
Errol

Does it work?

Does this project work? I'd like to use it if it does. If it does, anyway you could submit to pypi.python.org so it will be easy to install/manage?

Remove the need for a user profile.

Currently the model looks like the following:

class Invoice(models.Model):
    user = models.ForeignKey(User)
    currency = models.ForeignKey(Currency, blank=True, null=True)
    address = models.ForeignKey(Address, related_name='%(class)s_set')

What do you think of breaking out the user, currency, and address, and instead, linking Invoice to 'Customer' in the following manner.

class Country(models.Model):
    name = models.CharField( ... )
    ...

class Region(models.Model): # state/province/region
    country = models.ForeignKey(Country)
    ...

class Locality(models.Model): # city/town/hamlet
    region = models.ForeignKey(Region)
    ...

class Address(models.Model):
    locality = models.ForeignKey(Locality)
    ...

class Currency(models.Model):
    country = models.ManyToManyField(Country)
    ...        

class Customer(models.Model):
    address = models.ForeignKey(Address)
    ...

class Invoice(models.Model):
    customer = models.ForeignKey(Customer)

    def address(self):
        return self.customer.address

    def currency(self):
        return self.customer.address.city.state.country.currency

A currency is an attribute of a country. However, a currency has nothing to do with an address. We could even add official_languages as a field to County, and have translations based on that, but it would be difficult to know when to stop. So that being said, maybe it is best to keep currency as a field in invoice.

Let me know what you think.

I forked and made some changes, but won't make a PR until I write test, and make sure everything works.

Invoice Numbers

Bug:

https://github.com/simonluijk/django-invoice/blob/master/invoice/utils/friendly_id.py#L74

Is broken on python3

I can fix it, and send a pull-request, but before I do, I would like to hear what you think about the following.

I agree that the invoice numbers should not expose how many invoices have been created. However the current implementation can be simplified, and become more meaningful, by setting the id to the following pattern.

invoice-id = yyyymmdd-aaaa0000

Today:

invoice-100 = 20140424-8cff2cdc

Tomorrow:

#Notice the date increased
invoice-101 = 20140425-175abd80

Where the first 8 digits are the date the invoice was created, and the last 8 digits are the first 8 digits from uuid4()

from uuid import uuid4
def test_uuid4():
    x = str(uuid4())
    print(x)
    print(x[:8])

result

test_uuid4()
    8cff2cdc-e535-45be-ada4-492fb6f6ff37
    8cff2cdc

Each invoice ID will be unique, and somewhat meaningful, since we prefix them all with the day.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.