fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11518] property: remove obsolete


From: Sigurd Nes
Subject: [Fmsystem-commits] [11518] property: remove obsolete
Date: Mon, 09 Dec 2013 11:42:24 +0000

Revision: 11518
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11518
Author:   sigurdne
Date:     2013-12-09 11:42:24 +0000 (Mon, 09 Dec 2013)
Log Message:
-----------
property: remove obsolete

Removed Paths:
-------------
    trunk/property/inc/import/default/cvs_import_vedlikeholdsplan_bkb
    trunk/property/inc/import/default/cvs_oppdater_rental_party_bkb
    trunk/property/inc/import/default/efaktura_dnb_xml

Deleted: trunk/property/inc/import/default/cvs_import_vedlikeholdsplan_bkb
===================================================================
--- trunk/property/inc/import/default/cvs_import_vedlikeholdsplan_bkb   
2013-12-09 11:37:41 UTC (rev 11517)
+++ trunk/property/inc/import/default/cvs_import_vedlikeholdsplan_bkb   
2013-12-09 11:42:24 UTC (rev 11518)
@@ -1,304 +0,0 @@
-<?php
-       class import_conversion
-       {
-               protected $db;
-               public $messages = array();
-               public $warnings = array();
-               public $errors = array();
-               public $debug = true;
-               public function __construct()
-               {
-                       set_time_limit(10000); //Set the time limit for this 
request oto 3000 seconds
-                       $this->account          = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->db           = & $GLOBALS['phpgw']->db;
-                       $this->custom           = 
createObject('property.custom_fields');
-                       $this->attrib_data      = 
$this->custom->find('property', '.project.request', 0, '', 'ASC', 
'attrib_sort', true, true);
-               }
-
-               public function add($data)
-               {
-
-                       $debug = $this->debug;
-                       $error = false;
-                       $type = $data[0];
-                       $location_arr = explode('-',$data[1]);
-                       
-                       if(strpos($location_arr[0], 'A') !== false )
-                       {
-                               $location_code = $location_arr[0] . '-' . 
sprintf("%04d",$data[2]);
-                       }
-                       else
-                       {
-                               $location_code = $location_arr[0] . '-' . 
sprintf("%02d",$data[2]);                     
-                       }
-
-                       $location_data = 
execMethod('property.solocation.read_single', $location_code );
-
-                       if($debug)
-                       {
-                               _debug_array($data);
-                       }
-
-
-//_debug_array($location_data);die();
-                       if(!$location_data)
-                       {
-                               $this->errors[] = "Error importing location: 
{$location_code}";
-                               $error = true;
-                               return false;
-                       }
-
-                       $value_set = array();
-
-               $value_set['loc1'] = $location_data['loc1'];
-               $value_set['loc2'] = $location_data['loc2'];
-
-
-                       if($location_data['street_name'])
-                       {
-                               $address[]= $location_data['street_name'];
-                               $address[]= $location_data['street_number'];
-                               $address        = 
$this->db->db_addslashes(implode(" ", $address));
-                       }
-
-                       if(!$address)
-                       {
-                               $address = 
$this->db->db_addslashes($location_data['loc1_name']);
-                       }
-
-
-                       $this->db->query("SELECT value FROM fm_idgenerator 
WHERE name = 'request'");
-                       $this->db->next_record();
-                       $id = $this->db->f('value')+1;
-
-                       if($data[7])
-                       {
-                               $entry_date_info = explode('/',$data[7]);
-                       }
-                       else if($data[8])
-                       {
-                               $entry_date_info = explode('/',$data[8]);
-                       }
-                       //YYYY/MM/DD
-                       
-                       if(isset($entry_date_info[0]) && 
ctype_digit($entry_date_info[0]))
-                       {
-                               $entry_date = 
strtotime("{$entry_date_info[0]}/06/24");
-                       }
-                       else
-                       {
-                               $this->messages[] = "Dagens dato er lagt inn 
som registreringsdato for {$id}  (mangler info)";
-                               $entry_date = time();
-                       }
-
-
-//_debug_array($entry_date_info);
-//_debug_array($entry_date);
-
-                       $status = 'registrert';
-                       
-                       if($data[3])//historikk
-                       {
-                               $status = 'avsluttet';
-                       }
-
-                       if($data[9])//Status - Utført
-                       {
-                               if($data[9] == 'Delvis')
-                               {
-                                       $status = 'delvis';                     
        
-                               }
-                               else if($data[9] == 'Utgått')
-                               {
-                                       $status = 'kansellert';                 
        
-                               }
-                               else
-                               {
-                                       $status = 'avsluttet';                  
        
-                                       $value_set['closed_date']               
= strtotime("{$data[9]}/06/24");
-                               }
-                       }
-
-/*
-                       $value_set['in_progress_date']  = time();
-                       $value_set['delivered_date']    = time();
-*/
-
-                       
-                       switch ($data[4])
-                       {
-                               case 'D':
-                                       $category = 13;
-                                       break;
-                               case 'V':
-                                       $category = 12;
-                                       break;
-                               case 'U':
-                                       $category = 14;
-                                       break;
-                               case 'Kombinasjon':
-                                       $category = 202;
-                                       break;
-                               default:
-                                       $category = 202;
-                                       break;
-
-                       }
-                       
-                       $value_set['id']                                        
= $id;
-                       $value_set['title']                                     
= substr($this->db->db_addslashes("{$data[0]}::{$data[6]}::{$data[20]}"), 0 , 
100);
-                       $value_set['owner']                                     
= $this->account;
-                       $value_set['category']                          = 
$category;
-                       $value_set['descr']                                     
= $this->db->db_addslashes("{$data[6]}\n{$data[20]}");
-                       $value_set['location_code']                     = 
$location_code;
-                       $value_set['address']                           = 
$address;
-                       $value_set['entry_date']                        = 
$entry_date;
-                       $value_set['budget']                            = 
(int)str_replace(',', '', $data[21]);
-                       $value_set['status']                            = 
$status;
-       //              $value_set['coordinator']                       = 
$coordinator;
-                       $value_set['authorities_demands']       = 
$authorities_demands;
-                       $value_set['building_part']                     = 
$data[5];
-                       $value_set['vurderingskriterie']        = 
(int)$data[10];
-
-                       reset($this->attrib_data);
-                       foreach ( $this->attrib_data as $attrib )
-                       {
-                               if($attrib['datatype'] == 'LB' && 
$attrib['column_name'] == 'hjemmel')
-                               {
-                                       foreach($attrib['choice'] as $choice)
-                                       {
-                                               if(strpos($choice['value'], 
$data[11]) !== false)
-                                               {
-                                                       $value_set['hjemmel']   
= $choice['id'];
-                                                       break 2;
-                                               }
-                                       }
-                               }
-                       }
-
-/*
-                       reset($this->attrib_data);
-                       foreach ( $this->attrib_data as $attrib )
-                       {
-                               if($attrib['datatype'] == 'LB' && 
$attrib['column_name'] == 'forskriftshjemmel')
-                               {
-                                       foreach($attrib['choice'] as $choice)
-                                       {
-                                               if(strpos($choice['value'], 
$data[12]) !== false)
-                                               {
-                                                       
$value_set['forskriftshjemmel'] = $choice['id'];
-                                                       break 2;
-                                               }
-                                       }
-                               }
-                       }
-*/
-
-
-                       $cols = implode(',', array_keys($value_set));
-                       $values = 
$this->db->validate_insert(array_values($value_set));
-
-                       $sql = "INSERT INTO fm_request ({$cols}) VALUES 
({$values})";
-
-                       if($debug)
-                       {
-                               _debug_array($sql);
-                       }
-                       else
-                       {
-                               $request_ok = 
$this->db->query($sql,__LINE__,__FILE__);
-                               if($request_ok)
-                               {
-                                       $this->db->query("UPDATE fm_idgenerator 
set value = value + 1 where name = 'request'");
-                               }
-                       }
-
-                       $condition = array();
-                       $condition_type = (int) substr($data[14], 0, 1);
-//_debug_array($data);                 
-                       if($condition_type)
-                       {
-                               $condition[$condition_type] = array
-                               (
-                                       'degree'                => $data[13] ? 
(int)$data[13] : 0,
-                                       'probability'   =>      $data[16] ? 
(int)$data[16] : 0,
-                                       'consequence'   =>      $data[15] ? 
(int)$data[15] : 0,
-                               );
-                       }
-                       
-//_debug_array($condition);                    
-                       foreach ($condition as $condition_type => $value_type)
-                       {
-                               $sql = "INSERT INTO fm_request_condition 
(request_id,condition_type,degree,probability,consequence,user_id,entry_date) "
-                                       . "VALUES ("
-                                       . $id. ","
-                                       . $condition_type . ","
-                                       . $value_type['degree']. ","
-                                       . $value_type['probability']. ","
-                                       . $value_type['consequence']. ","
-                                       . $this->account . ","
-                                       . time() . ")";
-
-                               if($debug)
-                               {
-                                       _debug_array($sql);
-                               }
-                               else
-                               {
-                                       
$this->db->query($sql,__LINE__,__FILE__);
-                               }
-                       }
-
-                       $consume_data = array();
-
-                       $j = 0;
-                       for ($i=22; $i<36; $i++)
-                       {
-                               $data[$i] = str_replace(',', '', $data[$i]);
-
-                               $year = 2012 - $j;
-                               $j++;
-                               if($data[$i] && ctype_digit($data[$i]))
-                               {
-                                       $consume_data[] = array
-                                       (
-                                                'value' => (int)$data[$i],
-                                                'date' => 
strtotime("{$year}/06/24")
-                                       );
-                               }
-                       }
-
-                       foreach ($consume_data as $consume)
-                       {
-                               $sql = "INSERT INTO fm_request_consume 
(request_id,amount,date,user_id,entry_date) "
-                                       . "VALUES ("
-                                       . $id . ","
-                                       . (int)$consume['value'] . ","
-                                       . (int)$consume['date'] . ","
-                                       . $this->account . ","
-                                       . time() . ")";
-
-                               if($debug)
-                               {
-                                       _debug_array($sql);
-                               }
-                               else
-                               {
-                                       
$this->db->query($sql,__LINE__,__FILE__);
-                               }
-                       }
-
-
-                       if(!$error)
-                       {
-                               $this->messages[] = "Successfully imported 
location: Title ({$data[20]})";
-                               $ok = true;
-                       }
-                       else
-                       {
-                               $this->errors[] = "Error importing location: 
Title ({$data[20]})";
-                               $ok = false;
-                       }
-                       return $ok;
-               }
-       }

Deleted: trunk/property/inc/import/default/cvs_oppdater_rental_party_bkb
===================================================================
--- trunk/property/inc/import/default/cvs_oppdater_rental_party_bkb     
2013-12-09 11:37:41 UTC (rev 11517)
+++ trunk/property/inc/import/default/cvs_oppdater_rental_party_bkb     
2013-12-09 11:42:24 UTC (rev 11518)
@@ -1,117 +0,0 @@
-<?php
-       class import_conversion
-       {
-               protected $db;
-               public $messages = array();
-               public $warnings = array();
-               public $errors = array();
-               public $debug = true;
-               public $fields = array();
-               public $table;
-               public $metadata = array();
-
-               public function __construct()
-               {
-                       set_time_limit(10000); //Set the time limit for this 
request
-                       $this->account          = 
(int)$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->db           = & $GLOBALS['phpgw']->db;
-               }
-
-               public function add($data)
-               {
-                       $error = false;
-                       $table = $this->table;
-                       $fields =  $this->fields;
-
-                       if(!$table)
-                       {
-                               throw new Exception("Tabell er ikke angitt");
-                       }
-
-                       if(!$fields)
-                       {
-                               throw new Exception("Felter er ikke definert");
-                       }
-
-                       $id = (int)$data[array_search('id', $fields)];
-                       
-                       if(!$id)
-                       {
-                               throw new Exception("Fant ikke verdi for feltet 
'id'");
-                       }
-
-                       $value_set = array();
-                       foreach ($fields as $key => $field)
-                       {
-                               $value_set[$field]      = 
$this->validate_value($data[$key], $field);
-                       }
-                       unset($value_set['id']);
-               
-                       $this->db->query("SELECT id FROM {$table} WHERE id = 
{$id}",__LINE__,__FILE__);
-                       if($this->db->next_record())
-                       {
-                               $this->warnings[] = "ID finnes fra før: {$id}, 
oppdaterer";
-                               $value_set      = 
$this->db->validate_update($value_set);
-                               $sql = "UPDATE {$table} SET {$value_set} WHERE 
id = {$id}";
-                       }
-                       else
-                       {
-                               $this->warnings[] = "ID fantes ikke fra før: 
{$id}";
-                       }
-
-                       if($this->debug)
-                       {
-                               _debug_array($sql);
-                       }
-                       else
-                       {
-                               $request_ok = 
$this->db->query($sql,__LINE__,__FILE__);
-                       }
-
-                       if(!$error)
-                       {
-                               $this->messages[] = "Successfully updated 
party: Title ({$data[7]})";
-                               $ok = true;
-                       }
-                       else
-                       {
-                               $this->errors[] = "Error updating location: 
Title ({$data[7]})";
-                               $ok = false;
-                       }
-                       return $ok;
-               }
-
-               
-               /**
-                * Test a value for null according to several formats that can 
exist in the export.
-                * Returns true if the value is null according to these rules, 
false otherwise.
-                * 
-                * @param string $value The value to test
-                * @return bool
-                */
-               protected function is_null($value)
-               {
-                       return ((trim($value) == "") || ($data == "<NULL>") || 
($data == "''"));
-               }
-
-               protected function validate_value($value,$field)
-               {
-                       $datatype = $this->metadata[$field]->type;
-                       switch ($datatype)
-                       {
-                               case 'char':
-                               case 'varchar':
-                               case 'text':
-                                       $ret = $this->db->db_addslashes($value);
-                                       break;
-                               case 'bool':
-                                       $ret = $value ? 'True' : 'False';
-                                       break;
-                               default:
-                                       $ret = $value;
-                       }
-
-                       return $ret;
-               }
-
-       }

Deleted: trunk/property/inc/import/default/efaktura_dnb_xml
===================================================================
--- trunk/property/inc/import/default/efaktura_dnb_xml  2013-12-09 11:37:41 UTC 
(rev 11517)
+++ trunk/property/inc/import/default/efaktura_dnb_xml  2013-12-09 11:42:24 UTC 
(rev 11518)
@@ -1,319 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software 
Foundation, Inc. http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package property
-       * @subpackage import
-       * @version $Id: Import_fra_BKK_csv,v 1.8 2007/03/18 16:33:16 sigurdne 
Exp $
-       */
-
-       /**
-        * Description
-        * @package property
-        */
-
-       class import_conv
-       {
-               var $spbudact_code='12304121';
-               var $mvakode=0;
-               var $kildeid=1;
-               var $splitt=0;
-               var $soXport;
-               var $invoice;
-               var $meter_table;
-               protected $bilagsnr = array();
-
-               var $import = array
-               (
-                       'Bestilling'    => 'pmwrkord_code', 
-                       'Fakt. Nr'              => 'fakturanr',
-                       'Måler nr'              => 'maalernr',
-                       'Konto'                 => 'spbudact_code',
-                       'Objekt'                => 'dima',
-                       'Omr'                   => 'omraade',
-                       'Adresse'               => 'stedsnavn',
-                       'MVA'                   => 'mvakode',
-                       'Tjeneste'              => 'kostra_id',
-                       'Belop [kr]'    => 'belop'
-               );
-
-//             var $header = array('Fakt. Nr','Måler 
nr','Konto','Objekt','MVA','Belop [kr]','Omr','Adresse');
-
-
-               function import_conv()
-               {
-                       $this->soXport          = 
CreateObject('property.soXport');     
-                       $this->invoice          = 
CreateObject('property.boinvoice');
-                       $this->config           = 
CreateObject('phpgwapi.config','property');
-                       $this->config->read_repository();
-                       $this->meter_table = 
$this->config->config_data['meter_table'];
-
-                       $this->db                               = & 
$GLOBALS['phpgw']->db;
-                       $this->join                             = & 
$this->db->join;
-                       $this->left_join                = & 
$this->db->left_join;
-                       $this->like                             = & 
$this->db->like;
-                       $this->datetimeformat   = $this->db->datetime_format();
-                       $this->dateformat               = 
$this->db->date_format();
-               }
-
-               function import($invoice_common,$download)
-               {
-                       $tsvfile        = $invoice_common['tsvfile'];
-                       $conv_type      = $invoice_common['conv_type'];
-                       $this->bilagsnr[] = $this->invoice->next_bilagsnr();
-                       $buffer = array();
-                       $xmlparse = CreateObject('property.XmlToArray');
-                       $xmlparse->setEncoding('UTF-8');
-                       $xmlparse->setDecodesUTF8Automaticly(false);
-                       $xmlparse->setIncludesEmptyValues(true);
-                       $var_result = $xmlparse->parseFile($tsvfile);
-
-                       $i = 0;                 
-                       if(isset($var_result['Invoice']))
-                       {
-                               foreach ($var_result['Invoice'] as $invoice)
-                               {
-                                       foreach 
($invoice['InvoiceHeader'][0]['Buyer'][0]['Ref'] as $_ref)
-                                       {
-                                               if ($_ref['Code'] == 
'CustomerNumber')
-                                               {
-                                                       $kundenr = 
$_ref['Text'];
-                                               }
-                                       }
-
-                                       $supplier_orgnumber     = 
$invoice['InvoiceHeader'][0]['Supplier'][0]['OrgNumber'];
-                                       $fakturanr                      = 
$invoice['InvoiceHeader'][0]['InvoiceNumber'];
-                                       $invoice_date           = 
date($this->dateformat,strtotime($invoice['InvoiceHeader'][0]['InvoiceDate']));
-                                       $payment_date           = 
date($this->dateformat,strtotime($invoice['InvoiceHeader'][0]['Payment'][0]['DueDate']));
-                                       $periode                        = 
date('Ym',strtotime($invoice['InvoiceHeader'][0]['InvoiceDate']));
-                                       $kidnr                          = 
$invoice['InvoiceHeader'][0]['Payment'][0]['KidNumber'];
-                                       $currency                       = 
$invoice['InvoiceHeader'][0]['Payment'][0]['Currency'];
-                                       $maalepunktid           = 
$invoice['InvoiceHeader'][0]['InvoiceReferences'][0]['BuyersOrderNumber'];
-                                       $godkjentbelop          = 
$invoice['InvoiceSummary'][0]['InvoiceTotals'][0]['GrossAmount'];
-                                       $kunde_navn                     = 
$invoice['InvoiceHeader'][0]['Buyer'][0]['Name'];
-
-                                       $stedsnavn                      = 
$invoice['InvoiceHeader'][0]['Buyer'][0]['PostalAddress'][0]['Address1'] . "\n";
-                                       $stedsnavn                      .= 
$invoice['InvoiceHeader'][0]['Buyer'][0]['PostalAddress'][0]['Address2'] . "\n";
-                                       $stedsnavn                      .= 
$invoice['InvoiceHeader'][0]['Buyer'][0]['PostalAddress'][0]['PostalCode'] . 
"\n";
-                                       $stedsnavn                      .= 
$invoice['InvoiceHeader'][0]['Buyer'][0]['PostalAddress'][0]['PostalDistrict'] 
. "\n";
-                                       
-                                       $buffer[$i]['bilagsnr'] = 
max($this->bilagsnr);
-
-                                       if($godkjentbelop < 0)
-                                       {
-                                               $buffer[$i]['artid'] = 2;       
                                
-                                       }
-                                       else
-                                       {
-                                               $buffer[$i]['artid'] = 
$invoice_common['art'];
-                                       }
-
-                                       if( $invoice_common['art'] == 2 ) // 
kreditnota
-                                       {
-                                               $godkjentbelop = -1 * 
abs($godkjentbelop);
-                                       }
-
-                                       $merknad = <<<HTML
-                                       <table cellspacing="10">
-                                               <tr>
-                                                       <td>
-                                                               Målepunktid
-                                                       </td>
-                                                       <td>
-                                                               $maalepunktid
-                                                       </td>
-                                               </tr>
-                                               <tr>
-                                                       <td>
-                                                               Fakturanr
-                                                       </td>
-                                                       <td>
-                                                               $fakturanr
-                                                       </td>
-                                               </tr>
-                                               <tr>
-                                                       <td>
-                                                               Kundenr
-                                                       </td>
-                                                       <td>
-                                                               $kundenr
-                                                       </td>
-                                               </tr>
-                                               <tr>
-                                                       <td>
-                                                               Kundenavn
-                                                       </td>
-                                                       <td>
-                                                               $kunde_navn
-                                                       </td>
-                                               </tr>
-                                               <tr>
-                                                       <td>
-                                                               Adresse
-                                                       </td>
-                                                       <td>
-                                                               $stedsnavn
-                                                       </td>
-                                               </tr>
-                                       </table>
-HTML;
-
-
-                                       $merknad .= <<<HTML
-                                       <table cellspacing="10">
-                                               <tr>
-                                                       <td>
-                                                               Beskrivelse
-                                                       </td>
-                                                       <td>
-                                                               Enhetspris
-                                                       </td>
-                                                       <td>
-                                                               Beløp
-                                                       </td>
-                                                       <td>
-                                                               Mengde
-                                                       </td>
-                                                       <td>
-                                                               Enhet
-                                                       </td>
-                                               </tr>
-HTML;
-                                       
-                                       foreach($invoice['InvoiceDetails'] as 
$invoicedetails)
-                                       {
-                                               foreach 
($invoicedetails['BaseItemDetails'] as $baseitemdetails)
-                                               {
-                                                       $line = 
"<tr><td>{$baseitemdetails['Description']}</td>";
-                                                       $line .= '<td align = 
"right">'. number_format(round($baseitemdetails['UnitPrice'],2),2). "</td>";
-                                                       $line .= '<td align = 
"right">'."{$baseitemdetails['LineItemAmount']}</td>";
-                                                       $line .= '<td align = 
"right">'."{$baseitemdetails['QuantityInvoiced']}</td>";
-                                                       $line .= '<td align = 
"right">'."{$baseitemdetails['UnitOfMeasure']}</td></tr>";
-                                                       $merknad .= $line;
-                                               }
-                                       }                                       
-
-                                       $merknad .= <<<HTML
-                                       </table>
-HTML;
-                                       $buffer[$i]['merknad']                  
        = $merknad;
-
-                                       $maalerinfo     = 
$this->anleggsnr_to_objekt($maalepunktid,$this->meter_table);
-                                       $dima           = $maalerinfo['dima'];
-                                       $loc1           = $maalerinfo['loc1'];
-                                       $omraade        = 
$maalerinfo['district'];
-
-                                       if($invoice_common['auto_tax'])
-                                       {
-                                               
$mvakode=$this->soXport->auto_tax($loc1);
-                                               
-                                               if($mvakode)
-                                               {
-                                                       $buffer[$i]['mvakode']  
        = $mvakode;
-                                               }
-                                               else
-                                               {
-                                                       $buffer[$i]['mvakode']  
        = $this->mvakode;
-                                               }
-                                       }
-                                       else
-                                       {
-                                               $buffer[$i]['mvakode']          
        = $this->mvakode;
-                                       }
-
-                                       $buffer[$i]['stedsnavn']                
        = $stedsnavn;
-                                       $buffer[$i]['currency']                 
        = $currency;
-                                       $buffer[$i]['fakturanr']                
        = $fakturanr;
-                                       $buffer[$i]['dima']                     
                = $dima;
-                                       $buffer[$i]['loc1']                     
                = $loc1;
-                                       $buffer[$i]['omraade']                  
        = $omraade;
-                                       $buffer[$i]['splitt']                   
        = $this->splitt;
-                                       $buffer[$i]['kildeid']                  
        = $this->kildeid;
-                                       $buffer[$i]['spbudact_code']            
= $this->spbudact_code;
-                                       $buffer[$i]['kidnr']                    
        = $kidnr;
-                                       $buffer[$i]['typeid']                   
        = $invoice_common['type'];
-                                       $buffer[$i]['fakturadato']              
        = $invoice_date;
-                                       $buffer[$i]['forfallsdato']             
        = $payment_date;
-                                       $buffer[$i]['periode']                  
        = $periode;
-                                       $buffer[$i]['regtid']                   
        = date($this->datetimeformat);
-                                       $buffer[$i]['belop']                    
        = $godkjentbelop;
-                                       $buffer[$i]['godkjentbelop']            
= $godkjentbelop;
-                                       $buffer[$i]['spvend_code']              
        = $invoice_common['vendor_id'];
-                                       $buffer[$i]['dimb']                     
                = $invoice_common['dim_b'];
-                                       $buffer[$i]['oppsynsmannid']            
= $invoice_common['janitor'];
-                                       $buffer[$i]['saksbehandlerid']          
= $invoice_common['supervisor'];
-                                       $buffer[$i]['budsjettansvarligid']      
= $invoice_common['budget_responsible'];
-
-                                       if($invoice_common['auto_tax'])
-                                       {
-                                               $buffer[$i]['mvakode']          
        = $this->soXport->tax_b_account_override($buffer[$i]['mvakode'] 
,$buffer[$i]['spbudact_code']);
-                                               $buffer[$i]['mvakode']          
        = $this->soXport->tax_vendor_override($buffer[$i]['mvakode'] 
,$buffer[$i]['spvend_code']);
-                                               $buffer[$i]['kostra_id']        
        = $this->soXport->get_kostra_id($buffer[$i]['loc1']);
-                                       }
-
-                                       $i++;
-                                       $this->bilagsnr[] = 
max($this->bilagsnr)+1;
-                               }
-                       }
-
-                       if(!$download)
-                       {
-                               $buffer = $this->import_end_file($buffer);
-                       }
-
-//                     $this->header = array('Fakt. Nr','Måler 
nr','Konto','Objekt','MVA','Tjeneste','Belop [kr]','Omr','Adresse');
-                       return $buffer;
-               }
-               
-
-               function anleggsnr_to_objekt($anleggsnr,$meter_table)
-               {
-                       $sql = "SELECT 
{$meter_table}.maaler_nr,{$meter_table}.loc1,{$meter_table}.loc2,{$meter_table}.loc3,fm_part_of_town.district_id
 "
-                       . " FROM {$meter_table} {$this->join} fm_location1 ON 
{$meter_table}.loc1 = fm_location1.loc1 $this->join "
-                         . " fm_part_of_town ON fm_location1.part_of_town_id = 
fm_part_of_town.part_of_town_id WHERE {$meter_table}.maalepunkt_id 
{$this->like} '%{$anleggsnr}'";
-//     _debug_array($sql);
-                       $this->db->query($sql);
-
-                       $this->db->next_record();
-                       $loc1 = $this->db->f('loc1');
-                       $loc2 = $this->db->f('loc2');
-
-                       $maalerinfo['loc1']=$loc1;
-                       $maalerinfo['dima']=$loc1.$loc2;
-                       $maalerinfo['maalernr']=$this->db->f('maaler_nr');
-                       $maalerinfo['district']=$this->db->f('district_id');
-                       return $maalerinfo;
-               }
-
-               function import_end_file($buffer)
-               {
-
-//_debug_array($buffer);die();
-                       $num    = $this->soXport->add($buffer);
-                       array_pop($this->bilagsnr);
-                       $bilagsnr = max($this->bilagsnr);
-                       $this->db->query("UPDATE fm_idgenerator SET VALUE 
={$bilagsnr} WHERE name = 'Bilagsnummer'");
-                       $receipt['message'][]= array('msg' => 
lang('Successfully imported %1 records into your invoice register.',$num).' 
'.lang('ID').': '. implode(',', $this->bilagsnr));
-                       return $receipt;
-               }
-       }




reply via email to

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