from django.db import models
	

class FlipDB(models.Model):
	InvoiceID=models.CharField(max_length=1000,null=True)
	Ordered_On=models.CharField(max_length=1000,null=True)
	Shipment_ID=models.CharField(max_length=1000,null=True)
	ORDER_ITEM_ID=models.CharField(max_length=1000,null=True)
	Order_Id=models.CharField(max_length=1000,null=True)
	Order_State=models.CharField(max_length=1000,null=True)
	Order_Type=models.CharField(max_length=1000,null=True)
	FSN=models.CharField(max_length=1000,null=True)
	SKU=models.CharField(max_length=1000,null=True)
	Product=models.CharField(max_length=1000,null=True)
	Invoice_No=models.CharField(max_length=1000,null=True)
	VAT =models.DecimalField(max_digits=5,decimal_places=3,null=True)
	Invoice_Date=models.CharField(max_length=1000,null=True)
	Invoice_Amount=models.IntegerField(null=True)
	Selling_PPI=models.IntegerField(null=True)
	Shipping_CPI=models.IntegerField(null=True)
	Quantity=models.IntegerField(null=True)
	Price_inc_Subsidy=models.IntegerField(null=True)	
	Buyer_name=models.CharField(max_length=1000,null=True)
	Ship_to_name=models.CharField(max_length=1000,null=True)
	Address_Line_1=models.CharField(max_length=1000,null=True)
	Address_Line_2=models.CharField(max_length=1000,null=True)
	City=models.CharField(max_length=1000,null=True)
	State=models.CharField(max_length=1000,null=True)
	PIN_Code=models.CharField(max_length=1000,null=True)
	Proc_SLA=models.CharField(max_length=1000,null=True)
	Dispatch_After_date=models.CharField(max_length=1000,null=True)
	Dispatch_by_date=models.CharField(max_length=1000,null=True)
	Form_requirement=models.CharField(max_length=1000,null=True)
	Tracking_ID=models.CharField(max_length=1000,null=True)
	Length=models.DecimalField(max_digits=5,decimal_places=3,null=True)
	Breadth=models.DecimalField(max_digits=5,decimal_places=3,null=True)
	Height=models.DecimalField(max_digits=5,decimal_places=3,null=True)
	Weight=models.DecimalField(max_digits=5,decimal_places=3,null=True)
	Attachment=models.CharField(max_length=100,null=True)
	timestamp = models.DateTimeField(auto_now_add=True , auto_now=False)
	updated = models.DateTimeField(auto_now_add=False , auto_now=True)
	def __str__(self):
		return self.Order_Id+"^^"+self.Product+"^^"+self.SKU+"^^"+str(self.Quantity)+"^^"+self.Ordered_On+"^^"+str(self.Invoice_Amount)+"^^"+str(self.Tracking_ID)
class SnapDB(models.Model):
	InvoiceID=models.CharField(max_length=1000,null=True)
	Courier=models.CharField(max_length=500,null=True)
	Product=models.CharField(max_length=1500,null=True)
	Reference_Code=models.CharField(max_length=500,null=True)
	Suborder_ID=models.CharField(max_length=1000,null=True)
	SKU_code=models.CharField(max_length=1000,null=True)
	AWB_Number=models.CharField(max_length=1000,null=True)
	Order_Verified_Date=models.CharField(max_length=1000,null=True)
	Order_Created_Date=models.CharField(max_length=1000,null=True)
	Customer_Name=models.CharField(max_length=1000,null=True)
	Shipping_Name=models.CharField(max_length=1000,null=True)
	City=models.CharField(max_length=1000,null=True)
	State=models.CharField(max_length=1000,null=True)
	PinCode=models.CharField(max_length=1000,null=True)
	SellingPPI=models.CharField(max_length=1000,null=True)
	Tax_Amount_Percent=models.CharField(max_length=500,null=True)
	IMEI=models.CharField(max_length=1000,null=True)
	Promised_ShipDate=models.CharField(max_length=1000,null=True)
	MRP=models.IntegerField(default=0)
	Invoice_Code=models.CharField(max_length=1000,null=True)
	Fulfilment_mode=models.CharField(max_length=1000,null=True)
	Mobile_No=models.CharField(max_length=15,null=True)
	Email_ID=models.CharField(max_length=1000,null=True)
	SUPC=models.CharField(max_length=1000,null=True)
	Attributes=models.CharField(max_length=1000,null=True)
	PaymentMode=models.CharField(max_length=50,null=True)
	HandoverDate=models.CharField(max_length=1000,null=True)
	Courier_Code=models.CharField(max_length=1000,null=True)
	Oneship_Center_Name=models.CharField(max_length=1000,null=True)
	Address=models.CharField(max_length=2000,null=True)	
		
	timestamp = models.DateTimeField(auto_now_add=True , auto_now=False)
	updated = models.DateTimeField(auto_now_add=False , auto_now=True)
	def __str__(self):
		return self.AWB_Number+"^^"+self.Courier+"^^"+self.Suborder_ID+"^^"+self.Product+"^^"+self.SKU_code+"^^"+self.SellingPPI+"^^"+self.Order_Created_Date
class PayDB(models.Model):
	OrderID=models.CharField(max_length=1000,null=True)
	timestamp = models.DateTimeField(auto_now_add=True , auto_now=False)
	updated = models.DateTimeField(auto_now_add=False , auto_now=True)
	def __str__(self):
		return self.OrderID
		
class Files(models.Model):
	FileUploaded=models.CharField(max_length=1000,null=True)
	timestamp = models.DateTimeField(auto_now_add=True , auto_now=False)
	updated = models.DateTimeField(auto_now_add=False , auto_now=True)
	def __str__(self):
		return str(self.FileUploaded)+'^^'+str(self.timestamp)

	
