[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/import import_fra_Service_xls
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc/import import_fra_Service_xls |
Date: |
Mon, 03 Sep 2007 18:22:46 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 07/09/03 18:22:46
Modified files:
inc/import : import_fra_Service_xls
Log message:
update
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/import/import_fra_Service_xls?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: import_fra_Service_xls
===================================================================
RCS file: /sources/phpgroupware/property/inc/import/import_fra_Service_xls,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- import_fra_Service_xls 3 Sep 2007 13:24:39 -0000 1.1
+++ import_fra_Service_xls 3 Sep 2007 18:22:46 -0000 1.2
@@ -24,7 +24,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage import
- * @version $Id: import_fra_Service_xls,v 1.1 2007/09/03 13:24:39
sigurdne Exp $
+ * @version $Id: import_fra_Service_xls,v 1.2 2007/09/03 18:22:46
sigurdne Exp $
*/
/**
@@ -71,7 +71,6 @@
function import($invoice_common,$download)
{
-
$tsvfile = $invoice_common['tsvfile'];
$conv_type = $invoice_common['conv_type'];
$valid_data= False;
@@ -81,13 +80,10 @@
$data->setOutputEncoding('CP1251');
$data->read($tsvfile);
-//_debug_array($data->sheets[0]['numRows']);
-//_debug_array($data->sheets[0]['cells']);
-
-//die();
$this->id = 0;
$num = count($this->header)+1;
- for ($i=18; $c<$data->sheets[0]['numRows']+1; $i++ )
//First data entry on row 18
+ $rows = $data->sheets[0]['numRows']+1;
+ for ($i=18; $i<$rows; $i++ ) //First data entry on row
18
{
$this->currentrecord = array();
@@ -106,11 +102,11 @@
}
if ($valid_data > 0)
{
- $buffer =
$this->import_end_record($invoice_common);
+ $buffer =
$this->import_end_record($buffer,$invoice_common);
$valid_data= False;
- }
$this->id++;
}
+ }
if(!$download)
{
@@ -118,7 +114,6 @@
}
$this->header = array('Bestilling','Fakt.
Nr','Konto','Objekt','Fag/Timer/Matr','MVA','Tjeneste','Belop [kr]');
-
return $buffer;
}
@@ -131,9 +126,9 @@
$this->currentrecord += array($name => $value);
}
- function import_end_record($invoice_common)
+ function import_end_record($buffer,$invoice_common)
{
- $buffer = array();
+ $buffer[$this->id]=array();
while ( list($name, $value) =
each($this->currentrecord))
{
$invoice_date =
date($this->dateformat,mktime(2,0,0,$invoice_common['smonth'],$invoice_common['sday'],$invoice_common['syear']));
@@ -261,7 +256,6 @@
}
}
}
-
return $dima;
}