fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17151] Merge 17144:17150 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [17151] Merge 17144:17150 from trunk
Date: Thu, 12 Oct 2017 11:01:32 -0400 (EDT)

Revision: 17151
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17151
Author:   sigurdne
Date:     2017-10-12 11:01:32 -0400 (Thu, 12 Oct 2017)
Log Message:
-----------
Merge 17144:17150 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php
    branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js
    branches/Version-2_0-branch/helpdesk/templates/base/tts.xsl
    branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php
    branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
    branches/Version-2_0-branch/property/inc/class.uiinvoice.inc.php
    branches/Version-2_0-branch/property/inc/class.uitts.inc.php
    branches/Version-2_0-branch/property/js/portico/invoice.consume.js
    branches/Version-2_0-branch/property/setup/phpgw_no.lang

Property Changed:
----------------
    branches/Version-2_0-branch/

Index: branches/Version-2_0-branch
===================================================================
--- branches/Version-2_0-branch 2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch 2017-10-12 15:01:32 UTC (rev 17151)

Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
 /branches/dev-syncromind:13653
 /branches/dev-syncromind-2:14933-16846
 /branches/stavangerkommune:12743-12875,12986
-/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878,16880-16881,16883,16885,16887-16888,16890,16892,16894-16900,16902,16904,16906,16908-16909,16911-16916,16918-16919,16921,16923,16925,16927,16929-16930,16932,16934,16936-16937,16939-16942,16944,16946,16948,16950,16952-16953,16955-16959,16961,16963,16965-16970,16972,16974-16977,16979-16982,16984,16986,16988-16999,17001,17003,17005-17018,17020-17023,17025-17026,17028-17033,17035,17037,17039-17040,17042-17050,17052-17053,17055,17057-17058,17060,17062-17064,17066,17068-17074,17076-17088,17090,17092,17094,17096,17098,17100-17101,17103-17104,17106-17108,17110-17121,17123-17124,17126-17132,17134-17143
\ No newline at end of property
+/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335,15337-15352,15354,15356,15358,15360-15541,15543-15566,15568-15569,15571,15573-15581,15583,15585-15617,15619,15621-15630,15632-15635,15637-15639,15641-15643,15645,15647-15665,15667-15668,15670-15671,15673-15693,15695-15712,15714-15764,15766-15767,15769-15787,15789-15802,15804-15811,15813-15814,15816-15818,15820-15849,15851-15887,15889-15900,15902-16046,16048-16051,16053,16055,16057-16063,16065-16071,16073-16077,16079-16081,16083-16099,16101-16130,16132-16140,16142,16144-16212,16214-16219,16221,16223-16224,16226,16228-16229,16231,16233,16235,16237,16239-16240,16242,16244-16246,16248,16250-16251,16253-16255,16257-16259,16261,16263,16265,16267,16269-16276,16278,16280-16283,16285,16287-16288,16290,16292-16295,16297-16305,16307-16314,16316-16318,16320-16322,16324,16326-16330,16332,16334,16336,16338-16339,16341-16342,16344,16346,16348,16350,16352-16353,16355-16358,16360,16362,16364-16369,16371,16373,16375-16378,16380,16382-16383,16385,16387,16389,16391,16393-16395,16397,16399-16402,16404,16406,16408,16410-16415,16417,16419-16420,16422-16425,16427,16429-16440,16442,16444,16446,16448-16449,16451,16453,16455-16463,16465-16472,16474-16475,16477-16484,16486,16488,16490-16497,16499,16501-16503,16505-16512,16514-16517,16519,16521,16523,16525,16527-16532,16534,16536-16541,16543,16545-16554,16556,16558-16565,16567-16575,16577-16584,16586-16588,16590,16592-16593,16595-16596,16598,16600-16601,16603-16608,16610-16614,16616-16618,16620-16621,16623-16624,16626,16628,16630,16632-16638,16640,16642,16644,16646-16651,16653-16663,16665,16667,16669,16671,16673,16675,16677,16679-16680,16682,16684,16686,16688-16692,16694-16695,16697-16699,16701,16703,16705-16706,16708,16710,16712,16714,16716-16718,16720-16728,16730-16732,16734-16739,16741,16743-16746,16748-16750,16752-16755,16757,16759-16761,16763,16765,16767,16769-16774,16776,16778-16783,16785-16788,16790,16792,16794,16796-16802,16804-16807,16809,16811-16817,16819,16821-16825,16827-16831,16833,16835-16836,16838,16840-16844,16846-16847,16849,16851,16853-16854,16856-16859,16861,16863-16865,16867,16869-16871,16873,16875-16876,16878,16880-16881,16883,16885,16887-16888,16890,16892,16894-16900,16902,16904,16906,16908-16909,16911-16916,16918-16919,16921,16923,16925,16927,16929-16930,16932,16934,16936-16937,16939-16942,16944,16946,16948,16950,16952-16953,16955-16959,16961,16963,16965-16970,16972,16974-16977,16979-16982,16984,16986,16988-16999,17001,17003,17005-17018,17020-17023,17025-17026,17028-17033,17035,17037,17039-17040,17042-17050,17052-17053,17055,17057-17058,17060,17062-17064,17066,17068-17074,17076-17088,17090,17092,17094,17096,17098,17100-17101,17103-17104,17106-17108,17110-17121,17123-17124,17126-17132,17134-17143,17145-17150
\ No newline at end of property
Modified: branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php        
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/helpdesk/inc/class.sotts.inc.php        
2017-10-12 15:01:32 UTC (rev 17151)
@@ -349,8 +349,10 @@
                        if($query)
                        {
                                $query = $this->db->db_addslashes($query);
-                               $querymethod = " $where subject $this->like 
'%$query%'";
+                               $querymethod = " $where ( 
phpgw_helpdesk_tickets.id = " . (int) $query;
 
+                               $query = $this->db->db_addslashes($query);
+                               $querymethod .= " OR subject $this->like 
'%$query%')";
                        }
 
                        $sql = "SELECT DISTINCT phpgw_helpdesk_tickets.* , 
