Demo entry 6352952

python

   

Submitted by anonymous on Mar 28, 2017 at 11:34
Language: Python. Code size: 2.6 kB.

# -*- coding: utf-8 -*- 
from django.db import models


class QuickBillOrder(models.Model):
    '''
    '扫码订单
    '共有3部分信息,基本信息--收银上传,会员信息--扫码后自动获取,支付信息--支付完成的回调
    '''
    out_trade_no=models.CharField(_(u'订单唯一识别号'),max_length=128,null=True,blank=True,unique=True)
    org_name=models.CharField(_(u'餐厅名称'),max_length=80,null=True,blank=True)
    org_guid=models.CharField(_(u'餐厅ID'),max_length=80,null=True,blank=True)
    table_name=models.CharField(_(u'桌台名称'),max_length=80,null=True,blank=True)
    table_id=models.IntegerField(_(u'餐厅ID'))
    order_head_id=models.IntegerField(_(u'餐厅ID'))
    check_id=models.IntegerField(_(u'餐厅ID'))
    total_amount=models.FloatField(_(u'总计金额'),default=0)
    discount_amount=models.FloatField(_(u'可打折金额'),default=0)
    
    weixinid=models.CharField(_(u'顾客微信ID'),max_length=100,null=True,blank=True)
    card=models.ForeignKey('customer.StoredValueCard',on_delete=models.CASCADE,null=True,blank=True)
    card_discount=models.FloatField(_(u'会员折扣'),default=0)
    card_discount_amount=models.FloatField(_(u'会员折扣金额'),default=0)
    card_actual_amount=models.FloatField(_(u'实际支付金额'),default=0)
    
    status=models.IntegerField(_(u'支付方式'),default=1,choices=((0,_(u'未支付')),(2,_(u'微信支付')),(3,_(u'会员卡支付')),(4,_(u'支付宝支付'))))
    transaction_id=models.CharField(_(u'交易流水号'),max_length=128,null=True,blank=True)
    total_fee=models.FloatField(u'支付金额',null=True,blank=True)
    description=models.CharField(u'说明',max_length=200,null=True,blank=True)

    create_time=models.DateTimeField(auto_now_add=True)
    update_time=models.DateTimeField(auto_now=True)
    commented=models.BooleanField(_(u'是否已评价'),default=False)

    class Meta:
        app_label="weixin"
        
    def __unicode__(self):
        return u"%s(%s)"%(self.username,self.phone)

    



class QuickBillDetail(models.Model):
    '''
    '订单详情
    ’相对收银的结构,稍作变动,将税放到Detail
    '''
    order=models.ForeignKey(QuickBillOrder,on_delete=models.CASCADE,related_name='details')
    commented=models.BooleanField(_(u'是否已评价'),default=False)
    
    menu_item_name=models.CharField(_(u'菜品名称'),max_length=80,null=True,blank=True)
    menu_item_id=models.IntegerField(_(u'菜品ID'))
    unit=models.CharField(_(u'单位'),max_length=20,null=True,blank=True)
    product_price=models.FloatField(_(u'菜品金额'),default=0)
    is_discount=models.BooleanField(_(u'是否可打折'),default=1)
    is_return_item=models.BooleanField(_(u'是否为退菜'),default=1)
    quantity=models.FloatField(_(u'数量'),default=0)
    actual_price=models.FloatField(_(u'数量'),default=0)
    

    class Meta:
        app_label="weixin"

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).