protected void createDliveryNoInvoiceData()
{
GeneralJournalEntry mGeneralJournalEntry;
GeneralJournalAccountEntry mGeneralJournalAccountEntry;
SubledgerVoucherGeneralJournalEntry mSubledgerVoucherGeneralJournalEntry;
VendPackingSlipJour mVendPackingSlipJour;
VendPackingSlipTrans mVendPackingSlipTrans;
while select mGeneralJournalAccountEntry
where mGeneralJournalAccountEntry.PostingType == LedgerPostingType::PurchPckSlpPurchaseOffsetAccount
join mGeneralJournalEntry
where (mGeneralJournalEntry.AccountingDate >= startDate && mGeneralJournalEntry.AccountingDate <= endDate)
&& mGeneralJournalEntry.RecId == mGeneralJournalAccountEntry.GeneralJournalEntry
join mSubledgerVoucherGeneralJournalEntry
where mSubledgerVoucherGeneralJournalEntry.GeneralJournalEntry == mGeneralJournalEntry.RecId
join mVendPackingSlipTrans
where mVendPackingSlipTrans.CostLedgerVoucher == mSubledgerVoucherGeneralJournalEntry.Voucher
&& mVendPackingSlipTrans.AccountingDate == mSubledgerVoucherGeneralJournalEntry.AccountingDate
&& mVendPackingSlipTrans.DataAreaId == mSubledgerVoucherGeneralJournalEntry.VoucherDataAreaId
join mVendPackingSlipJour
where mVendPackingSlipJour.RecId == mVendPackingSlipTrans.VendPackingSlipJour
&& (!vendAccount || mVendPackingSlipJour.OrderAccount == vendAccount)
{
tmpVendBalanceDetail.clear();
tmpVendBalanceDetail.VendAccount = mVendPackingSlipJour.OrderAccount;
tmpVendBalanceDetail.DeliveryNoInvoice = mGeneralJournalAccountEntry.AccountingCurrencyAmount;
tmpVendBalanceDetail.insert();
}
}
while select m_GeneralJournalAccountEntry
where m_GeneralJournalAccountEntry.PostingType == LedgerPostingType::PurchPckSlpPurchaseOffsetAccount //采购,应计
join m_GeneralJournalEntry
where m_GeneralJournalEntry.AccountingDate <= fromDate
&& m_GeneralJournalEntry.RecId == m_GeneralJournalAccountEntry.GeneralJournalEntry
join m_VendPackingSlipJour
where m_VendPackingSlipJour.DocumentDate == m_GeneralJournalEntry.DocumentDate
&& m_VendPackingSlipJour.PackingSlipId == m_GeneralJournalEntry.DocumentNumber
{
if(!m_VendPackingSlipJour.isCanceled())
{
m_TotalDliveryNoInvoiceAmountOpen += m_GeneralJournalAccountEntry.AccountingCurrencyAmount;
}
}
while select m_GeneralJournalAccountEntry
where m_GeneralJournalAccountEntry.PostingType == LedgerPostingType::PurchPckSlpPurchaseOffsetAccount //采购,应计
join m_GeneralJournalEntry
where m_GeneralJournalEntry.AccountingDate <= fromDate
&& m_GeneralJournalEntry.RecId == m_GeneralJournalAccountEntry.GeneralJournalEntry
join m_VendInvoiceJour
where m_VendInvoiceJour.DocumentDate == m_GeneralJournalEntry.DocumentDate
&& m_VendInvoiceJour.InvoiceId == m_GeneralJournalEntry.DocumentNumber
{
m_TotalDliveryNoInvoiceAmountOpen += m_GeneralJournalAccountEntry.AccountingCurrencyAmount;
}