Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

getting cash balance in oracle

$
0
0

hello

  • I need to realize an Accredited Expenditure Management System in website with Asp.net MVC4 technology and entity framework 5 with oracle database
  • the expenses are summarized in a slip that is established by a structure in an accounting period
  • the slips are stored in database
  • Each structure has a fund to extract the amount for expenses.

I must, every creation of slip:

       Determine and display by Calculation a cash balance (amount remaining in cash) for each slip after cash receipts and disbursements


The formula: Final balance = initial balance + sum of receipts - sum of disbursements

Such as:      initial balance: is the balance before disbursement and also is the final balance of previous slip
                 sum of disbursements: the sum of the debits of expenditure of this slip
                 sum of receipts: the sum of the repayments of the previous slips

  • i should keep history track of balance in each slip. true or false?
  • If true, should i create a balance entity and store the balance calculation result in table balance
  • or should i create view with query

                    

 CREATE OR REPLACE FORCE VIEW BALANCEVIEW
(
   sum of disbursements,
   sum of receipts,
   balance
   Date_slip,

)
AS

select sum(actu_slip.disbursements) as sum of disbursements,
        sum(priv_slip.disbursements) as sum of receipts,
        priv_slip.balance as balance_initial,
        priv_slip.balance + sum(actu_slip.disbursements)- sum(priv_slip.disbursements) as balance_final,
        actu_slip.date_slip


 from slip as actu_slip, --actual slip
      slip as priv_slip  --priviouse slip

 where actu_slip.slipID = priv_slip.ActualSlipId

But in this case, i don't know how to determine the initial balance since it is a calculated field
what do you me advice?


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>