phpgw_helpdesk_views.id as view {$result_order_field} FROM 
phpgw_helpdesk_tickets"

Modified: branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js
===================================================================
--- branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js  2017-10-10 
12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/helpdesk/js/portico/tts.add.js  2017-10-12 
15:01:32 UTC (rev 17151)
@@ -87,7 +87,7 @@
        var image_data = canvas.toDataURL('image/png');
        $('#pasted_image').val(image_data);
        $('#pasted_image_is_blank').val(0);
-       confirm_session('apply');
+//     confirm_session('apply');
 }
 
 $(document).ready(function ()
@@ -189,7 +189,7 @@
                                                        
this.paste_createImage(source);
                                                }
                                        }
-                                       e.preventDefault();
+               //                      e.preventDefault();
                                }
                                else
                                {

Modified: branches/Version-2_0-branch/helpdesk/templates/base/tts.xsl
===================================================================
--- branches/Version-2_0-branch/helpdesk/templates/base/tts.xsl 2017-10-10 
12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/helpdesk/templates/base/tts.xsl 2017-10-12 
15:01:32 UTC (rev 17151)
@@ -665,34 +665,27 @@
                                        <div class="pure-control-group">
                                                <label>
                                                        <a 
href="javascript:notify_contact_lookup()" title="{$lang_contact_statustext}">
-                                                               <xsl:value-of 
select="php:function('lang', 'contact')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'add')"/>
                                                        </a>
                                                </label>
                                                <input type="hidden" 
id="notify_contact" name="notify_contact" value="">
                                                </input>
                                                <input type="hidden" 
name="notify_contact_name" value="" onClick="notify_contact_lookup();" 
readonly="readonly"/>
+                                               <div class="pure-u-md-1-2" >
+                                                       <xsl:for-each 
select="datatable_def">
+                                                               <xsl:if 
test="container = 'datatable-container_6'">
+                                                                       
<xsl:call-template name="table_setup">
+                                                                               
<xsl:with-param name="container" select ='container'/>
+                                                                               
<xsl:with-param name="requestUrl" select ='requestUrl'/>
+                                                                               
<xsl:with-param name="ColumnDefs" select ='ColumnDefs'/>
+                                                                               
<xsl:with-param name="data" select ='data'/>
+                                                                               
<xsl:with-param name="tabletools" select ='tabletools'/>
+                                                                               
<xsl:with-param name="config" select ='config'/>
+                                                                       
</xsl:call-template>
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </div>
                                        </div>
-                                       <div class="pure-control-group">
-                                               <label>
-                                                       <xsl:value-of 
select="php:function('lang', 'notify')"/>
-                                               </label>
-
-                                               <!--div id="paging_5"> </div>
-                                               <div class="pure-table" 
id="datatable-container_5"/>
-                                               <div 
id="datatable-buttons_5"/-->
-                                               <xsl:for-each 
select="datatable_def">
-                                                       <xsl:if test="container 
= 'datatable-container_6'">
-                                                               
<xsl:call-template name="table_setup">
-                                                                       
<xsl:with-param name="container" select ='container'/>
-                                                                       
<xsl:with-param name="requestUrl" select ='requestUrl'/>
-                                                                       
<xsl:with-param name="ColumnDefs" select ='ColumnDefs'/>
-                                                                       
<xsl:with-param name="data" select ='data'/>
-                                                                       
<xsl:with-param name="tabletools" select ='tabletools'/>
-                                                                       
<xsl:with-param name="config" select ='config'/>
-                                                               
</xsl:call-template>
-                                                       </xsl:if>
-                                               </xsl:for-each>
-                                       </div>
                                </fieldset>
                        </div>
                        <div id="history">
@@ -717,10 +710,10 @@
                        <input type="hidden" id="save" name="values[save]" 
value=""/>
                        <input type="button" class="pure-button 
pure-button-primary" name="save" onClick="confirm_session('save');">
                                <xsl:attribute name="value">
-                                       <xsl:value-of 
select="php:function('lang', 'save')"/>
+                                       <xsl:value-of 
select="php:function('lang', 'send')"/>
                                </xsl:attribute>
                                <xsl:attribute name="title">
-                                       <xsl:value-of 
select="php:function('lang', 'save the ticket')"/>
+                                       <xsl:value-of 
select="php:function('lang', 'send')"/>
                                </xsl:attribute>
                        </input>
                        <xsl:variable name="lang_done">
@@ -804,7 +797,7 @@
                                                <xsl:variable name="name">
                                                        <xsl:value-of 
select="name"/>
                                                </xsl:variable>
-                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" value="{$name}" 
onMouseout="window.status='';return true;">
+                                               <input type="submit" 
class="pure-button pure-button-primary" name="location" value="{$name}">
                                                        <xsl:attribute 
name="title">
                                                                <xsl:value-of 
select="lang_start_statustext"/>
                                                        </xsl:attribute>

Modified: branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php
===================================================================
--- branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php      
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/phpgwapi/inc/class.uicommon_jquery.inc.php      
2017-10-12 15:01:32 UTC (rev 17151)
@@ -382,7 +382,7 @@
                                'lengthmenu' => array('_' => 
json_encode($lengthmenu)),
                                'lengthmenu_allrows' => array('_' => 
json_encode(array(-1, lang('all')))),
                                'csv_download' => array('_' => 
json_encode(array(
-                                               'show_button' => 
!!$GLOBALS['phpgw_info']['user']['preferences']['common']['csv_download'],
+                                               'show_button' => 
empty($GLOBALS['phpgw_info']['user']['preferences']['common']['csv_download']) 
? false : true,
                                                'title'                 => 
lang('download visible data')
                                                )
                                        ))

Modified: branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php    
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/property/inc/class.soinvoice.inc.php    
2017-10-12 15:01:32 UTC (rev 17151)
@@ -675,6 +675,13 @@
                                $ecodimb = isset($data['ecodimb']) ? 
$data['ecodimb'] : '';
                        }
 
