进销存
进销存
purchase_sheet[mongo] 采购单
"_id": "T2436-CGD-2017-09-15-00008",
"station_id": "T2436", // 站点ID
"time_config_id": "ST001", // 时间配置ID
"settle_supplier_id": "T2559", // 供应商ID
"modify_time": new Date(1505493641653), // 修改时间
"purchaser_id": 2209, // 采购员ID
"operator_id": 2209, // 操作人ID
"operator": "13333333334", // 操作人
"cycle_start_time": new Date("2017-09-15T14:00:00+0800"), // 周期开始时间
"in_stock_time": new Date("2017-09-15T08:00:00+0800"), // 入库时间
"status": 2, // 状态 (-1:已删除;1:已驳回;2:待入库;3:已入库)
"create_time": new Date(1505493386310) // 创建时间
purchase_sku_log[mongo] 采购记录
"_id": ObjectId("59bb910a2213933b6d4b6aab"),
"station_id": "T2436", // 站点ID
"sale_unit_name": "包", // 规格单位
"sheet_no": "T2436-CGD-2017-09-15-00008", // 所属采购单号
"tasks": [ // 采购任务信息
{
"id": 3122498, // 采购任务ID
"plan_amount": 10.0, // 计划采购量
"order_id": null, // 订单ID
"remark": null, // 备注
"res_name": null, // 店铺名
"address_id": null // 店铺ID
}],
"sku_id": "D1854777", // 采购规格ID
"modify_time": new Date(1505493386300), // 修改时间
"settle_supplier_id": "T2559", // 供应商ID
"spu_id": "C373692", // 商品ID
"sale_ratio": 1.0, // 规格
"purchase_operator": "13333333334", // 采购员
"purchase_amount": 10.0, // 采购数量
"purchaser_id": 2209, // 采购员ID
"std_unit_name": "斤", // 标准单位
"create_time": new Date(1505493386317), // 创建时间
"status": 0, // 状态
"spu_name": "菜心", // 商品名
"sku_name": "菜心", // 规格名
"purchase_price": 100 // 采购价格
stock_sheet[mongo] 入库单/退货单
"_id": "T2436-JHD-2017-09-14-00001", // 入库单号
"station_id": "T2436", // 站点ID
"sku_money": 1000.0, // 金额
"zhezhangs": [ // 折帐信息
],
"settle_supplier_id": "T2559", // 供应商ID
"_lock": false,
"update_time": new Date(1505414790681), // 更新时间
"date_time": new Date(1505414790681), //
"details": [ // 入库商品详情
{
"id": "D1853878", // 规格ID
"name": "菜心|大条", // 规格名
"unit_price": 1000.0, // 单价
"std_unit": "斤", // 标准单位
"money": 1000, // 入库金额
"category": "叶菜类", // 分类
"spu_id": "C359322", // 商品ID
"quantity": 1.0, // 入库数量
"operator": "gmtest01" // 操作人
}],
"type": 1, // 类型(1:入库单)
"creator": "gmtest01",
"fentans": [ // 分摊信息
],
"delta_money": 0,
"status": 3, // 状态
"supplier_name": "供应商_菜菜", // 供应商名称
"init_details": [
{
"id": "D1853878",
"name": "菜心|大条",
"unit_price": 1000.0,
"std_unit": "斤",
"money": "10.00",
"category": "叶菜类",
"spu_id": "C359322",
"quantity": 1.0,
"operator": "gmtest01"
}
],
"submit_time": new Date("2017-09-14T08:00:00+0800") // 提交时间
in_stock_log[mongo] 入库记录
"_id": ObjectId("59c24c4a1d41c86dd037daf9"),
"sheet_no": "T6342-JHD-2017-09-20-00001", // 入库单号
"std_unit": "斤", // 商品单位
"spu_id": "C787333", // 商品ID
"purchase_sku_id": "D2360588", // 采购规格ID
"category": "叶菜", // 分类 (废弃)
"remark": "", // 备注
"operator": "12589658965", // 操作人
"ratio": 1, // 规格
"price": 400.0, // 入库价
"in_stock_amount": 10.0, // 入库数量
"type": 1, // 1:正常入库;2:退货入库
"desc": "-", // 描述
"station_id": "T6342", // 站点ID
"money": 4000.0, // 金额
"create_time": new Date("2017-09-20T08:00:00+0800"), // 创建时间
"name": "款叶菠|1斤/斤", // 规格名
"category_id_1": "A3241", // 一级分类ID
"category_id_2": "B16079" // 二级分类ID
out_stock_sheet[mongo] 出库单记录
"_id": "LK477705", // 出库单ID
"out_stock_time": new Date(1488384018122), // 出库时间
"update_time": new Date(1488384018122), // 更新时间
"station_id": "T002", // 站点ID
"money": 49769.0, // 出库总金额
"details": [], // 出库商品详情
[{
"name": "白菜苔",
"creator": "k10admin",
"quantity": "10",
"spu_id": "C00001",
"category": "叶菜类",
"sale_ratio": 1.0,
"std_unit": "斤",
"sale_unit": "斤",
"id": "D00664",
"unit_price": 312.76
}]
"creator": "许强", // 创建人
"status": 2, // 出库单状态(1:未出库;2:已出库;3:已删除)
"out_stock_target": "SZ-阿米巴54号-链谷", // 出库目标
"create_time": new Date(1488384018122) // 创建时间
out_stock_log[mongo] 出库记录
"_id": ObjectId("56dfd838d97c0a57a39bfbeb"),
"create_time": new Date(1457539255098), # 创建时间
"out_stock_sale": 2.0800000000000000711,
"out_stock_base": 2.0800000000000000711,
"operator": "System”, # 操作员
"sale_sku_id": "D800275”, # 出库商品
"station_id": "T134”, # 所属站点
"price": 1200.0, # 出库商品价格
"order_id": "LK287816”, # 订单ID
"type": 1 # 1-正常出库, 2-补货出库
stock[mongo] 库存
"_id" : ObjectId("562603dcd97c0a37433c8dc8"),
"avg_price" : 350.0000000000000000,
"spu_id" : "C01429",
"station_id" : "T134",
"remain" : -277.5000000000000000,
"_lock" : false
stock_sheet[mongo] 入库单/退货单
"_id": "T002-JHD-2016-03-09-00025”, # 单据ID
"supplier_id": "T003”, # 供应商id
"station_id": "T002”, # ****所属站点ID
"_lock": false,
"settle_supplier_id": "T543”, #结算供应商站点ID
"status": 1, # 单据状态 (-1:已删除;1:待提交;2:待审核;3:审核通过;4:已结款;0:审核不通过)
"date_time": new Date(1457567532786), # 创建日期
"submit_time": new Date(1457567532786), # 入库或退货时间(就是提交时刻)
"type": 1, # 单据类型(1:入库单 ;2:退货单)
"sku_money": 74650.0, # 商品金额
"sku_num": 7 # 商品数量
"details": list of dict 退货商品详情
quantity 退货数量
unit_price 退货单价,单位分
price 退货总价,单位分
money 已经废弃的字段,这个字段的存在就是一个 bug
......
return_to_supply_log[mongo] 退货记录
"_id": ObjectId("56e067ed61617b68edbc2300"),
"return_amount": 8.0, # 退货数量
"create_time": new Date(1457576045073), # 创建时间
"station_id": "T002”, # 所属站点
"sheet_no": "T002-JHTHD-2016-03-10-00006”, # 退货单ID
"operator": "k10wudaan”, # 操作人员
"purchase_sku_id": "D00182”, # 退货商品ID
"price": 700.0 # 退货商品价格
settle_sheet[mongo] 结款单
"_id": "T002-FKD-2016-03-09-00006",
"total_price": 3110000.0, # 总金额
"supplier_id": "T010",
"station_id": "T002”, # 所属站点
"sheet_nos”: # 相关单据ID
[
"T002-JHD-2016-02-24-00009",
"T002-JHD-2016-02-16-00002",
"T002-JHD-2016-03-01-00037"
],
"settle_supplier_id": "T567”, # 结算供应商ID
"status": 2, # -1-已删除,1-待提交,2-待审核,4-已支付,0-审核不通过
"remark": "新发宏2.16-3.1货款”, # 备注
"date_time": new Date(1457541089893) # 生成时间
stock_increase_log[mongo] 商品报溢
"_id" : ObjectId("56266f4261617b6c598f70a3"),
"station_id" : "T134",
"create_time" : ISODate("2015-10-21T00:43:46.795Z"),
"increase_amount" : 45.0000000000000000,
"price" : 76.0000000000000000,
"spu_id" : "C00059",
"operator" : "dglhxinxi",
"old_stock" : 0.0000000000000000,
"remark" : "20151020期初库存"
stock_loss_log[mongo] 商品报损
//商品损耗
"_id" : ObjectId("5637711d61617b23f2f2e28c"),
"old_stock" : 0.8199999999999958, //抄盘数
"spu_id" : "C00325",
"station_id" : "T134",
"loss_amount" : 0.8199999999999958, //损耗数
"price" : 2400.0000000000000000, //损耗金额
"operator" : "dglhxinxi", //操作员
"create_time" : ISODate("2015-11-02T22:20:13.037Z")
stock_value[mongo] 每日spu货值
"_id" : ObjectId("5704c983d97c0a7d4b6a1220"),
"increase_stock_amount" : 40.00, # 报溢记录处理
"increase_stock_value" : 4.00, # 报溢记录处理
"loss_stock_value" : 4.00, # 报损处理记录
"loss_stock_amount" : 4.00,# 报损记录处理
"spu_id" : "C00117",
"category_id_1": "A1250", # 一级分类id
"category_id_2": "B1265", # 二级分类id
"station_id" : "T134",
"date_time" : ISODate("2015-10-21T00:00:00.000Z"),
"accum_stock_value" : 0, # 累计成本(脚本执行当天前一天)
"accum_stock_num": 0, # 累计商品数量(脚本执行当天前一天)
"increase_stock_value" : 8000.00,
"out_stock_value" : 1000.00, # 出库
"out_stock_amount" : 5.00, # 出库
"in_stock_value" : 5.00, # 入库
"in_stock_amount" : 5.00, # 入库
"return_stock_value" : 5.00, # 退货
"return_stock_amount" : 5.00, # 退货
"sheet_no" : RKD2018080980001, # 入库退货单号
"stock_type": 1,2,3,4,5 # spu货值成本类型 1-入库,2-出库,3-退货,4-商户退货,5-报损,6-报溢