Reporting the payments received against shipment’s C&F value.
In this example our client was facing an issue where shipments are made and C&F value amount is taken as Accounts Receivable, payments are received in 2 to 3 installments. Management wants to know how much is outstanding against each shipment C&F Invoice.
In database invoice is generated on C&F basis where comprehensive information is recorded like invoice no, Bill of Lading No, C&F Amount, Shipment NO and so on.
When Payments are received it is recorded exportpayments table along with shipment NO.
In order to create a report to what is outstanding against respective invoice we created a SQL Query using select into Transact-SQL as follows;
select sn1, sum(amt) as cfvl
into #sd4
from dbo.exportpayments
group by sn1
Select Sn, CFvlu,sn1, cfvl, Cfvlu-cfvl as balance from
dbo.invocesexpressions inner join #sd4 on
dbo.invocesexpressions.sn = #sd4.sn1
drop table #sd4
In the above example we selected Shipment NO SN1 and sum amount Sum(amt) as cfvlu
Into temp table SD4 and then we selected Shipment no SN, CFVLU from invoices table and CFVL from Temp table #SD4 and join Invoices table and #sd4 based on Shipment NO
At the end we dropped thetemp table #SD4.
This example utilized the temp table for generating outstanding payments report.
Shipmnt CFVLU Shpmnt Amnt RCD Blnc
|
311 |
672000 |
311 |
672000 |
0 |
|
315 |
48950 |
315 |
48950 |
0 |
|
316 |
62968.75 |
316 |
62969 |
-0.25 |
|
317 |
43775 |
317 |
42819 |
956 |
|
318 |
43775 |
318 |
43776 |
-1 |
|
325 |
48950 |
325 |
48950 |
0 |
|
326 |
48950 |
326 |
48950 |
0 |











[...] amount received and related information like average exchange rates and summary of all expenses. Please also read Post Published: 26 February 2010 Author: admin Found in section: Business Intelligence, [...]