+                       $this->db->query('SELECT id, percent FROM fm_ecomva', 
__LINE__, __FILE__);
+                       $tax_codes = array(0 => 0);
+                       while ($this->db->next_record())
+                       {
+                               $tax_codes[$this->db->f('id')] = 
$this->db->f('percent');
+                       }
+
                        $where = 'AND';
 
                        if ($b_account_class)
@@ -738,12 +745,12 @@
                        $start_periode = date('Ym', $start_date);
                        $end_periode = date('Ym', $end_date);
 
-                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
+                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume, mvakode as tax_code {$select_account_class}"
                                . " FROM  fm_ecobilagoverf {$this->join} 
fm_location1 ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
                                . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id) "
                                . " {$this->join} fm_b_account ON 
(fm_ecobilagoverf.spbudact_code = fm_b_account.id) "
                                . " WHERE (periode >='{$start_periode}' AND 
periode <= '{$end_periode}' {$filtermethod})"
-                               . " GROUP BY district_id,periode 
$group_account_class"
+                               . " GROUP BY district_id,periode,mvakode 
$group_account_class"
                                . " ORDER BY periode";
                        //echo $sql;
 
@@ -750,44 +757,139 @@
                        $this->db->query($sql, __LINE__, __FILE__);
                        $this->total_records = $this->db->num_rows();
 
