[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15189] rental: invoice credits as separate job
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15189] rental: invoice credits as separate job |
Date: |
Mon, 23 May 2016 17:11:06 +0000 (UTC) |
Revision: 15189
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15189
Author: sigurdne
Date: 2016-05-23 17:11:05 +0000 (Mon, 23 May 2016)
Log Message:
-----------
rental: invoice credits as separate job
Modified Paths:
--------------
trunk/rental/inc/class.uibilling.inc.php
Modified: trunk/rental/inc/class.uibilling.inc.php
===================================================================
--- trunk/rental/inc/class.uibilling.inc.php 2016-05-23 14:15:23 UTC (rev
15188)
+++ trunk/rental/inc/class.uibilling.inc.php 2016-05-23 17:11:05 UTC (rev
15189)
@@ -1362,6 +1362,7 @@
{
phpgw::no_access();
}
+ rental_sobilling::get_instance()->transaction_begin();
$billing_job =
rental_sobilling::get_instance()->get_single((int)phpgw::get_var('id'));
$billing_job->set_deleted(true);
$result =
rental_sobilling::get_instance()->store($billing_job);
@@ -1384,7 +1385,8 @@
'contract_id' =>
$invoice->get_contract_id(), 'one_time' => true, 'include_billed' => true));
foreach ($price_items as $price_item)
{
- if ($price_item->get_date_start() >=
$invoice->get_timestamp_start() && $price_item->get_date_start() <=
$invoice->get_timestamp_end())
+ //Check for credit or valid date
+ if (($price_item->get_is_one_time() &&
$price_item->get_total_price() < 0) || ($price_item->get_date_start() >=
$invoice->get_timestamp_start() && $price_item->get_date_start() <=
$invoice->get_timestamp_end()))
{
$price_item->set_is_billed(false);
rental_socontract_price_item::get_instance()->store($price_item);
@@ -1393,6 +1395,7 @@
$invoice->set_serial_number(null);
rental_soinvoice::get_instance()->store($invoice);
}
+ rental_sobilling::get_instance()->transaction_commit();
if (phpgw::get_var('phpgw_return_as') == 'json')
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15189] rental: invoice credits as separate job,
sigurdne <=