|
|
|
@ -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(); |
|
|
|
|