-                       $consume = array();
+                       $_consume = array();
 
                        while ($this->db->next_record())
                        {
-                               $consume[] = array
-                                       (
-                                       'consume' => 
round($this->db->f('consume')),
-                                       'period' => $this->db->f('periode'),
-                                       'district_id' => 
$this->db->f('district_id'),
-                                       'account_class' => $b_account_class ? 
$b_account_class : $this->db->f('b_account_class'),
+                               $consume = $this->db->f('consume');
+                               $period = (int)$this->db->f('periode');
+                               $district_id = (int)$this->db->f('district_id');
+                               $account_class = $b_account_class ? 
$b_account_class : $this->db->f('b_account_class');
+                               $tax_code       = (int)$this->db->f('tax_code');
+                               $refund = $consume - ($consume / (1 + 
($tax_codes[$tax_code] / 100)));
+
+                               $_consume[$tax_code][] = array(
+                                       'consume' => $consume,
+                                       'refund'        => $refund,
+                                       'period' => $period,
+                                       'district_id' => $district_id,
+                                       'account_class' => $account_class,
+                                       );
+                       }
+
+                       $map = array();
+                       foreach ($_consume as $_tax_code => $entry)
+                       {
+                               $account_class = $entry[0]['account_class'];
+                               $district_id = $entry[0]['district_id'];
+                               $period = $entry[0]['period'];
+                               $_consume = 0;
+                               $_refund = 0;
+
+                               foreach ($entry as $values)
+                               {
+                                       if($account_class != 
$values['account_class'] && $account_class != $values['district_id'] && 
$account_class != $values['period'] )
+                                       {
+                                               continue;
+                                       }
+                                       $_consume += $values['consume'];
+                                       $_refund += $values['refund'];
+                               }
+
+                               
$map["{$entry[0]['account_class']}_{$entry[0]['district_id']}_{$entry[0]['period']}"]
 = array(
+                                       'consume' => round($_consume),
+                                       'refund' => round($_refund),
+                                       'period' => $entry[0]['period'],
+                                       'district_id' => 
$entry[0]['district_id'],
+                                       'account_class' => 
$entry[0]['account_class'],
                                        'paid' => 'x'
                                );
                        }
 
-                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume {$select_account_class}"
+                       $__consume = array();
+                       foreach ($map as $key => $value)
+                       {
+                               $__consume[] = $value;
+                       }
+
+                       $sql = "SELECT district_id,periode,sum(godkjentbelop) 
as consume, mvakode as tax_code {$select_account_class}"
                                . " FROM  fm_ecobilag {$this->join} 
fm_location1 ON (fm_ecobilag.loc1 = fm_location1.loc1) "
                                . " {$this->join} fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.id) "
                                . " {$this->join} fm_b_account ON 
(fm_ecobilag.spbudact_code = fm_b_account.id) "
                                . " WHERE (1=1 {$filtermethod})"
-                               . " GROUP BY district_id,periode 
$group_account_class"
+                               . " GROUP BY district_id,periode,mvakode 
$group_account_class"
                                . " ORDER BY periode";
 
                        $this->db->query($sql, __LINE__, __FILE__);
                        $this->total_records += $this->db->num_rows();
 
+                       $_consume = array();
+
                        while ($this->db->next_record())
                        {
-                               $consume[] = array
-                                       (
-                                       'consume' => 
round($this->db->f('consume')),
-                                       'period' => $this->db->f('periode'),
-                                       'district_id' => 
$this->db->f('district_id'),
-                                       'account_class' => $b_account_class ? 
$b_account_class : $this->db->f('b_account_class'),
+                               $consume = $this->db->f('consume');
+                               $period = (int)$this->db->f('periode');
+                               $district_id = (int)$this->db->f('district_id');
+                               $account_class = $b_account_class ? 
$b_account_class : $this->db->f('b_account_class');
+                               $tax_code       = (int)$this->db->f('tax_code');
+                               $refund = $consume - ($consume / (1 + 
($tax_codes[$tax_code] / 100)));
+
+                               $_consume[$tax_code][] = array(
+                                       'consume' => $consume,
+                                       'refund'        => $refund,
+                                       'period' => $period,
+                                       'district_id' => $district_id,
+                                       'account_class' => $account_class,
+                                       );
+                       }
+
+                       $map = array();
+                       foreach ($_consume as $_tax_code => $entry)
+                       {
+                               $account_class = $entry[0]['account_class'];
+                               $district_id = $entry[0]['district_id'];
+                               $period = $entry[0]['period'];
+                               $_consume = 0;
+                               $_refund = 0;
+
+                               foreach ($entry as $values)
+                               {
+                                       if($account_class != 
$values['account_class'] && $account_class != $values['district_id'] && 
$account_class != $values['period'] )
+                                       {
+                                               continue;
+                                       }
+                                       $_consume += $values['consume'];
+                                       $_refund += $values['refund'];
+                               }
+
+                               
$map["{$entry[0]['account_class']}_{$entry[0]['district_id']}_{$entry[0]['period']}"]
 = array(
+                                       'consume' => round($_consume),
+                                       'refund' => round($_refund),
+                                       'period' => $entry[0]['period'],
+                                       'district_id' => 
$entry[0]['district_id'],
+                                       'account_class' => 
$entry[0]['account_class'],
                                        'paid' => ''
                                );
                        }
 
-                       return $consume;
+                       foreach ($map as $key => $value)
+                       {
+                               $__consume[] = $value;
+                       }
+
+//                     while ($this->db->next_record())
+//                     {
+//                             $consume[] = array
+//                                     (
+//                                     'consume' => 
round($this->db->f('consume')),
+//                                     'period' => $this->db->f('periode'),
+//                                     'district_id' => 
$this->db->f('district_id'),
+//                                     'account_class' => $b_account_class ? 
$b_account_class : $this->db->f('b_account_class'),
+//                                     'paid' => ''
+//                             );
+//                     }
+//
+                       return $__consume;
                }
 
                function check_for_updates( $values )

Modified: branches/Version-2_0-branch/property/inc/class.uiinvoice.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uiinvoice.inc.php    
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/property/inc/class.uiinvoice.inc.php    
2017-10-12 15:01:32 UTC (rev 17151)
@@ -2097,9 +2097,11 @@
                        $content = $this->bo->read_consume($start_date, 
$end_date, $vendor_id, $loc1, $workorder_id, $b_account_class, $district_id, 
$ecodimb);
 
                        $sum = 0;
+                       $sum_refund = 0;
                        foreach ($content as &$entry)
                        {
                                $sum = $sum + $entry['consume'];
+                               $sum_refund = $sum_refund + $entry['refund'];
                                $entry['link_voucher'] = 
urldecode($GLOBALS['phpgw']->link('/index.php', array
                                                (
                                                'menuaction' => 
'property.uiinvoice.index',
@@ -2112,6 +2114,7 @@
                                                )
                                ));
                                $entry['consume'] = 
number_format($entry['consume'], 0, ',', ' ');
+                               $entry['refund'] = 
number_format($entry['refund'], 0, ',', ' ');
                        }
 
                        $result_data = array('results' => $content);
@@ -2118,6 +2121,7 @@
                        $result_data['total_records'] = count($content);
                        $result_data['draw'] = $draw;
                        $result_data['sum'] = number_format($sum, 0, ',', ' ');
+                       $result_data['sum_refund'] = number_format($sum_refund, 
0, ',', ' ');
 
                        return $this->jquery_results($result_data);
                }
