prashants / webzash

Easy to use web based double entry accounting software in PHP - MySQL under MIT License
http://webzash.org
Other
208 stars 109 forks source link

Cash Flow Statement #85

Closed FarrahZakir closed 7 years ago

FarrahZakir commented 7 years ago

Hi Prashant,

Many thanks for such a great yet simple and easy to use accounting software!

I was wondering if it is possible to edit the Webzash and add a Cash Flow Statement in the Reports section ? If it is possible then could you please guide me which files need to be edited ?

prashants commented 7 years ago

Yes you can definitely add cash flow statement. Do you know cakephp / php ?

FarrahZakir commented 7 years ago

Thank you for replying!

Yes I know PHP but I am new to CakePHP and MVC and so far I have created a new table cashflow in MySQL. The new table contains 'group_id' and 'ledger_id' from ledgers table and 'entryitems_amount' and 'entryitems_dc' from entryitems table (I added index on these two columns for foreign keys). Now I don't know where/how to do the calculations(in 'ReportsController' or new model 'Reports' ?) like the select and where query and the calculations to save and be able to use the values as accounts receivables etc. in View->Reports->cashflow.ctp

Thank you once again and kindly guide me a bit.

prashants commented 7 years ago

I assume you want to calculate ledger balance ?

Most calculations are done in models / library files.

FarrahZakir commented 7 years ago

Yes you are right. I would need

  1. Accounts Receivable
  2. Accounts Payable
  3. Prepaid Expenses+Labor Guaranty+Refundable Deposits
  4. PDC Issued
  5. Fixed Assets The only value available from the balance sheet to be used in cashflow statement is the 'Net Income'.
prashants commented 7 years ago

https://github.com/prashants/webzash/blob/master/Model/Ledger.php#L322

https://github.com/prashants/webzash/blob/master/Lib/AccountList.php

https://github.com/prashants/webzash/blob/master/Lib/LedgerTree.php

FarrahZakir commented 7 years ago

Ok now I think I have some idea of the values around different files! Thank you SO much!!

I will let you know if I succeed :D

FarrahZakir commented 7 years ago

Hey Prashant,

Thank you very much for guiding me so well that I finally added the cashflow statement with all its functionality but now the new thing is that its new year! So could you please guide me about how to add calendar for 2017 and all the years coming ?! And why/how it was for 2016 only ?!

prashants commented 7 years ago

Sorry I didnt get what exactly do you want to do ?

FarrahZakir commented 7 years ago

I meant that the financial year on the dashboard and everywhere else is set to 2016 only. How to add more years like this 2017 or 2018 etc ? Like if you want data from one financial year out of many then ?

I have modified the jquery and the calendar is open now instead of dropdown so date can be selected but what about financial year ?

prashants commented 7 years ago

Financial data for every year is stored in a separate database. If you want to put everything in one database then you can use database prefix option.

FarrahZakir commented 7 years ago

Ok so you mean when 2016 is done, the database is done and now I will need a new database to start with new year's data OR I can use the same database but new/different tables now for data processing using some prefix ? In the code or the database table ? and where exactly in any chosen case ?

prashants commented 7 years ago

Yes. When you c/f or create a new account there is a option to use a database prefix.

FarrahZakir commented 7 years ago

Ok MANY thanks again for THIS much help ! I have got your point and will try to take the amount at the bottom of the profit and loss statement and fill it in the new year's 'capital account' value manually in new database to start new year and do the c/f.

I will again update here in case of success or failure :P so that people benefit from this all too.

FarrahZakir commented 7 years ago

Hi,

I have now got the financial year set to 2017, data saving in the same database with prefix and everything is working fine but is it possible to have dropdown for 2016 as well along with this 2017 so that we can see data from whatever period of time ?

I tried changing the .js file but it changes calendar only in the accounts settings but not in the statements! How to do so for the statements' dropdown calendars ?

FarrahZakir commented 7 years ago

Ok, so the data is shown from the current financial year only (since it is in new database/tables) no matter which date you select from the last year (which I did by manually entering dates and got 0 for all fields obviously).

Now the question is that how to let the user manually choose which year they want to run in when they log into the 'Accounts' section (where it automatically selects the current 'active' account) ? I change the active account from the SQLite database by changing id at the moment.

prashants commented 7 years ago

Yes you can reset the session value for accounts id to select a different database.

FarrahZakir commented 7 years ago

Dear Prashant,

I don't have enough words to thank you and let you know how helpful you have been throughout this all.

I have finally modified your software according to my needs, so well done for teaching me so well and doing such a helpful software !!

ahmedali5530 commented 5 years ago

@FarrahZakir can you share the code for Cash flow statement?