12-09-2018, 11:26 PM,
|
|
TimSchofield
Tim Schofield
|
Posts: 1,318
Threads: 22
Joined: Mar 2015
|
|
RE: GL Balance Sheet Bad Hyperlink - SOLVED
Well a balance sheet is a report at a point in time rather than over a period, so there are 3 possibilities:
1 Just the period that the report is for, so a balance sheet up to December 2018 would just default to showing the transactions for December 2018 - Easiest to code, but perhaps least useful from an accountants point of view.
2 All transactions from the beginning of time. The account balance in a balance sheet account is made up of all transactions ever posted to that account, unlike P&L accounts which are just made up of transactions for that period. So if the balance on the account is 123456.78 then perhaps it is most obvious to show all the transactions that make up that balance - Easy enough to code, but could potentially produce a very big inquiry.
3 Just transactions for the financial period that the report period is in. So if it was a balance sheet up to 31/12/2018 and the financial year started on 1/4/2018 then it would just show the transactions for those 9 months - This is trickier to code and get right, and is a sort of compromise between 1 & 2.
It's not immediately obvious which of the above to choose, probably 3 is the best compromise as suggested by Paul. Remember that whatever is chosen here can be overridden on the inquiry screen.
Tim
|
|
12-09-2018, 11:49 PM,
(This post was last modified: 12-09-2018, 11:51 PM by VortecCPI.)
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: GL Balance Sheet Bad Hyperlink - SOLVED
I believe with the amount of data many uses may have #3 is likely the best starting place.
Perhaps this is why the hyperlink had no PeriodFrom in the first place?
Also... Thank you all so much for your help and feedback on these topics!
https://www.linkedin.com/in/eclipsepaulbecker
|
|
12-10-2018, 08:28 PM,
|
|
TimSchofield
Tim Schofield
|
Posts: 1,318
Threads: 22
Joined: Mar 2015
|
|
RE: GL Balance Sheet Bad Hyperlink - SOLVED
I have created the following function in MiscFunctions.php:
PHP Code: function FYStartPeriod($PeriodNumber) { $SQL = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $PeriodNumber . "'"; $Result = DB_query($SQL); $MyRow = DB_fetch_array($Result); $DateArray = explode('-', $MyRow['lastdate_in_period']); if ($DateArray[1] > $_SESSION['YearEnd']) { $DateStart = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, $_SESSION['YearEnd'] + 1, 1, $DateArray[0])); } else { $DateStart = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, $_SESSION['YearEnd'] + 1, 1, $DateArray[0] - 1)); } $StartPeriod = GetPeriod($DateStart); return $StartPeriod; }
and then the link becomes:
PHP Code: $ActEnquiryURL = '<a href="'. $RootPath . '/GLAccountInquiry.php?FromPeriod=' . urlencode(FYStartPeriod($_POST['BalancePeriodEnd'])) . '&ToPeriod=' . urlencode($_POST['BalancePeriodEnd']) . '&Account=' . urlencode($myrow['accountcode']) . '&Show=Yes">' . $myrow['accountcode'] . '</a>';
This appears to work OK in my tests.
Paul T: I have submitted a pull request.
Tim
|
|
12-10-2018, 10:32 PM,
|
|
VortecCPI
Paul Becker
|
Posts: 751
Threads: 211
Joined: Apr 2017
|
|
RE: GL Balance Sheet Bad Hyperlink - SOLVED?
Beautiful! Thank you so much Tim!
https://www.linkedin.com/in/eclipsepaulbecker
|
|
12-12-2018, 01:51 PM,
(This post was last modified: 12-12-2018, 02:11 PM by TurboPT.)
|
|
TurboPT
Administrator
|
Posts: 727
Threads: 10
Joined: Jun 2012
|
|
RE: GL Balance Sheet Bad Hyperlink - SOLVED?
Thanks, Tim. I'll create a pull on that this week too.
One thing I'll have to change, though, maybe *: Case difference uses of $pdf vs. $PDF.
Yet-another thing to try and align between the repo's, after the release, to have another less matter to deal with.
*...or I might 'clone' the last several lines of $pdf handling at the end of PDFStarter to have a $PDF as well, so that it can work both ways, and then slowly migrate the rest. At least doing this can save the trouble of $PDF case difference(s) for your changes. ... and makes for easier pulls too!
|
|
|