@@ -2487,14 +2491,14 @@
 
                        $uicols = array
                                (
-                               'input_type' => array('varchar', 'varchar', 
'varchar', 'link', 'varchar'),
-                               'type' => array('text', 'text', 'text', 'url', 
'text'),
-                               'col_name' => array('district_id', 'period', 
'account_class', 'consume', 'paid'),
-                               'name' => array('district_id', 'period', 
'account_class', 'consume', 'paid'),
-                               'formatter' => array('', '', '', 
'formatLinkIndexInvoice', ''),
+                               'input_type' => array('varchar', 'varchar', 
'varchar', 'link', 'varchar', 'varchar'),
+                               'type' => array('text', 'text', 'text', 'url', 
'text', 'text'),
+                               'col_name' => array('district_id', 'period', 
'account_class', 'consume','refund', 'paid'),
+                               'name' => array('district_id', 'period', 
'account_class', 'consume','refund', 'paid'),
+                               'formatter' => array('', '', '', 
'formatLinkIndexInvoice', '', ''),
                                'descr' => array(lang('District'), 
lang('Period'), lang('Budget account'),
-                                       lang('Consume'), lang('paid')),
-                               'className' => array('center', 'center', 
'center', 'right', 'center')
+                                       lang('Consume'),lang('refund'), 
lang('paid')),
+                               'className' => array('center', 'center', 
'center', 'right', 'right', 'center')
                        );
 
                        $count_uicols_name = count($uicols['name']);

