Open pharmankur opened 3 weeks ago
@pharmankur good observation. Let me share the purpose behind this SQL script. To calculate Closing Balance of Ledger, one need to SUM trn_accounting[amount] column and add mst_ledger[opening_balance] to it. To simplify, I created this script which I had planned to run post import on automated basis. But later I realized this is unprofessional approach, since it increases burden of filtering rows excluding such rows for many other analytical requirements. So, I dropped this idea before even implementing it.
I have added SQL query (which can be created as View in the database), to solve this requirement. https://github.com/dhananjay1405/tally-database-loader/blob/main/reports/mssql/accounting-voucher-view.sql
So, this script and folder no longer needs to stay. Thanks for reminding me of clean-up activity which is overdue. You should see this entire folder along with script vanish away in the next code check-in.
With database field changes applied in V 1.0.31 ; the following query has become redundant. https://github.com/dhananjay1405/tally-database-loader/blob/main/post-import-scripts/opening-transaction.sql
Present fields in trn_voucher are ---> [ Fields in BOLD are missing fields from query ] guid,date,voucher_type,_vouchernumber,_referencenumber,_referencedate,narration,_partyname,_place_ofsupply,is_invoice,is_accounting_voucher,_is_inventoryvoucher,is_order_voucher
Present fields in trn_accounting are ---> [ Fields in BOLD are missing fields from query ] guid,ledger,amount,_amountforex,currency
Please update the script if to be used further and add some documentation about use of the query Also suggest, if this is really useful , make it as a standard while importing data. If the thing is not relevant anymore , discard it from code.