fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9179] property: invoice handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [9179] property: invoice handling
Date: Wed, 18 Apr 2012 14:32:48 +0000

Revision: 9179
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9179
Author:   sigurdne
Date:     2012-04-18 14:32:39 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
property: invoice handling

Modified Paths:
--------------
    trunk/property/inc/class.soXport.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice2.inc.php
    trunk/property/inc/cron/default/Import_fra_basware_X205.php
    trunk/property/inc/export/default/Basware_X114
    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.soXport.inc.php
===================================================================
--- trunk/property/inc/class.soXport.inc.php    2012-04-18 13:09:48 UTC (rev 
9178)
+++ trunk/property/inc/class.soXport.inc.php    2012-04-18 14:32:39 UTC (rev 
9179)
@@ -259,6 +259,7 @@
                                                $fields['mvakode'],
                                                $fields['periode'],
                                                
$this->db->db_addslashes($fields['merknad']),
+                                               
$this->db->db_addslashes($fields['line_text']),
                                                false,
                                                false,
                                                false,
@@ -275,7 +276,7 @@
 
                                        $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,bilagsnr_ut,splitt,kildeid,kidnr,typeid,fakturadato,"
                                                . " 
forfallsdato,regtid,artid,spvend_code,dimb,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
-                                               . " 
fakturanr,spbudact_code,loc1,dima,dimd,mvakode,periode,merknad,oppsynsigndato,saksigndato,"
+                                               . " 
fakturanr,spbudact_code,loc1,dima,dimd,mvakode,periode,merknad,line_text,oppsynsigndato,saksigndato,"
                                                . " 
budsjettsigndato,utbetalingsigndato,item_type,item_id,external_ref,currency,belop,godkjentbelop)"
                                                . " VALUES ({$values}," . 
$this->db->money_format($fields['belop']) . ',' . 
$this->db->money_format($fields['godkjentbelop']) .')';
 
@@ -336,6 +337,7 @@
                                $data['saksigndato'],
                                $data['budsjettsigndato'],
                                $this->db->db_addslashes($data['merknad']),
+                               $this->db->db_addslashes($data['line_text']),
                                $data['splitt'],
                                $data['utbetalingid'],
                                $data['utbetalingsigndato'],
@@ -353,7 +355,7 @@
                        $sql="INSERT INTO fm_ecobilagoverf 
(id,bilagsnr,bilagsnr_ut,kidnr,typeid,kildeid,project_id,kostra_id,pmwrkord_code,fakturadato,"
                                . " 
periode,periodization,periodization_start,forfallsdato,fakturanr,spbudact_code,regtid,artid,spvend_code,dima,loc1,"
                                . " 
dimb,mvakode,dimd,oppsynsmannid,saksbehandlerid,budsjettansvarligid,oppsynsigndato,saksigndato,"
-                               . " 
budsjettsigndato,merknad,splitt,utbetalingid,utbetalingsigndato,filnavn,overftid,item_type,item_id,external_ref,"
+                               . " 
budsjettsigndato,merknad,line_text,splitt,utbetalingid,utbetalingsigndato,filnavn,overftid,item_type,item_id,external_ref,"
                                . " 
currency,manual_record,belop,godkjentbelop,ordrebelop)"
                                . "VALUES ($values, "
                                . $this->db->money_format($data['belop']) . ","
@@ -426,6 +428,7 @@
                                        'saksigndato'                   => 
$this->db->f('saksigndato'),
                                        'budsjettsigndato'              => 
$this->db->f('budsjettsigndato'),
                                        'merknad'                               
=> $this->db->f('merknad',true),
+                                       'line_text'                             
=> $this->db->f('line_text',true),
                                        'splitt'                                
=> $this->db->f('splitt'),
                                        'utbetalingid'                  => 
$this->db->f('utbetalingid'),
                                        'utbetalingsigndato'    => 
$this->db->f('utbetalingsigndato'),
@@ -540,6 +543,7 @@
 
                                        $hoved_bilag[$i]['budsjettsigndato']    
= $this->db->f('budsjettsigndato');
                                        $hoved_bilag[$i]['merknad']             
                = $this->db->f('merknad');
+                                       $hoved_bilag[$i]['line_text']           
        = $this->db->f('line_text');
                                        $hoved_bilag[$i]['splitt']              
                = $this->db->f('splitt');
                                        $hoved_bilag[$i]['utbetalingid']        
        = $this->db->f('utbetalingid');
                                        $hoved_bilag[$i]['utbetalingsigndato']  
= $this->db->f('utbetalingsigndato');
@@ -607,6 +611,7 @@
 
                                $underbilag[$i]['budsjettsigndato']     = 
$this->db->f('budsjettsigndato');
                                $underbilag[$i]['merknad']      = 
$this->db->f('merknad');
+                               $underbilag[$i]['line_text']    = 
$this->db->f('line_text');
                                $underbilag[$i]['splitt']       = 
