private void deleteVouchers()
{
SubledgerVoucherGeneralJournalEntry objSubledgerVoucherGeneralJournalEntry;
GeneralJournalEntry objGeneralJournalEntry;
GeneralJournalAccountEntry objGeneralJournalAccountEntry;
SubledgerJournalAccountEntry objSubledgerJournalAccountEntry;
LedgerJournalTable ledgerjouranlTable;
LedgerJournalTrans LedgerJournalTrans;
LedgerJournalId journalNum;
;
ttsBegin;
journalNum ='000521_010';
while select LedgerJournalTrans
where LedgerJournalTrans.JournalNum ==journalNum
{
while select forUpdate objSubledgerVoucherGeneralJournalEntry
Where objSubledgerVoucherGeneralJournalEntry.Voucher == LedgerJournalTrans.Voucher
// || objSubledgerVoucherGeneralJournalEntry.Voucher == objVendPackingSlipVersion.CostLedgerVoucher
{
while select forUpdate objGeneralJournalEntry
Where objGeneralJournalEntry.RecId == objSubledgerVoucherGeneralJournalEntry.GeneralJournalEntry
{
while select forUpdate objGeneralJournalAccountEntry
Where objGeneralJournalAccountEntry.GeneralJournalEntry == objGeneralJournalEntry.RecId
{
while select forUpdate objSubledgerJournalAccountEntry
Where objSubledgerJournalAccountEntry.RecId == objGeneralJournalAccountEntry.GeneralJournalEntry
{
objSubledgerJournalAccountEntry.delete();
}
objGeneralJournalAccountEntry.delete();
}
objGeneralJournalEntry.delete();
}
objSubledgerVoucherGeneralJournalEntry.delete();
}
}
while select forUpdate ledgerjouranlTable where
ledgerjouranlTable.JournalNum==journalNum
{
while select forUpdate LedgerJournalTrans where
LedgerJournalTrans.JournalNum==ledgerjouranlTable.JournalNum
{
LedgerJournalTrans.delete();
}
ledgerjouranlTable.delete();
}