示例#1
0
文件: counter.py 项目: KGPython/scm
def exportDetail(rslist, sum1, sum2, sum3):
    sname = "门店销售列表"

    titles = [
        ("大类编码", "1000", "shopid"),
        ("大类名称", "1000", "shopid"),
        ("日期", "1000", "shopid"),
        ("销售数量", "1000", "promflag"),
        ("实际销售", "1000", "startdate"),
        ("销售成本", "1000", "enddate"),
        ("占比", "500", "enddate"),
        ("累计占比", "1000", "enddate"),
    ]

    fmtlist = [None, None, "%Y-%m-%d", "0.00", "0.000", "0.000", "0.00", "0.0"]

    sumList = ["合计", None, None, sum1, sum2, sum3, "100.00", "100.00"]

    book = mtu.exportXls(sname, titles, rslist, sumList, None, fmtlist)

    outtype = "application/vnd.ms-excel"
    fname = "sale_counter_detail.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#2
0
文件: counter.py 项目: KGPython/scm
def export(rslist, sum1, sum2, sum3):
    sname = "门店-大类销售汇总"

    titles = [
        ("门店名称", "1000", "shopid"),
        ("销售数量", "1000", "promflag"),
        ("实际销售", "1000", "startdate"),
        ("销售成本", "1000", "enddate"),
    ]

    fmtlist = [None, "0.00", "0.000", "0.000"]

    shopDict = findShop()

    dictlist = [shopDict, None, None, None]

    sumList = ["合计", sum1, sum2, sum3]

    book = mtu.exportXls(sname, titles, rslist, sumList, dictlist, fmtlist)

    outtype = "application/vnd.ms-excel"
    fname = "sale_counter.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#3
