The xls4Oracle FIFO package

The xls4Oracle Profit package enable you to do FIFO calculation on Oracle database objects.

After download and installation, you can do this:

declare
trx xls4Oracle_profit.TrxTab;
i number := 0;
begin
i := i + 1;
trx(i).qty := 100;
trx(i).price := 100;
trx(i).rate := 1;
i := i + 1;
trx(i).qty := 100;
trx(i).price := 101;
trx(i).rate := 1.1;
i := i + 1;
trx(i).qty := -100;
trx(i).price := 102;
trx(i).rate := 1.2;
i := i + 1;
trx(i).qty := -100;
trx(i).price := 103;
trx(i).rate := 1.3;
xls4Oracle_profit.fifo(trx,'Y');
end;
/

… and get this output:

-----------------------------------
xls4oracle_profit.fifo
-----------------------------------
execution date 29-jan-2014 16:55:43
page: 1
id                    qty        price             rate          balance       price_prof        rate_prof             prof
------------ ------------ ------------ ---------------- ---------------- ---------------- ---------------- ----------------
1                  100.00       100.00         1.000000        10,000.00
2                  100.00       101.00         1.100000        21,110.00
3                 -100.00       102.00         1.200000        11,110.00           220.00         2,020.00         2,240.00
4                 -100.00       103.00         1.300000             0.00           240.00         2,040.00         2,280.00
------------ ------------ ------------ ---------------- ---------------- ---------------- ---------------- ----------------
sum                                                                                460.00         4,060.00         4,520.00

The FIFO calculation is stored in a PLSQL table that enables you update the results into the database.

Pls. download the package and user guide her:

Download

 

[Download not found]

The package body is wrapped, if you need source code pls. contact using this mail:

info@xls4Oracle.com

 

Leave a Reply