You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

57 lines
2.4 KiB

from BWP.B3ExportBase.BO import StatPayU8
from BWP.B3ExportBase.BO import StatPayU8BodyEntry
class BLMethodEvents(BLMethodEventsBase):
def before(self):
#0 读取部分字段,1 读取单据所有字段,包括明细
self.proxy.LoadFullDom = 0
#当设置 0时,指定需要读取的字段
self.proxy.MinDmoProperties.Add("CheckTime");#入库日期--审核日期
self.proxy.MinDmoProperties.Add("Employee_Name");#业务员--经办人
self.proxy.MinDmoProperties.Add("Supplier_Name");#供货单位--供应商
self.proxy.MinDmoProperties.Add("Supplier_Code");#供货单位--供应商编号
self.proxy.MinDmoProperties.Add("Remark");#备注--摘要
self.proxy.MinDetailProperties.Add("StatPay_ID");#存货编码--级别编码
self.proxy.MinDetailProperties.Add("Livestock_Code");#存货编码--级别编码
self.proxy.MinDetailProperties.Add("Livestock_Spec");#规格型号--级别规格
self.proxy.MinDetailProperties.Add("Weight");#数量--重量
def execute(self):
id = 0;
for dmo in dmos:
vouchers.Lastquerydate = str(dmo.CheckTime);
vouchers.Dynamicdate = self.proxy.GetDateTime(dmo.CheckTime,"yyyy-MM-dd");
vouchers.Timestamp = str(dmo.CheckTime);
vouchers.Bignoreextenduserdefines = "y";
vouchers.Maxdataitems = "20000";
vouchers.Paginate = "0";
#self.emptyError(dmo.SaleKind_Name,"NO."+str(dmo.ID)+"销售类型为空")
id = id + 1;
inv = StatPayU8();
vouchers.Bills.Add(inv);
inv.B2BillIDs.Add(dmo.ID);
inv.Head.Id = id.ToString("00000000000000");
inv.Head.Code = id.ToString("00000000000000");
inv.Head.Date = self.proxy.GetDateTime(dmo.CheckTime,"yyyy-MM-dd");
inv.Head.Vouchtype = "01";
inv.Head.Warehousecode = "07";#仓库,默认 新原料猪库
inv.Head.Receivecode = "0101";#入库类别,默认 原料猪采购入库
inv.Head.Businesstype = "普通采购";
inv.Head.Purchasetypecode = "1";#采购类型,默认 普通采购
inv.Head.Source = "库存";
inv.Head.Auditdate = self.proxy.GetDateTime(dmo.CheckTime,"yyyy-MM-dd hh:mm:ss");
inv.Head.Maker = dmo.Employee_Name;
inv.Head.Vendorcode = dmo.Supplier_Code;#供应商编码
inv.Head.Exchrate = "1";#汇率
#self.error(str(dmo.Details.Count));
weight = 0;
for detail in dmo.Details:
weight+=detail.Weight;
entry = StatPayU8BodyEntry();
inv.Body.AddEntry(entry);
entry.Autoid = "1000089842";
entry.Inventorycode = "110101";
entry.Invname = "毛猪(新)";
entry.Quantity = str(weight);