过账采购发票
Posted Farseer
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了过账采购发票相关的知识,希望对你有一定的参考价值。
大多数场景下,开票前一般都会跟供应商进行收货单的对账,准确无误后,根据协商的金额将所对账的采购订单开一个发票。
在PurchFormLetter中增加一个方法用于根据对账单明细生成对应的Parm表记录(AX2009)。
public void ERM_CreateParmByStatement(ERM_VendStatementTable _statementTable) { ERM_PurchTableInvoice purchTableInvoice; ERM_PurchInvoice purchInvoice; PurchLine purchLineLocal; ; ttsbegin; select firstonly purchTableInvoice where purchTableInvoice.StatementId == _statementTable.StatementId; select firstonly purchInvoice where purchInvoice.StatementId == _statementTable.StatementId; this.createParmUpdate(); purchParmUpdate.SpecQty = PurchUpdate::ReceiveNow; purchParmUpdate.SumBy = AccountOrder::Order; purchParmUpdate.SumNum = _statementTable.StatementId; purchParmUpdate.SumPurchId = purchTableInvoice.PurchId; purchParmUpdate.update(); while select purchTableInvoice where purchTableInvoice.StatementId == _statementTable.StatementId { //info(purchTableInvoice.PurchId); purchParmTable.clear(); purchParmTable.ParmId = purchParmUpdate.ParmId; purchParmTable.PurchId = purchTableInvoice.PurchId; purchParmTable.initFromPurchTable(PurchTable::find(purchParmTable.PurchId)); purchParmTable.Approved = NoYes::Yes; purchParmTable.Num = _statementTable.StatementId; purchParmTable.TransDate = purchInvoice.InvoiceDate; purchParmTable.insert(); while select purchLineLocal where purchLineLocal.PurchId == purchTableInvoice.PurchId { if(purchLineLocal.receivedInTotalServer()) { purchParmLine.clear(); purchParmLine.ParmId = purchParmTable.ParmId; purchParmLine.TableRefId = purchParmTable.TableRefId; purchParmLine.initFromPurchLine(purchLineLocal); purchParmLine.ReceiveNow = purchLineLocal.receivedInTotalServer(); purchParmLine.InventNow = purchLineLocal.receivedInventInTotal(); purchParmLine.RemainAfter = 0; purchParmLine.RemainAfterInvent = 0; purchParmLine.RemainBefore = purchParmLine.ReceiveNow; purchParmLine.RemainBeforeInvent = purchParmLine.InventNow; purchParmLine.LineAmount = purchParmLine.calcLineAmountForced(); purchParmLine.insert(); } } } this.initParameters(); this.editLinesChanged(false); this.reArrangeNow(true); this.validateAll(false); this.reArrange(true); this.validateAll(true); ttscommit; }
放在这里做备份。
以上是关于过账采购发票的主要内容,如果未能解决你的问题,请参考以下文章
sap中凭证已过账,生成财务凭证,发现有错,有啥办发可以冲销