0
def exportXls(rslist):

    sname = "商品资料一览表"

    titles = [("门店编码", "1000", "shopid"), ("门店名称", "1000", "shopid"),
              ("商品条码", "1000", "barcodeid"), ("商品名称", "5000", "name"),
              ("规格", "500", "spec"), ("进价", "500", "cost"),
              ("执行售价", "1000", "price"), ("销售状态", "1000", "flag"),
              ("供应商", "1000", "venderid"), ("税率", "500", "costtaxrate"),
              ("单位", "500", "unitname"), ("小类", "1000", "deptid"),
              ("商品编码", "1000", "goodsid"), ("促销标志", "1000", "promflag"),
              ("开始日期", "1000", "startdate"), ("结束日期", "1000", "enddate")]

    fmtlist = [
        None, None, None, None, None, None, None, None, None, None, None, None,
        None, None, "%Y-%m-%d", "%Y-%m-%d"
    ]

    shopDict = findShop()

    dictlist = [
        None, shopDict, None, None, None, None, None, Constants.SALE_STATUS,
        None, None, None, None, None, Constants.PROM_FLAG, None, None
    ]

    book = mtu.exportXls(sname, titles, rslist, None, dictlist, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "goods.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#4
0
文件: analysis.py 项目: KGPython/scm
def export(outlist,sum1,sum2,sum3):
    sname = "日销售汇总列表"
    titles = [("日期","1000"),("门店明细","1000"),("单品明细","1000"),("大类明细","1000"),("销售数量","1000"),("实际销售","1000"),
              ("销售成本","1000"),("销售成本占比(%)","2000"),("销售成本累计占比(%)","3000")]

    sumlist = ["合计","门店合计","单品合计","大类合计",sum1,sum2,sum3,"100.00","100.00"]
    fmtlist = [None,None,None,None,"0.00","0.00","0.00","0.00","0.0"]

    book = mtu.exportXls(sname,titles,outlist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#5
0
def exportDetail(rslist,sum1,sum2,sum3,pname):
    sname = "单品"+pname+"销售汇总"

    titles = [("门店","2000"),("销售数量","1000"),("实际销售","1000"),("销售成本","1000"),
              ("销售成本占比","2000"),("销售成本累计占比","2000")]

    sumlist = ["合计",sum1,sum2,sum3,"100.00","100.00"]
    fmtlist = [None,"0.00","0.00","0.000","0.000","0.00"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_sellinfo_pro.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#6
0
文件: category.py 项目: KGPython/scm
def exportDetail(rslist,sum1,sum2,sum3):
    sname = "类别日销售列表"

    titles = [("日期","1000"),("小类编码","1000"),("小类名称","1000"),("销售数量","1000"),("实际销售","1000"),
              ("销售成本","1000"),("占比(%)","500"),("累计占比(%)","1000")]

    sumlist = ["合计","","",sum1,sum2,sum3,"100.00","100.0"]
    fmtlist = ["%Y-%m-%d",None,None,"0.00","0.000","0.000","0.00","0.0"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_category.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#7
0
文件: analysis.py 项目: KGPython/scm2
def exportDetail3(rslist, sum1, sum2, sum3, type):
    sname = "销售汇总―大类" + type + "销售汇总"

    titles = [("大类编号", "1000"), ("大类名称", "1000"), ("销售数量", "1000"),
              ("实际销售", "1000"), ("销售成本", "1000")]

    sumlist = ["合计", "", sum1, sum2, sum3]
    fmtlist = [None, None, "0.00", "0.000", "0.000"]

    book = mtu.exportXls(sname, titles, rslist, sumlist, None, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis_gz.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#8
0
文件: sellinfo.py 项目: KGPython/scm
def exportDetail(rslist,sum1,sum2,sum3,pname):
    sname = "单品"+pname+"销售汇总"

    titles = [("门店","2000"),("销售数量","1000"),("实际销售","1000"),("销售成本","1000"),
              ("销售成本占比","2000"),("销售成本累计占比","2000")]

    sumlist = ["合计",sum1,sum2,sum3,"100.00","100.00"]
    fmtlist = [None,"0.00","0.00","0.000","0.000","0.00"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_sellinfo_pro.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#9
0
文件: analysis.py 项目: KGPython/scm
def exportDetail3(rslist,sum1,sum2,sum3,type):
    sname = "销售汇总―大类"+type+"销售汇总"

    titles = [("大类编号","1000"),("大类名称","1000"),("销售数量","1000"),
              ("实际销售","1000"),("销售成本","1000")]

    sumlist = ["合计","",sum1,sum2,sum3]
    fmtlist = [None,None,"0.00","0.000","0.000"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis_gz.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#10
0
文件: product.py 项目: KGPython/scm
def export(rslist,sum1,sum2,sum3):
    sname = "单品销售汇总"

    titles = [("日期","1000"),("商品编号","1000"),("商品条码","1000"),("商品名称","3000"),("规格","500"),
              ("税率","500"),("销售数量","1000"),("实际销售","1000"),("销售成本","1000")]

    sumlist = ["合计","","","","","",sum1,sum2,sum3]
    fmtlist = [None,None,None,None,None,None,"0.00","0.000","0.000"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_product.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#11
0
def export(rslist,sum1,sum2,sum3):

    sname = "商品销售明细"

    titles = [("商品编号","1000"),("商品条码","1000"),("商品名称","3000"),("小类编码","1000"),("小类名称","1000"),("规格","500"),
              ("税率","500"),("销售数量","1000"),("实际销售","1000"),("销售成本","1000"),("占比(%)","500"),("累计占比(%)","500")]

    sumlist = ["合计","","","","","","",sum1,sum2,sum3,"100.00","100.0"]
    fmtlist = [None,None,None,None,None,None,"0.00","0.00","0.000","0.000","0.00","0.0"]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_sellinfo.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#12
0
文件: analysis.py 项目: KGPython/scm
def exportDetail2(rslist,sum1,sum2,sum3,type):

    sname = " 销售汇总―单品"+type+"销售汇总"

    titles = [("商品编号","1000"),("商品条码","1000"),("商品名称","3000"),("规格","500"),("单位","500"),
              ("销售数量","1000"),("实际销售","1000"),("销售成本","1000"),("税率","500")]

    sumlist = ["合计","","","","",sum1,sum2,sum3,""]
    fmtlist = [None,None,None,None,None,"0.00","0.000","0.000",None]

    book = mtu.exportXls(sname,titles,rslist,sumlist,None,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis_pro.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response
示例#13
0
文件: category.py 项目: KGPython/scm2
def exportDetail(rslist, sum1, sum2, sum3):
    sname = "类别日销售列表"

    titles = [("日期", "1000"), ("小类编码", "1000"), ("小类名称", "1000"),
              ("销售数量", "1000"), ("实际销售", "1000"), ("销售成本", "1000"),
              ("占比(%)", "500"), ("累计占比(%)", "1000")]

    sumlist = ["合计", "", "", sum1, sum2, sum3, "100.00", "100.0"]
    fmtlist = ["%Y-%m-%d", None, None, "0.00", "0.000", "0.000", "0.00", "0.0"]

    book = mtu.exportXls(sname, titles, rslist, sumlist, None, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_category.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#14
0
文件: analysis.py 项目: KGPython/scm2
def exportDetail2(rslist, sum1, sum2, sum3, type):

    sname = " 销售汇总―单品" + type + "销售汇总"

    titles = [("商品编号", "1000"), ("商品条码", "1000"), ("商品名称", "3000"),
              ("规格", "500"), ("单位", "500"), ("销售数量", "1000"), ("实际销售", "1000"),
              ("销售成本", "1000"), ("税率", "500")]

    sumlist = ["合计", "", "", "", "", sum1, sum2, sum3, ""]
    fmtlist = [None, None, None, None, None, "0.00", "0.000", "0.000", None]

    book = mtu.exportXls(sname, titles, rslist, sumlist, None, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis_pro.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#15
0
文件: analysis.py 项目: KGPython/scm2
def export(outlist, sum1, sum2, sum3):
    sname = "日销售汇总列表"
    titles = [("日期", "1000"), ("门店明细", "1000"), ("单品明细", "1000"),
              ("大类明细", "1000"), ("销售数量", "1000"), ("实际销售", "1000"),
              ("销售成本", "1000"), ("销售成本占比(%)", "2000"), ("销售成本累计占比(%)", "3000")]

    sumlist = [
        "合计", "门店合计", "单品合计", "大类合计", sum1, sum2, sum3, "100.00", "100.00"
    ]
    fmtlist = [None, None, None, None, "0.00", "0.00", "0.00", "0.00", "0.0"]

    book = mtu.exportXls(sname, titles, outlist, sumlist, None, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "day_sale_analysis.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#16
0
文件: counter.py 项目: KGPython/scm2
def exportDetail(rslist, sum1, sum2, sum3):
    sname = "门店销售列表"

    titles = [("大类编码", "1000", "shopid"), ("大类名称", "1000", "shopid"),
              ("日期", "1000", "shopid"), ("销售数量", "1000", "promflag"),
              ("实际销售", "1000", "startdate"), ("销售成本", "1000", "enddate"),
              ("占比", "500", "enddate"), ("累计占比", "1000", "enddate")]

    fmtlist = [None, None, "%Y-%m-%d", "0.00", "0.000", "0.000", "0.00", "0.0"]

    sumList = ["合计", None, None, sum1, sum2, sum3, "100.00", "100.00"]

    book = mtu.exportXls(sname, titles, rslist, sumList, None, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_counter_detail.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#17
0
文件: counter.py 项目: KGPython/scm2
def export(rslist, sum1, sum2, sum3):
    sname = "门店-大类销售汇总"

    titles = [("门店名称", "1000", "shopid"), ("销售数量", "1000", "promflag"),
              ("实际销售", "1000", "startdate"), ("销售成本", "1000", "enddate")]

    fmtlist = [None, "0.00", "0.000", "0.000"]

    shopDict = findShop()

    dictlist = [shopDict, None, None, None]

    sumList = ["合计", sum1, sum2, sum3]

    book = mtu.exportXls(sname, titles, rslist, sumList, dictlist, fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "sale_counter.xls"
    response = mtu.getResponse(HttpResponse(), outtype, fname)
    book.save(response)
    return response
示例#18
0
文件: views.py 项目: KGPython/scm
def exportXls(rslist):

    sname = "商品资料一览表"

    titles = [("门店编码","1000","shopid"),("门店名称","1000","shopid"),("商品条码","1000","barcodeid"),("商品名称","5000","name"),("规格","500","spec"),
              ("进价","500","cost"),("执行售价","1000","price"),("销售状态","1000","flag"),("供应商","1000","venderid"),("税率","500","costtaxrate"),
              ("单位","500","unitname"),("小类","1000","deptid"),("商品编码","1000","goodsid"),("促销标志","1000","promflag"),("开始日期","1000","startdate"),
              ("结束日期","1000","enddate")]

    fmtlist = [None,None,None,None,None,None,None,None,None,None,
               None,None,None,None,"%Y-%m-%d","%Y-%m-%d"]

    shopDict = findShop()

    dictlist = [None,shopDict,None,None,None,None,None,Constants.SALE_STATUS,None,
               None,None,None,None,Constants.PROM_FLAG,None,None]

    book = mtu.exportXls(sname,titles,rslist,None,dictlist,fmtlist)

    outtype = 'application/vnd.ms-excel'
    fname = "goods.xls"
    response = mtu.getResponse(HttpResponse(),outtype,fname)
    book.save(response)
    return response