Jump to content

Expenses per month


JHAir

Recommended Posts

Hello Again, let me put it that way

Since 2008 we had two AC, each 50000 per month - that means 100000 totally

un2.jpg

Now (in May) we bought a third one and added another 50000 per month - that means 150000 totally

un1.jpg

The problem is that effects all previous months too. Is there some kind a mistake in the phpVMS system or what is the problem?

EDIT:

Maybe there is something wrong with my database (phpvms_financedata)

It starts like:

Id 1  2  2009  :a:7:{s:5:"total";d:-88569;s:13:"totalexpenses";i:1...  l-88569

and ends like: (month number doesnt change until then)

Id 84  2  2009  a:7:{s:5:"total";d:-88569;s:13:"totalexpenses";i:1...  -88569

Id 85 3 2009 a:7:{s:5:"total";d:-13773;s:13:"totalexpenses";i:1... -13773

Id 86 4 2009 a:7:{s:5:"total";d:153219;s:13:"totalexpenses";i:1... 153219

Link to comment
Share on other sites

  • Administrators

Here how it's supposed to work -

In APRIL, you add an expense, for toilet paper, at 100$

It's still April, you change it, you view your report for April, it shows up as 100$

If you view March, for the FIRST TIME, it will save 100$, since that's the price when you're viewing it.

Now it MAY. You haven't viewed the April report yet in May, because it's the end of April, and you're adjusting your expense. So you change the toilet paper cost to 50$, since you're forcing your passengers to use pinecones, so you add another expense for pinecones, at $25.

Now, you go and view APRIL. It will save the current expenses you have

So March:

TP - 50$

April:

TP: 50$

Pinecones: 25$

May:

TP: 50$

Pinecones: 25$

Now June rolls around, you adjust again, so, TP for 100$, pinecones are 10$, and you view MAY to save May's expenses:

So March:

TP - 50$

April:

TP: 50$

Pinecones: 25$

May:

TP: 100$

Pinecones: 10$

Etc, etc, so-on and so forth. It's funky because PHP isn't perpetual, I can't keep a running tally unless I make some other changes which I'm contemplating on making.

So it seems like there's a bug with it picking up the expense per month. I'll check that out, since the financedata table looks like it's saving the correct data.

Thanks

Link to comment
Share on other sites

  • Administrators

Found a weird mistake.

In core/common/financedata.class.php, line 127 is commented out. That shouldn't be. If you uncomment it (remove the //), does it show up proper?

So change:

//$report = self::GetCachedFinanceData($monthstamp);

To:

$report = self::GetCachedFinanceData($monthstamp);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...