Browse Source

需求单No.139862:大红门【结算单导nc接口】修改。

master
gww 7 years ago
parent
commit
e7a02e6e03
2 changed files with 22 additions and 23 deletions
  1. +11
    -0
      BWP.B3ButcherManageExport/BL/NC/StatPayToNcBL_/StatPayToNcBL.cs
  2. +11
    -23
      BWP.B3ButcherManageExport/BL/NC/script/大红门结算单导NC凭证.py

+ 11
- 0
BWP.B3ButcherManageExport/BL/NC/StatPayToNcBL_/StatPayToNcBL.cs View File

@ -7,6 +7,7 @@ using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
@ -57,5 +58,15 @@ namespace BWP.B3ButcherManageExport.BL
Date = date ?? BLContext.Today;
Export(dmoIDs, extSystemID);
}
public void CheckAccountingUnit(IEnumerable<StatPay> dmos)
{
var groups = dmos.GroupBy(x => x.AccountingUnit_Name);
var count = groups.Count();
if (count > 1)
{
throw new ApplicationException("一次导出只能选择同一个会计单位下的单据");
}
}
}
}

+ 11
- 23
BWP.B3ButcherManageExport/BL/NC/script/大红门结算单导NC凭证.py View File

@ -21,12 +21,13 @@ class BLMethodEvents(BLMethodEventsBase):
def execute(self):
self.proxy.CheckAccountingUnit(dmos);
voucher2 = NcVoucher();
voucher2 = NcVoucher();
for dmo in dmos:
voucher2.B2BillIDs.Add(dmo.ID);
voucher2.Head.Company = dmo.AccountingUnit_Name;
if dmo.AccountingUnit_ID==5:
statePay = dmos[0];
voucher2.Head.Company = statePay.AccountingUnit_Name;
if statePay.AccountingUnit_ID==5:
voucher2.Head.VoucherType = "QHC凭证";
else:
voucher2.Head.VoucherType = "记账凭证";
@ -42,16 +43,16 @@ class BLMethodEvents(BLMethodEventsBase):
vouchers.Bills.Add(voucher2);
entryid = 0;
num = str(dmo.RealNumber);
weight = str(dmo.RealWeight);
abstract = self.proxy.GetDateTime(dmo.Date,"yyyy-MM-dd")+dmo.Supplier_Name +"购买生猪"+ num + ""+ weight +"KG";
for dmo in dmos:
num = str(dmo.RealNumber);
weight = str(dmo.RealWeight);
abstract = self.proxy.GetDateTime(dmo.Date,"yyyy-MM-dd")+dmo.Supplier_Name +"购买生猪"+ num + ""+ weight +"KG";
if dmo.AccountingUnit_ID == 1:
entryid = entryid + 1;
entry = NcVoucherEntry();
voucher2.Body.Entrys.Add(entry);
entry.EntryId = str(entryid);
entry.AccountCode = "原材料\生猪" ;
entry.AccountCode = "原材料生猪" ;
entry.Abstract = abstract;
entry.Currency = "CNY";
entry.ExchangeRate2 = "1" ;
@ -60,22 +61,9 @@ class BLMethodEvents(BLMethodEventsBase):
entry.DebitQuantity = weight;
entry.UnitPrice = str(dmo.RawPrice);
for dmo in dmos:
if dmo.AccountingUnit_ID == 1:
entryid = entryid + 1;
entry = NcVoucherEntry();
voucher2.Body.Entrys.Add(entry);
entry.EntryId = str(entryid);
entry.AccountCode = "预付账款\集团外预付账款\其他预付生猪款" ;
entry.Abstract = abstract;
entry.Currency = "CNY";
entry.ExchangeRate2 = "1" ;
entry.PrimaryCreditAmount = str(dmo.Money);
entry.NaturalCreditCurrency = str(dmo.Money);
item =Items();
item.Name = "供应商辅助核算";
item.Value = dmo.Supplier_Name;
entry.Accountings.Items.Add(item);
for dmo in dmos:
num = str(dmo.RealNumber);
weight = str(dmo.RealWeight);
abstract = self.proxy.GetDateTime(dmo.Date,"yyyy-MM-dd")+dmo.Supplier_Name +"购买生猪"+ num + ""+ weight +"KG";
if dmo.AccountingUnit_ID == 1:
entryid = entryid + 1;
entry = NcVoucherEntry();


Loading…
Cancel
Save