[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15826] budget handling
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15826] budget handling |
Date: |
Thu, 13 Oct 2016 18:05:10 +0000 (UTC) |
Revision: 15826
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15826
Author: sigurdne
Date: 2016-10-13 18:05:10 +0000 (Thu, 13 Oct 2016)
Log Message:
-----------
budget handling
Modified Paths:
--------------
trunk/property/inc/class.soproject.inc.php
trunk/property/inc/cron/default/reset_workorder_cached_budget.php
Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php 2016-10-13 18:03:49 UTC (rev
15825)
+++ trunk/property/inc/class.soproject.inc.php 2016-10-13 18:05:10 UTC (rev
15826)
@@ -1116,8 +1116,15 @@
// $_taxfactor = 1 +
($_taxcode[(int)$this->db->f('mvakode')]/100);
// $_actual_cost =
round($actual_cost/$_taxfactor);
- $_diff_start = abs($entry['budget']) > 0 ?
$entry['budget'] : $entry['combined_cost'];
- $entry['diff'] = $_diff_start -
$entry['obligation'] - $entry['actual_cost'];
+ if($entry['closed'])
+ {
+ $entry['diff'] = 0;
+ }
+ else
+ {
+ $_diff_start = abs($entry['budget']) >
0 ? $entry['budget'] : $entry['combined_cost'];
+ $entry['diff'] = $_diff_start -
$entry['obligation'] - $entry['actual_cost'];
+ }
}
return $values;
@@ -2382,7 +2389,7 @@
$budget_acc = 0;
}
- if (abs($entry['actual_cost']) > 0)
+ if (abs($entry['actual_cost']) > 0 ||
$entry['period'] < date('Ym'))
{
$_diff_start = abs($entry['budget']) >
0 ? $entry['budget'] : $entry['sum_orders'];
$entry['diff'] = $_diff_start -
$entry['sum_oblications'] - $entry['actual_cost'];
Modified: trunk/property/inc/cron/default/reset_workorder_cached_budget.php
===================================================================
--- trunk/property/inc/cron/default/reset_workorder_cached_budget.php
2016-10-13 18:03:49 UTC (rev 15825)
+++ trunk/property/inc/cron/default/reset_workorder_cached_budget.php
2016-10-13 18:05:10 UTC (rev 15826)
@@ -65,6 +65,9 @@
execMethod('property.soworkorder.get_budget',
$order_id);
}
+ $sql = "UPDATE fm_project_budget SET closed = 1 WHERE
year =" . date('Y') . ' AND ( month > 0 AND month <= ' . date('n') . ')';
+ $this->db->query($sql, __LINE__, __FILE__);
+
$count_orders = count($orders);
$this->receipt['message'][] = array('msg' =>
"Rekalkulert budsjett for {$count_orders} løpende bestillinger");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15826] budget handling,
sigurdne <=