# Path: common/models.py
# class Customer(models.Model):
#     """
#     customer model for the various module of future erp
#     """
#     user = models.OneToOneField(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return "%s" % self.user
# 
# Path: common/models.py
# class Staff(models.Model):
#     """
#     staff model for the various module of future erp
#     """
#     user = models.OneToOneField(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return "%s" % self.user
# 
#     class Meta:
#         verbose_name_plural = "staff"
# 
# Path: common/models.py
# class Product(models.Model):
#     """
#     product model for the items etc.
#     """
#     name = models.CharField(max_length=64)
#     description = models.CharField(max_length=1024, unique=True)
#     wholesale_price = models.PositiveIntegerField(default=0)
#     retail_price = models.PositiveIntegerField(default=0)
#     img = models.ImageField(upload_to = 'prod_imgs/', default = 'prod_imgs/default.png')
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return self.name


from django.db import models
from common.models import Customer
from common.models import Staff
from common.models import Product
from django.utils.translation import ugettext_lazy as _
	name = models.CharField(max_length=128, verbose_name=_('Payment Method Name'))	
	description = models.CharField(max_length=128, verbose_name=_('Payment Desciption'))

	def __unicode__(self):
		"""
		function returns unicode representation of 
		"""
		return "%s" % self.name


class Payment(models.Model):
	"""
	model for payment 
	"""
	method = models.ForeignKey(PaymentMethod)
	transaction = models.ForeignKey(Transaction)
	amount = models.PositiveIntegerField(_('Payment Amount'), default=0, null=True, blank=True)
	other_details = models.CharField(max_length=1024, verbose_name=_('Other Details'))

	def __unicode__(self):
		"""
		function returns unicode representation of payment 
		"""
		return "%s" % self.method


class ProductInTransaction(models.Model):
	"""
	model for product in transaction
	"""

# Path: common/models.py
# class Customer(models.Model):
#     """
#     customer model for the various module of future erp
#     """
#     user = models.OneToOneField(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return "%s" % self.user
# 
# Path: common/models.py
# class Staff(models.Model):
#     """
#     staff model for the various module of future erp
#     """
#     user = models.OneToOneField(User)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return "%s" % self.user
# 
#     class Meta:
#         verbose_name_plural = "staff"
# 
# Path: common/models.py
# class Product(models.Model):
#     """
#     product model for the items etc.
#     """
#     name = models.CharField(max_length=64)
#     description = models.CharField(max_length=1024, unique=True)
#     wholesale_price = models.PositiveIntegerField(default=0)
#     retail_price = models.PositiveIntegerField(default=0)
#     img = models.ImageField(upload_to = 'prod_imgs/', default = 'prod_imgs/default.png')
#     created_at = models.DateTimeField(auto_now_add=True)
# 
#     def __unicode__(self):
#         """
#         function returns unicode representation of a product
#         """
#         return self.name


# Path: pos/models.py
from django.db import models
from common.models import Customer
from common.models import Staff
from common.models import Product
from django.utils.translation import ugettext_lazy as _

	name = models.CharField(max_length=128, verbose_name=_('Payment Method Name'))	
	description = models.CharField(max_length=128, verbose_name=_('Payment Desciption'))

	def __unicode__(self):
		"""
		function returns unicode representation of 
		"""
		return "%s" % self.name


class Payment(models.Model):
	"""
	model for payment 
	"""
	method = models.ForeignKey(PaymentMethod)
	transaction = models.ForeignKey(Transaction)
	amount = models.PositiveIntegerField(_('Payment Amount'), default=0, null=True, blank=True)
	other_details = models.CharField(max_length=1024, verbose_name=_('Other Details'))

	def __unicode__(self):
		"""
		function returns unicode representation of payment 
		"""
		return "%s" % self.method


class ProductInTransaction(models.Model):
	"""
	model for product in transaction
	"""

	product = models.ForeignKey(Product)