Bibek Shrestha
07/15/2024, 10:43 PMBibek Shrestha
07/15/2024, 10:44 PMselect
billcredit.id billcreditid,
billcredit.foreignTotal,
vendbill.id billid
from
transaction billcredit
join
PreviousTransactionLink link ON billcredit.id = link.nextdoc
join
transaction vendbill ON vendbill.id=link.previousDoc
where
vendbill.id in (160135,160236)
Bibek Shrestha
07/15/2024, 10:45 PMAppliedCreditTransactionLineLink
table but it seems it only provides data for fully paid bills. I need it for open and partially paid bills.
TIAmichoel
07/16/2024, 12:04 AMBibek Shrestha
07/16/2024, 12:48 PMPayment
conditionBibek Shrestha
07/16/2024, 1:28 PMSELECT
BillCredit.ID bill_credit_id,
BillCredit.ForeignTotal bill_credit_total,
NTLL.ForeignAmount bill_credit_applied_to_bill,
Bill.ID bill_id,
FROM
NextTransactionLineLink AS NTLL
INNER JOIN Transaction AS BillCredit
ON BillCredit.ID = NTLL.NextDoc
INNER JOIN Transaction AS Bill
ON NTLL.PreviousDoc = Bill.ID
WHERE
BillCredit.type = 'VendCred' AND
NTLL.PreviousDoc in (160135,160236)