fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8174] voucher handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [8174] voucher handling
Date: Wed, 23 Nov 2011 13:03:38 +0000

Revision: 8174
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8174
Author:   sigurdne
Date:     2011-11-23 13:03:38 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
voucher handling

Modified Paths:
--------------
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice.inc.php
    trunk/property/inc/export/default/Basware_X114
    trunk/property/js/yahoo/invoice.index.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/inc/class.menu.inc.php       2011-11-23 13:03:38 UTC (rev 
8174)
@@ -190,6 +190,11 @@
                                                        'text'  => 
lang('Accounting dim d'),
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'dimd') )
                                                ),
+                                               'periodization' => array
+                                               (
+                                                       'text'  => 
lang('periodization'),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'periodization') )
+                                               ),
                                                'accounting_tax'        => array
                                                (
                                                        'text'  => 
lang('Accounting tax'),

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/inc/class.sogeneric.inc.php  2011-11-23 13:03:38 UTC (rev 
8174)
@@ -464,6 +464,28 @@
                                                'menu_selection' => 
'admin::property::accounting::accounting_dimd'
                                        );
                                break;
+                       case 'periodization':
+                               $info = array
+                                       (
+                                               'table' => 
'fm_eco_periodization',
+                                               'id'                            
=> array('name' => 'id', 'type' => 'int'),
+                                               'fields'                        
=> array
+                                               (
+                                                       array
+                                                       (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg'      => lang('edit'),
+                                               'add_msg'       => lang('add'),
+                                               'name'          => 
lang('periodization'),
+                                               'acl_app'                       
=> 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::periodization'
+                                       );
+                               break;
                        case 'tax':
                                $info = array
                                        (

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/inc/class.soinvoice.inc.php  2011-11-23 13:03:38 UTC (rev 
8174)
@@ -658,6 +658,7 @@
                                        $id                     = 
$values['id'][$n];
                                        $tax_code       = 
$values['tax_code'][$n];
                                        $dimb           = 
isset($values['dimb'][$n]) && $values['dimb'][$n] ? (int)$values['dimb'][$n] : 
'NULL';
+                                       $approved_amount = 
isset($values['approved_amount'][$n]) && $values['approved_amount'][$n] ? 
str_replace(',', '.', $values['approved_amount'][$n]) : 0;
                                        
$workorder_id=$values['workorder_id'][$n];
                                        if(isset($values['close_order'][$n]) && 
$values['close_order'][$n] && !$values['close_order_orig'][$n])
                                        {
@@ -674,7 +675,7 @@
                                                
$update_paid_percent[$workorder_id] = $values['paid_percent'][$n];
                                        }
 
-                                       $GLOBALS['phpgw']->db->query("UPDATE 
fm_ecobilag set $dima_field ,$kostra_field,$dimd_field, mvakode = 
'$tax_code',spbudact_code = '$budget_account',dimb = $dimb where id='$id'");
+                                       $GLOBALS['phpgw']->db->query("UPDATE 
fm_ecobilag SET $dima_field ,$kostra_field,$dimd_field, mvakode = 
'$tax_code',spbudact_code = '$budget_account',dimb = $dimb,godkjentbelop = 
$approved_amount WHERE id='$id'");
 
                                        $receipt['message'][] = 
array('msg'=>lang('Voucher is updated '));
                                }
@@ -1083,6 +1084,7 @@
                                                'merknad'                       
        => $this->db->f('merknad'),
                                                'b_account_id'                  
=> $this->db->f('spbudact_code'),
                                                'amount'                        
        => $this->db->f('belop'),
+                                               'approved_amount'               
=> $this->db->f('godkjentbelop'),
                                                'order'                         
        => $this->db->f('pmwrkord_code'),
                                                'order_id'                      
        => $this->db->f('pmwrkord_code'),
                                                'kostra_id'                     
        => $this->db->f('kostra_id'),

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/inc/class.uiinvoice.inc.php  2011-11-23 13:03:38 UTC (rev 
8174)
@@ -654,18 +654,242 @@
                        $content = 
$this->bo->read_invoice($paid,$start_date,$end_date,$vendor_id,$loc1,$workorder_id,$voucher_id);
 
                        $uicols = array (
-                               'input_type'    =>      array('hidden','hidden' 
,'hidden'       ,'hidden'       ,'hidden','hidden','hidden','hidden','hidden'   
,'link','link'          
,'hidden','hidden','hidden',$paid?'varchar':'input','varchar','varchar','varchar'
  
,'hidden','varchar','varchar','varchar',$paid?'hidden':'input',$paid?'hidden':'input','special','special','special','special2'),
-                               'type'                  =>      
array('number',''               ,''             ,''             
,'number','number',''     ,'number',''  ,'url' ,'msg_box'       ,''    ,''    
,''    ,$paid?'':'text'           ,''     ,'text','text',''    ,''     ,''     
,''     ,$paid?'':'checkbox' ,$paid?'':'radio'      ,''     ,''     ,''     ,'' 
    ),
+                               'input_type'    =>      array
+                                                                       (
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'link',
+                                                                               
'link',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
'hidden',
+                                                                               
$paid?'varchar':'input',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
'hidden',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
'varchar',
+                                                                               
$paid?'hidden':'input',
+                                                                               
$paid?'hidden':'input',
+                                                                               
'special',
+                                                                               
'special',
+                                                                               
'special',
+                                                                               
'special2'
+                                                                               
),
+                               'type'                  =>      array
+                                                                       (
+                                                                               
'number',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'number',
+                                                                               
'number',
+                                                                               
'',
+                                                                               
'number',
+                                                                               
'',
+                                                                               
'url',
+                                                                               
'msg_box',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
$paid?'':'text',
+                                                                               
'',
+                                                                               
'text',
+                                                                               
'text',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
$paid?'':'checkbox',
+                                                                               
$paid?'':'radio',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
''
+                                                                       ),
+                               'col_name'              =>      array
+                                                                       (
+                                                                               
'payment_date',
+                                                                               
'transfer',
+                                                                               
'kreditnota',
+                                                                               
'sign',
+                                                                               
'vendor_name',
+                                                                               
'counter_num',
+                                                                               
'counter',
+                                                                               
'voucher_id_num',
+                                                                               
'voucher_id',
+                                                                               
'voucher_id_lnk',
+                                                                               
'voucher_date_lnk',
+                                                                               
'sign_orig',
+                                                                               
'num_days_orig',
+                                                                               
'timestamp_voucher_date',
+                                                                               
'num_days',
+                                                                               
'amount_lnk',
+                                                                               
'currency',
+                                                                               
'vendor',
+                                                                               
'invoice_count',
+                                                                               
'invoice_count_lnk',
+                                                                               
'type_lnk',
+                                                                               
'period',
+                                                                               
'periodization',
+                                                                               
'periodization_start',
+                                                                               
'kreditnota_tmp',
+                                                                               
'sign_tmp',
+                                                                               
'janitor_lnk',
+                                                                               
'supervisor_lnk',
+                                                                               
'budget_responsible_lnk',
+                                                                               
'transfer_lnk'
+                                                                       ),
+                               'name'                  =>      array
+                                                                       (
+                                                                               
'payment_date',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'vendor',
+                                                                               
'counter',
+                                                                               
'counter',
+                                                                               
'voucher_id',
+                                                                               
'voucher_id',
+                                                                               
'voucher_id',
+                                                                               
'voucher_date',
+                                                                               
'sign_orig',
+                                                                               
'num_days',
+                                                                               
'timestamp_voucher_date',
+                                                                               
'num_days',
+                                                                               
'amount',
+                                                                               
'currency',
+                                                                               
'vendor',
+                                                                               
'invoice_count',
+                                                                               
'invoice_count',
+                                                                               
'type',
+                                                                               
'period',
+                                                                               
'periodization',
+                                                                               
'periodization_start',
+                                                                               
'kreditnota',
+                                                                               
'empty_fild',
+                                                                               
'janitor',
+                                                                               
'supervisor',
+                                                                               
'budget_responsible',
+                                                                               
'transfer_id'
+                                                                       ),
 
-                               'col_name'              =>      
array('payment_date','transfer','kreditnota','sign','vendor_name','counter_num','counter','voucher_id_num','voucher_id','voucher_id_lnk','voucher_date_lnk','sign_orig'
 
,'num_days_orig','timestamp_voucher_date','num_days','amount_lnk','currency','vendor','invoice_count','invoice_count_lnk','type_lnk','period','kreditnota_tmp','sign_tmp'
 ,'janitor_lnk','supervisor_lnk','budget_responsible_lnk','transfer_lnk'),
-                               'name'                  =>      
array('payment_date','dummy','dummy','dummy','vendor','counter','counter','voucher_id'
    ,'voucher_id','voucher_id'    ,'voucher_date'    ,'sign_orig','num_days'    
 ,'timestamp_voucher_date','num_days','amount'    ,'currency','vendor'    
,'invoice_count','invoice_count'    ,'type'    
,'period','kreditnota','empty_fild','janitor'    ,'supervisor'    
,'budget_responsible'    ,'transfer_id'),
+                               'formatter'             =>      array
+                                                                       (
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'myFormatDate',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
$paid?'':'myPeriodDropDown',
+                                                                               
$paid?'':'myPeriodizationDropDown',
+                                                                               
$paid?'':'myPeriodization_startDropDown',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
''
+                                                                       ),
 
-                               'formatter'             =>      
array('','','','','','','','','','','','','','','','myFormatDate','','','','','',$paid?'':'myPeriodDropDown','','','','','',''),
-
-                               'descr'                 =>      
array('dummy','dummy','dummy','dummy','dummy','dummy','dummy','dummy','dummy',lang('voucher'),lang('Voucher
 
Date'),'dummy','dummy','dummy',lang('Days'),lang('Sum'),lang('currency'),lang('Vendor'),'dummy',lang('Count'),lang('Type'),lang('Period'),lang('KreditNota'),lang('None'),lang('Janitor'),lang('Supervisor'),lang('Budget
 Responsible'),lang('Transfer')),
-                               'className'             =>      
array('','','','','','','','','','','centerClasss','','','',$paid?'rightClasss':'','rightClasss','','','','rightClasss','',$paid?'centerClasss':'comboClasss','centerClasss','centerClasss','','','centerClasss','centerClasss')
+                               'descr'                 =>      array
+                                                                       (
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
lang('voucher'),
+                                                                               
lang('Voucher Date'),
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
'dummy',
+                                                                               
lang('Days'),
+                                                                               
lang('Sum'),
+                                                                               
lang('currency'),
+                                                                               
lang('Vendor'),
+                                                                               
'dummy',
+                                                                               
lang('Count'),
+                                                                               
lang('Type'),
+                                                                               
lang('Period'),
+                                                                               
lang('periodization'),
+                                                                               
lang('periodization start'),
+                                                                               
lang('KreditNota'),
+                                                                               
lang('None'),
+                                                                               
lang('Janitor'),
+                                                                               
lang('Supervisor'),
+                                                                               
lang('Budget Responsible'),
+                                                                               
lang('Transfer')
+                                                                       ),
+                               'className'             =>      array
+                                                                       (
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'centerClasss',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
$paid?'rightClasss':'',
+                                                                               
'rightClasss',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'rightClasss',
+                                                                               
'',
+                                                                               
$paid?'centerClasss':'comboClasss',
+                                                                               
$paid?'centerClasss':'comboClasss',
+                                                                               
$paid?'centerClasss':'comboClasss',
+                                                                               
'centerClasss',
+                                                                               
'centerClasss',
+                                                                               
'',
+                                                                               
'',
+                                                                               
'centerClasss',
+                                                                               
'centerClasss'
+                                                                       )
                        );
 
+//_debug_array($uicols);
                        //url to detail of voucher
                        $link_sub       =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.list_sub','user_lid'=>$this->user_lid));
 
@@ -1339,6 +1563,8 @@
                                array(
                                        'col_name'=>'sum',                      
        'label'=>lang('Sum'),                   'className'=>'rightClasss', 
'sortable'=>true,   'sort_field'=>'belop',                  'visible'=>true),
                                array(
+                                       'col_name'=>'approved_amount',  
'label'=>lang('approved amount'),'className'=>'centerClasss', 
'sortable'=>false,        'sort_field'=>'',       'visible'=>true),
+                               array(
                                        'col_name'=>'currency',                 
'label'=>lang('currency'),              'className'=>'centerClasss', 
'sortable'=>false, 'sort_field'=>'',                       'visible'=>true),
                                array(
                                        'col_name'=>'dim_A',                    
'label'=>lang('Dim A'),                 'className'=>'centerClasss', 
'sortable'=>true,  'sort_field'=>'dima',                   'visible'=>true),
@@ -1473,11 +1699,26 @@
 
                                                else if(($i == 8))
                                                {
-                                                       
$json_row[$uicols[$i]['col_name']]  .= $invoices['currency'];
+
+                                                       if($invoices['paid'] == 
true)
+                                                       {
+                                                               
$json_row[$uicols[$i]['col_name']] .= $invoices['approved_amount'];
+                                                       }
+                                                       else
+                                                       {
+                                                               
$json_row[$uicols[$i]['col_name']]  .= " <input 
name='values[approved_amount][".$j."]' id='values[approved_amount][".$j."]'  
class='myValuesForPHP'  type='text' size='7' 
value='".$invoices['approved_amount']."'/>";
+                                                       }
+
+
                                                }
 
                                                else if(($i == 9))
                                                {
+                                                       
$json_row[$uicols[$i]['col_name']]  .= $invoices['currency'];
+                                               }
+
+                                               else if(($i == 10))
+                                               {
                                                        if($invoices['paid'] == 
true)
                                                        {
                                                                
$json_row[$uicols[$i]['col_name']]  .= $invoices['dima'];
@@ -1487,7 +1728,7 @@
                                                                
$json_row[$uicols[$i]['col_name']]  .= " <input name='values[dima][".$j."]' 
id='values[dima][".$j."]'  class='myValuesForPHP'  type='text' size='7' 
value='".$invoices['dima']."'/>";
                                                        }
                                                }
-                                               else if(($i == 10))
+                                               else if(($i == 11))
                                                {
                                                        if($invoices['paid'] == 
true)
                                                        {
@@ -1514,7 +1755,7 @@
 
                                                        }
                                                }
-                                               else if(($i == 11))
+                                               else if(($i == 12))
                                                {
                                                        if($invoices['paid'] == 
true)
                                                        {
@@ -1525,7 +1766,7 @@
                                                                
$json_row[$uicols[$i]['col_name']]  .= " <input name='values[dimd][".$j."]' 
id='values[dimd][".$j."]'  class='myValuesForPHP'  type='text' size='4' 
value='".$invoices['dimd']."'/>";
                                                        }
                                                }
-                                               else if(($i == 12))
+                                               else if(($i == 13))
                                                {
                                                        if($invoices['paid'] == 
true)
                                                        {
@@ -1552,7 +1793,7 @@
 
                                                        }
                                                }
-                                               else if(($i == 13))
+                                               else if(($i == 14))
                                                {
                                                        if($invoices['remark'] 
== true)
                                                        {
@@ -1568,7 +1809,7 @@
                                                                
$json_row[$uicols[$i]['col_name']]  .= "<b>-</b>";
                                                        }
                                                }
-                                               else if(($i == 14))
+                                               else if(($i == 15))
                                                {
                                                        
if(isset($invoices['external_ref']) && $invoices['external_ref'])
                                                        {
@@ -1580,11 +1821,11 @@
                                                                
$json_row[$uicols[$i]['col_name']]  .= "<b>-</b>";
                                                        }
                                                }
-                                               else if($i == 15)
+                                               else if($i == 16)
                                                {
                                                        
$json_row[$uicols[$i]['col_name']]  = $invoices['counter'];
                                                }                               
        
-                                               else if($i == 16)
+                                               else if($i == 17)
                                                {
                                                        
$json_row[$uicols[$i]['col_name']]  = $invoices['id'];
                                                }                               
        

Modified: trunk/property/inc/export/default/Basware_X114
===================================================================
--- trunk/property/inc/export/default/Basware_X114      2011-11-23 13:03:19 UTC 
(rev 8173)
+++ trunk/property/inc/export/default/Basware_X114      2011-11-23 13:03:38 UTC 
(rev 8174)
@@ -560,6 +560,10 @@
                        foreach ($oRsBilag as $line)
                        {
                                $comment[] = $line['process_log'];
+
+                               $BelopFelt = 'godkjentbelop';
+
+/*
                                //Bestem belops felt
                                if ($line['splitt'] == 0)
                                {
@@ -579,7 +583,9 @@
                                        }
                                }
                                
+*/
                                //Bilaget er splittet
+/*
                                if ($line['godkjentbelop'] == $line['belop'])
                                {
                                        $BelopFelt = 'godkjentbelop';
@@ -591,7 +597,7 @@
                                        $this->errorhandler($batchid,$message);
                                        return $message;
                                }
-
+*/
                                $amount =  $line[$BelopFelt] * 100; 
 
                                if($line['order_id'])

Modified: trunk/property/js/yahoo/invoice.index.js
===================================================================
--- trunk/property/js/yahoo/invoice.index.js    2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/js/yahoo/invoice.index.js    2011-11-23 13:03:38 UTC (rev 
8174)
@@ -152,6 +152,7 @@
                                                            { text:  Year 
+"02", value: Year +"02", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
                                                            { text:  Year 
+"03", value: Year +"03", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
                                                            { text:  Year 
+"04", value: Year +"04", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
+
                                                            { text:  Year 
+"05", value: Year +"05", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
                                                            { text:  Year 
+"06", value: Year +"06", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
                                                            { text:  Year 
+"07", value: Year +"07", onclick: { fn: onPeriodDropDownItemClick, idvoucher: 
voucher_id} },
@@ -166,7 +167,62 @@
     }
 
        
/********************************************************************************
+       * Format column myPeriodizationDropDown
+       */
+    var myPeriodizationDropDown = function(elCell, oRecord, oColumn, oData)
+       {
+               var d = new Date();
+               Year = d.getFullYear();
+               var _label = new String(oData);
+
+               tmp_count = oRecord._oData.counter_num;
+               voucher_id = oRecord._oData.voucher_id_num
+           elCell.innerHTML = "<div 
id=\"divPeriodizationDropDown"+tmp_count+"\"></div>";
+
+               var tmp_button = new YAHOO.widget.Button({
+                          type:"menu",
+                          id:"oPeriodizationDropDown"+tmp_count,
+                          label: "<en>" +_label.substring(4)+"</en>",
+                          value: oData,
+                          container: "divPeriodizationDropDown"+tmp_count,
+                          menu: [
+                                       { text: Year +"01", value: Year +"01", 
onclick: { fn: onPeriodizationDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"02", value: Year +"02", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"03", value: Year +"03", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"04", value: Year +"04", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+
+                                                           { text:  Year 
+"05", value: Year +"05", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"06", value: Year +"06", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"07", value: Year +"07", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"08", value: Year +"08", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"09", value: Year +"09", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"10", value: Year +"10", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"11", value: Year +"11", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} },
+                                                           { text:  Year 
+"12", value: Year +"12", onclick: { fn: onPeriodizationDropDownItemClick, 
idvoucher: voucher_id} }   ]});
+           //Define this variable in the window scope (GLOBAL)
+           eval("window.oPeriodizationDropDown"+tmp_count+" = tmp_button");
+
+    }
+
+       
/********************************************************************************
+        * CLick option combobox Periodization
+
+        */
+    this.onPeriodizationDropDownItemClick = function(p_sType, p_aArgs, p_oItem)
+       {
+                //Use a diferente id for voucher. This variables wil be empty 
in PARTICULAR_SETTING
+                path_values.voucher_id_for_periodization = 
p_oItem.cfg.getProperty("onclick").idvoucher;
+                //'text' is the option selected
+                path_values.periodization = p_oItem.cfg.getProperty('text');
+                
+                maintain_pagination_order();
+                //call INDEX. Update Periodization Method is inside of INDEX
+                execute_ds();
+
+       }
+       
/********************************************************************************
         * CLick option combobox PERIOD
+
         */
     this.onPeriodDropDownItemClick = function(p_sType, p_aArgs, p_oItem)
        {
@@ -181,7 +237,65 @@
 
        }
 
+
        
/********************************************************************************
+       * Format column myPeriodization_startDropDown
+       */
+    var myPeriodization_startDropDown = function(elCell, oRecord, oColumn, 
oData)
+       {
+               var d = new Date();
+               Year = d.getFullYear();
+               var _label = new String(oData);
+
+               tmp_count = oRecord._oData.counter_num;
+               voucher_id = oRecord._oData.voucher_id_num
+           elCell.innerHTML = "<div 
id=\"divPeriodization_startDropDown"+tmp_count+"\"></div>";
+
+               var tmp_button = new YAHOO.widget.Button({
+                          type:"menu",
+                          id:"oPeriodization_startDropDown"+tmp_count,
+                          label: "<en>" +_label.substring(4)+"</en>",
+                          value: oData,
+                          container: 
"divPeriodization_startDropDown"+tmp_count,
+                          menu: [
+                                       { text: Year-1 +"11", value: Year-1 
+"11", onclick: { fn: onPeriodization_startDropDownItemClick, idvoucher: 
voucher_id} },
+                                       { text: Year-1 +"12", value: Year-1 
+"12", onclick: { fn: onPeriodization_startDropDownItemClick, idvoucher: 
voucher_id} },
+                                       { text: Year +"01", value: Year +"01", 
onclick: { fn: onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"02", value: Year +"02", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"03", value: Year +"03", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"04", value: Year +"04", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"05", value: Year +"05", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"06", value: Year +"06", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"07", value: Year +"07", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"08", value: Year +"08", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"09", value: Year +"09", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"10", value: Year +"10", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"11", value: Year +"11", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} },
+                                                           { text:  Year 
+"12", value: Year +"12", onclick: { fn: 
onPeriodization_startDropDownItemClick, idvoucher: voucher_id} }     ]});
+           //Define this variable in the window scope (GLOBAL)
+           eval("window.oPeriodization_startDropDown"+tmp_count+" = 
tmp_button");
+
+    }
+
+       
/********************************************************************************
+        * CLick option combobox Periodization_start
+        */
+    this.onPeriodization_startDropDownItemClick = function(p_sType, p_aArgs, 
p_oItem)
+       {
+                //Use a diferente id for voucher. This variables wil be empty 
in PARTICULAR_SETTING
+                path_values.voucher_id_for_Periodization_start = 
p_oItem.cfg.getProperty("onclick").idvoucher;
+                //'text' is the option selected
+                path_values.Periodization_start = 
p_oItem.cfg.getProperty('text');
+                
+                maintain_pagination_order();
+                //call INDEX. Update Periodization_start Method is inside of 
INDEX
+                execute_ds();
+
+       }
+
+
+
+       
/********************************************************************************
         *
         */
        this.onSave = function()
@@ -288,7 +402,7 @@
                td_empty(14);
                td_sum('Total');
                td_sum(tmp_sum);
-               td_empty(7);
+               td_empty(9);
                //RowChecked
                CreateRowChecked("signClass");
                CreateRowChecked("janitorClass");

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2011-11-23 13:03:19 UTC (rev 8173)
+++ trunk/property/setup/phpgw_no.lang  2011-11-23 13:03:38 UTC (rev 8174)
@@ -355,11 +355,12 @@
 consume date   property        no      Dato historisk forbruk
 consume value  property        no      Beløp historisk forbruk
 consume history        property        no      Historisk forbruk
+periodization  property        no      Periodisering
+periodization start    property        no      Startperiode
 planning       property        no      Planlagt
 planning date  property        no      Dato planlagt disponering
 planning value property        no      Beløp planlagt disponering
 planning serie property        no      Planlagt disponering
-
 check to delete        property        no      Merk for å slette
 contact        property        no      Kontakt
 contact email  property        no      Epost

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2011-11-23 13:03:19 UTC (rev 8173)
+++ trunk/property/setup/setup.inc.php  2011-11-23 13:03:38 UTC (rev 8174)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.625';
+       $setup_info['property']['version']              = '0.9.17.626';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';
@@ -143,6 +143,7 @@
                'fm_ecologg',
                'fm_ecomva',
                'fm_ecouser',
+               'fm_eco_periodization',
                'fm_event',
                'fm_event_action',
                'fm_event_exception',

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/setup/tables_current.inc.php 2011-11-23 13:03:38 UTC (rev 
8174)
@@ -1054,6 +1054,8 @@
                                'currency' => array('type' => 
'varchar','precision' => '3','nullable' => True),
                                'process_log' => array('type' => 
'text','nullable' => True),
                                'process_code' => array('type' => 
'varchar','precision' => '10','nullable' => True),
+                               'periodization' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'periodization_start' => array('type' => 
'int','precision' => '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'ix' => array(),
@@ -1105,6 +1107,8 @@
                                'currency' => array('type' => 
'varchar','precision' => '3','nullable' => True),
                                'process_log' => array('type' => 
'text','nullable' => True),
                                'process_code' => array('type' => 
'varchar','precision' => '10','nullable' => True),
+                               'periodization' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'periodization_start' => array('type' => 
'int','precision' => '4','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'ix' => array(),
@@ -1152,6 +1156,16 @@
                        'fk' => array(),
                        'uc' => array()
                ),
+               'fm_eco_periodization' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => '64','nullable' => False)
+                       ),
+                       'pk' => array('id'),
+                       'ix' => array(),
+                       'fk' => array(),
+                       'uc' => array()
+               ),
                'fm_order_dim1' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2011-11-23 13:03:19 UTC (rev 
8173)
+++ trunk/property/setup/tables_update.inc.php  2011-11-23 13:03:38 UTC (rev 
8174)
@@ -5475,7 +5475,44 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.625 to 0.9.17.626
+       * Add periodization to voucher handling
+       */
 
+       $test[] = '0.9.17.625';
+       function property_upgrade0_9_17_625()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
+
+
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'fm_eco_periodization', array(
+                               'fd' => array(
+                                       'id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                                       'descr' => array('type' => 
'varchar','precision' => '64','nullable' => False)
+                               ),
+                               'pk' => array('id'),
+                               'ix' => array(),
+                               'fk' => array(),
+                               'uc' => array()
+                       )
+               );
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','periodization',array('type'
 => 'int','precision' => 4,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','periodization_start',array('type'
 => 'int','precision' => 4,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','periodization',array('type'
 => 'int','precision' => 4,'nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','periodization_start',array('type'
 => 'int','precision' => 4,'nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.626';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
        /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets




reply via email to

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