Modified: branches/Version-2_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/property/inc/class.uitts.inc.php        
2017-10-12 15:01:32 UTC (rev 17151)
@@ -722,7 +722,49 @@
                                'list' => $values_combo_box[3]
                        );
 
+                       $values_combo_box[1] = 
$this->bocommon->select_district_list('filter', $this->district_id);
+                       $default_value = array('id' => '', 'name' => lang('no 
district'));
+                       array_unshift($values_combo_box[1], $default_value);
+                       $link = self::link(array(
+                                       'menuaction' => 
'property.uilocation.get_part_of_town',
+                                       'district_id' => $this->district_id,
+                                       'part_of_town_id' => 
$this->part_of_town_id,
+                                       'phpgw_return_as' => 'json'
+                       ));
+
+                       $code = '
+                               var link = "' . $link . '";
+                               var data = {"district_id": $(this).val()};
+                               execute_ajax(link,
+                                       function(result){
+                                               var $el = $("#part_of_town_id");
+                                               $el.empty();
+                                               $.each(result, function(key, 
value) {
+                                                 
$el.append($("<option></option>").attr("value", value.id).text(value.name));
+                                               });
+                                       }, data, "GET", "json"
+                               );
+                               ';
+
+                       $combos[] = array('type' => 'filter',
+                               'name' => 'district_id',
+                               'extra' => $code,
+                               'text' => lang('district'),
+                               'list' => $values_combo_box[1]
+                       );
+
+                       $values_combo_box[2] = 
$this->bocommon->select_part_of_town('filter', $this->part_of_town_id, 
$this->district_id);
+                       $default_value = array('id' => '', 'name' => lang('no 
part of town'));
+                       array_unshift($values_combo_box[2], $default_value);
+                       $combos[] = array('type' => 'filter',
+                               'name' => 'part_of_town_id',
+                               'extra' => '',
+                               'text' => lang('part of town'),
+                               'list' => $values_combo_box[2]
+                       );
+
                        $values_combo_box[5] = array(); //reported by
+
                        if(!$this->simple)
                        {
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format' => 'filter',
@@ -743,47 +785,6 @@
                                        'list' => $_categories
                                );
 
-                               $values_combo_box[1] = 
$this->bocommon->select_district_list('filter', $this->district_id);
-                               $default_value = array('id' => '', 'name' => 
lang('no district'));
-                               array_unshift($values_combo_box[1], 
$default_value);
-                               $link = self::link(array(
-                                               'menuaction' => 
'property.uilocation.get_part_of_town',
-                                               'district_id' => 
$this->district_id,
-                                               'part_of_town_id' => 
$this->part_of_town_id,
-                                               'phpgw_return_as' => 'json'
-                               ));
-
-                               $code = '
-                                       var link = "' . $link . '";
-                                       var data = {"district_id": 
$(this).val()};
-                                       execute_ajax(link,
-                                               function(result){
-                                                       var $el = 
$("#part_of_town_id");
-                                                       $el.empty();
-                                                       $.each(result, 
function(key, value) {
-                                                         
$el.append($("<option></option>").attr("value", value.id).text(value.name));
-                                                       });
-                                               }, data, "GET", "json"
-                                       );
-                                       ';
-
-                               $combos[] = array('type' => 'filter',
-                                       'name' => 'district_id',
-                                       'extra' => $code,
-                                       'text' => lang('district'),
-                                       'list' => $values_combo_box[1]
-                               );
-
-                               $values_combo_box[2] = 
$this->bocommon->select_part_of_town('filter', $this->part_of_town_id, 
$this->district_id);
-                               $default_value = array('id' => '', 'name' => 
lang('no part of town'));
-                               array_unshift($values_combo_box[2], 
$default_value);
-                               $combos[] = array('type' => 'filter',
-                                       'name' => 'part_of_town_id',
-                                       'extra' => '',
-                                       'text' => lang('part of town'),
-                                       'list' => $values_combo_box[2]
-                               );
-
                                $values_combo_box[4] = 
$this->_get_user_list($this->user_id);
 
                                $filter_tts_assigned_to_me = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_assigned_to_me'];

Modified: branches/Version-2_0-branch/property/js/portico/invoice.consume.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/invoice.consume.js  
2017-10-10 12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/property/js/portico/invoice.consume.js  
2017-10-12 15:01:32 UTC (rev 17151)
@@ -19,6 +19,12 @@
                                        nCells[i].innerHTML = data.sum;
                                }
                                break;
+                       case 'refund':
+                               if (typeof (nCells[i]) !== 'undefined')
+                               {
+                                       nCells[i].innerHTML = data.sum_refund;
+                               }
+                               break;
                }
        }
 };
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/property/setup/phpgw_no.lang    2017-10-10 
12:16:43 UTC (rev 17150)
+++ branches/Version-2_0-branch/property/setup/phpgw_no.lang    2017-10-12 
15:01:32 UTC (rev 17151)
@@ -2241,4 +2241,5 @@
 clear contact  property        no      Fjern kontakperson
 deadline for start     property        no      Frist for oppstart
 deadline for execution property        no      Frist for ferdigstillelse
-outside contract       property        no      Utenfor rammeavtale
\ No newline at end of file
+outside contract       property        no      Utenfor rammeavtale
+refund property        no      Refusjon
\ No newline at end of file




reply via email to

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