$this->db->f('splitt');
                                $underbilag[$i]['utbetalingid'] = 
$this->db->f('utbetalingid');
                                $underbilag[$i]['utbetalingsigndato']   = 
$this->db->f('utbetalingsigndato');

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-04-18 13:09:48 UTC (rev 
9178)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-04-18 14:32:39 UTC (rev 
9179)
@@ -471,7 +471,7 @@
                                                'budget_responsible'    => 
$this->db->f('budsjettansvarligid'),
                                                'budsjettsigndato'              
=> $this->db->f('budsjettsigndato'),
                                                'transfer_time'                 
=> $this->db->f('overftid'),
-                                               'line_text'                     
        => 'FIX ME soinvoice::read_invoice_sub()'
+                                               'line_text'                     
        => $this->db->f('line_text',true)
                                        );
 
                                $i++;
@@ -1301,7 +1301,8 @@
                                                'project_id'                    
=> $this->db->f('project_id'),
                                                'project_group'                 
=> $this->db->f('project_id'),
                                                'payment_date'                  
=> $this->db->f('forfallsdato'),
-                                               'merknad'                       
        => $this->db->f('merknad'),
+                                               'merknad'                       
        => $this->db->f('merknad',true),
+                                               'line_text'                     
        => $this->db->f('line_text',true),
                                                'b_account_id'                  
=> $this->db->f('spbudact_code'),
                                                'amount'                        
        => $this->db->f('belop'),
                                                'approved_amount'               
=> $this->db->f('godkjentbelop'),

Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-04-18 13:09:48 UTC (rev 
9178)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-04-18 14:32:39 UTC (rev 
9179)
@@ -301,6 +301,7 @@
                                $entry['approve_line'] = "<input 
id=\"approve_line\" type =\"radio\" {$_checked} name=\"values[approve]\" 
value=\"{$entry['id']}\">";
                                $entry['split'] = "<input type =\"text\" 
name=\"values[split_amount][{$entry['id']}]\" value=\"\" size=\"8\">";
                                
+                               $entry['line_text'] = "<input type =\"text\" 
name=\"values[line_text][{$entry['id']}]\" value=\"{$entry['line_text']}\" 
size=\"20\">";
                                $entry['approved_amount'] = "<input type 
=\"text\" name=\"values[approved_amount][{$entry['id']}]\" 
value=\"{$entry['approved_amount']}\" size=\"8\">";
                                $results['results'][]= $entry;
                        }

Modified: trunk/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-04-18 
13:09:48 UTC (rev 9178)
+++ trunk/property/inc/cron/default/Import_fra_basware_X205.php 2012-04-18 
14:32:39 UTC (rev 9179)
@@ -525,6 +525,7 @@
                                $kidnr                                          
= $_data['KIDNO'];
                                $_order_id                                      
= $_data['PURCHASEORDERNO'];
                                $merknad                                        
= '';
+                               $line_text                                      
= '';
                                $order_id                                       
= '';
                                $buffer[$i]['project_id']       = '';
 
@@ -565,12 +566,11 @@
                                $buffer[$i]['bilagsnr_ut']              = 
$bilagsnr_ut;
                                $buffer[$i]['referanse']                = 
"ordre: {$order_id}";
 
+                               $buffer[$i]['dimb']             = 
$order_info['dimb'];
+                               $buffer[$i]['dima']             = 
$order_info['dima'];
+                               $buffer[$i]['loc1']             = 
$order_info['loc1'];
+                               $buffer[$i]['line_text']        = 
$order_info['title'];
 
-
-                               $buffer[$i]['dimb'] = $order_info['dimb'];
-                               $buffer[$i]['dima'] = $order_info['dima'];
-                               $buffer[$i]['loc1'] = $order_info['loc1'];
-
                                $buffer[$i]['mvakode'] = $this->mvakode;
 
                                if($buffer[$i]['loc1'] && $this->auto_tax)
@@ -780,7 +780,7 @@
                        $order_info = array();
                        $toarray = array();
                        $order_id = (int) $order_id;
-                       $sql = "SELECT 
fm_workorder.location_code,fm_workorder.vendor_id,fm_workorder.account_id,fm_workorder.ecodimb,
 fm_workorder.user_id"
+                       $sql = "SELECT 
fm_workorder.location_code,fm_workorder.vendor_id,fm_workorder.account_id,fm_workorder.ecodimb,
 fm_workorder.user_id,fm_workorder.title"
                        . " FROM fm_workorder {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id WHERE fm_workorder.id = {$order_id}";
                        $this->db->query($sql,__LINE__,__FILE__);
                        if(     $this->db->next_record())
@@ -797,6 +797,7 @@
                        $order_info['vendor_id']                        = 
$this->db->f('vendor_id');
                        $order_info['spbudact_code']            = 
$this->db->f('account_id');
                        $order_info['dimb']                                     
= $this->db->f('ecodimb');
+                       $order_info['title']                            = 
$this->db->f('title',true);                   
 
                        $janitor_user_id                                        
