fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9484] property: invoice: period list based on curren


From: Sigurd Nes
Subject: [Fmsystem-commits] [9484] property: invoice: period list based on current date
Date: Sat, 02 Jun 2012 18:38:12 +0000

Revision: 9484
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9484
Author:   sigurdne
Date:     2012-06-02 18:38:11 +0000 (Sat, 02 Jun 2012)
Log Message:
-----------
property: invoice: period list based on current date

Modified Paths:
--------------
    trunk/property/inc/class.boinvoice.inc.php
    trunk/property/inc/class.soadmin_entity.inc.php
    trunk/property/inc/class.uiinvoice2.inc.php

Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php  2012-06-01 14:01:43 UTC (rev 
9483)
+++ trunk/property/inc/class.boinvoice.inc.php  2012-06-02 18:38:11 UTC (rev 
9484)
@@ -248,9 +248,18 @@
 
                function period_list($selected='')
                {
-                       $year = date('Y');
+                       $time = time();
+
+                       if ( date('j',$time) < 7 ) //Day of the month without 
leading zeros
+                       {
+                               $time = $time - (7 * 24 * 3600);
+                       }
+                       
+                       $month = date('n', $time);
+                       $year = date('Y',$time);
+                       $check_year = true;
                        $period_list = array();
-                       for ($i=1; $i<=12; $i++)
+                       for ($i=$month; $i<=12; $i++)
                        {
                                $period = sprintf("%s%02d",$year,$i);
                                $period_list[] = array
@@ -258,6 +267,13 @@
                                        'id'    => $period,
                                        'name'  => $period
                                );
+
+                               if($check_year = true && $year != date('Y'))
+                               {
+                                       $i = 0;
+                                       $year++;
+                                       $check_year = false;
+                               }
                        }
                        foreach ($period_list as &$_period)
                        {

Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php     2012-06-01 14:01:43 UTC 
(rev 9483)
+++ trunk/property/inc/class.soadmin_entity.inc.php     2012-06-02 18:38:11 UTC 
(rev 9484)
@@ -1053,7 +1053,7 @@
                 */
                function convert_to_eav()
                {
-                       die('vent litt med denne');
+//                     die('vent litt med denne');
 
                        phpgw::import_class('phpgwapi.xmlhelper');              
        
                        $this->type = 'entity';

Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-06-01 14:01:43 UTC (rev 
9483)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-06-02 18:38:11 UTC (rev 
9484)
@@ -495,10 +495,10 @@
                        $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id('property', 
'.invoice'));
                        $baseurl_invoice = 
isset($custom_config->config_data['common']['baseurl_invoice']) && 
$custom_config->config_data['common']['baseurl_invoice'] ? 
$custom_config->config_data['common']['baseurl_invoice'] : '';
 
-                       $_last_period_last_year = (string)(date('Y') -1) . '12';
+//                     $_last_period_last_year = (string)(date('Y') -1) . '12';
                        $period_list = $this->bo->period_list();
                        $periodization_start_list = $period_list;
-                       array_unshift($period_list,array ('id'=> 
$_last_period_last_year,'name'=> $_last_period_last_year));
+//                     array_unshift($period_list,array ('id'=> 
$_last_period_last_year,'name'=> $_last_period_last_year));
 
                        $period_list = 
$this->bocommon->select_list(isset($voucher[0]['period']) ? 
$voucher[0]['period'] : '', $period_list);
                        $periodization_start_list = 
$this->bocommon->select_list(isset($voucher[0]['period']) ? 
$voucher[0]['period'] : '', $periodization_start_list);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]