SBO中如何将付款和预付款发票联系起来

首先,建立预付款发票

然后,建立付款

设置付款的 Invoices 属性

另外 预收款请求的作用:

根据帮助的描述 ,预收款请求可以关闭上一流程的单据,使之可以进行后面的流程,而不会产生日记帐和Stock.

  1. DimdownPayInvAsDocuments=NstAddon.SBO_Company.GetBusinessObject(BoObjectTypes.oDownPayments)
  2. downPayInv.CardCode="C00001"
  3. downPayInv.DocDate=Now
  4. downPayInv.Lines.ItemCode="V00002"
  5. downPayInv.Lines.Price=1
  6. downPayInv.Lines.Quantity=3
  7. downPayInv.DownPaymentType=DownPaymentTypeEnum.dptInvoice
  8. lRetCode=downPayInv.Add()
  9. DimpayEntryAsInteger=0
  10. NstAddon.SBO_Company.GetLastError(i,s)
  11. Ifi<>0Then
  12. NstAddon.SBO_Application.MessageBox(i.ToString()&":"&s)
  13. Else
  14. payEntry=NstAddon.SBO_Company.GetNewObjectKey()
  15. NstAddon.SBO_Application.MessageBox(payEntry)
  16. EndIf
  17. downPayInv.GetByKey(payEntry)
  18. ''对预收款发票付款
  19. DimvPayAsSAPbobsCOM.Payments
  20. vPay=NstAddon.SBO_Company.GetBusinessObject(BoObjectTypes.oIncomingPayments)
  21. vPay.Invoices.DocEntry=payEntry
  22. vPay.Invoices.InvoiceType=BoRcptInvTypes.it_DownPayment
  23. vPay.Address="622-7"
  24. vPay.ApplyVAT=1
  25. vPay.CardCode="C00001"
  26. vPay.ContactPersonCode=2
  27. vPay.DocDate=Now
  28. vPay.DocRate=8
  29. vPay.DocTypte=SAPbobsCOM.BoRcptTypes.rCustomer
  30. vPay.JournalRemarks="TTTTT-"
  31. vPay.LocalCurrency=BoYesNoEnum.tYES
  32. vPay.TaxDate=Now
  33. vPay.TransferAccount="10010201"
  34. vPay.TransferDate=Now
  35. vPay.TransferSum=downPayInv.DocTotal
  36. vPay.Add()
  37. NstAddon.SBO_Company.GetLastError(i,s)
  38. Ifi<>0Then
  39. NstAddon.SBO_Application.MessageBox(i.ToString()&":"&s)
  40. Else
  41. NstAddon.SBO_Application.MessageBox(NstAddon.SBO_Company.GetNewObjectKey())
  42. EndIf

你可能感兴趣的:(BO)