= $this->db->f('user_id');
                        $order_info['janitor']                          = 
$GLOBALS['phpgw']->accounts->get($janitor_user_id)->lid;

Modified: trunk/property/inc/export/default/Basware_X114
===================================================================
--- trunk/property/inc/export/default/Basware_X114      2012-04-18 13:09:48 UTC 
(rev 9178)
+++ trunk/property/inc/export/default/Basware_X114      2012-04-18 14:32:39 UTC 
(rev 9179)
@@ -286,6 +286,7 @@
                                        'saksigndato'                   => 
$this->db->f('saksigndato'),
                                        'budsjettsigndato'              => 
$this->db->f('budsjettsigndato'),
                                        'merknad'                               
=> $this->db->f('merknad',true),
+                                       'line_text'                             
=> $this->db->f('line_text',true),
                                        'splitt'                                
=> $this->db->f('splitt'),
                                        'ordrebelop'                    => 
$this->db->f('ordrebelop'),
                //                      'utbetalingid'                  => 
$this->db->f('utbetalingid'),
@@ -334,6 +335,7 @@
                                $BilagOverf['periodization'],
                                $BilagOverf['periodization_start'],
                                
$this->db->db_addslashes($BilagOverf['merknad']),
+                               
$this->db->db_addslashes($BilagOverf['line_text']),
                                $BilagOverf['utbetalingid'],
                                $BilagOverf['oppsynsigndato'],
                                $BilagOverf['saksigndato'],
@@ -352,7 +354,7 @@
                        $sql= "INSERT INTO fm_ecobilag 
(project_id,kostra_id,pmwrkord_code,bilagsnr,bilagsnr_ut,splitt,kildeid,kidnr,typeid,"
                        . " 
fakturadato,forfallsdato,regtid,artid,spvend_code,dimb,oppsynsmannid,"
                        . " 
saksbehandlerid,budsjettansvarligid,fakturanr,spbudact_code,dima,loc1,dimd,mvakode,"
-                       . " 
periode,periodization,periodization_start,merknad,utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,"
+                       . " 
periode,periodization,periodization_start,merknad,line_text,utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,"
                        . " 
item_type,item_id,external_ref,belop,godkjentbelop,currency)"
                        . " VALUES ({$values})";
 
@@ -755,9 +757,9 @@
                                }
 
                                $descr = '';
-                               if($line['merknad'])
+                               if($line['line_text'])
                                {
-                                       $descr = $line['merknad'];
+                                       $descr = $line['line_text'];
                                }
                                else if ($line['order_id'])
                                {

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2012-04-18 13:09:48 UTC (rev 9178)
+++ trunk/property/setup/setup.inc.php  2012-04-18 14:32:39 UTC (rev 9179)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.640';
+       $setup_info['property']['version']              = '0.9.17.641';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-04-18 13:09:48 UTC (rev 
9178)
+++ trunk/property/setup/tables_current.inc.php 2012-04-18 14:32:39 UTC (rev 
9179)
@@ -1074,7 +1074,8 @@
                                '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)
+                               'periodization_start' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'line_text' => array('type' => 
'varchar','precision' => '255','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'ix' => array(),
@@ -1129,7 +1130,8 @@
                                '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),
-                               'manual_record' => array('type' => 
'int','precision' => '2','nullable' => True)
+                               'manual_record' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'line_text' => array('type' => 
'varchar','precision' => '255','nullable' => True)
                        ),
                        'pk' => array('id'),
                        'ix' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2012-04-18 13:09:48 UTC (rev 
9178)
+++ trunk/property/setup/tables_update.inc.php  2012-04-18 14:32:39 UTC (rev 
9179)
@@ -6191,15 +6191,40 @@
                        $sql = "INSERT INTO fm_ecobilag_process_log ({$cols}) 
VALUES ({$values})";
                        
$GLOBALS['phpgw_setup']->oProc->query($sql,__LINE__,__FILE__);
                }
-
+/*
                
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_ecobilag',array(),'process_code');
                
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_ecobilag',array(),'process_log');
                
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_ecobilagoverf',array(),'process_code');
                
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_ecobilagoverf',array(),'process_log');
-
+*/
                if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
                {
                        $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.640';
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
+
        }
+       
+       $test[] = '0.9.17.640';
+       function property_upgrade0_9_17_640()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $metadata = 
$GLOBALS['phpgw_setup']->oProc->m_odb->metadata('fm_ecobilag');
+
+               if(!isset($metadata['process_log']))
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','process_log', 
array('type' => 'text','nullable' => True));
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','process_log', 
array('type' => 'text','nullable' => True));
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','process_code', 
array('type' => 'varchar','precision' => '10','nullable' => True));
+                       
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','process_code', 
array('type' => 'varchar','precision' => '10','nullable' => True));
+               }
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','line_text', 
array('type' => 'varchar','precision' => '255','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','line_text', 
array('type' => 'varchar','precision' => '255','nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.641';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }




reply via email to

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