[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/import Import_fra_Service_xml, 1.11 Impo
From: |
ceb |
Subject: |
[Phpgroupware-cvs] property/inc/import Import_fra_Service_xml, 1.11 Import_fra_Service, 1.11 |
Date: |
Thu, 24 Feb 2005 14:30:44 -0000 |
Update of property/inc/import
Modified Files:
Branch: MAIN
Import_fra_Service_xml lines: +50 -7
Import_fra_Service lines: +49 -7
Log Message:
committed prop-18-branch version to head
====================================================
Index: property/inc/import/Import_fra_Service_xml
diff -u property/inc/import/Import_fra_Service_xml:1.10
property/inc/import/Import_fra_Service_xml:1.11
--- property/inc/import/Import_fra_Service_xml:1.10 Thu Sep 30 12:25:41 2004
+++ property/inc/import/Import_fra_Service_xml Thu Jan 13 16:52:48 2005
@@ -26,6 +26,7 @@
function import_conv()
{
+ $this->db = $GLOBALS['phpgw']->db;
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->soXport =
CreateObject($this->currentapp.'.soXport');
$this->invoice =
CreateObject($this->currentapp.'.boinvoice');
@@ -166,10 +167,7 @@
}
if($name=='spbudact_code')
{
-
if(!$this->soXport->check_spbudact_code(intval($value)))
- {
- $value='';
- }
+ $value =
$this->check_spbudact_code($value);
}
if($name=='fakturanr')
@@ -185,9 +183,10 @@
$value =
$this->soXport->auto_tax($buffer[$this->id]['dima']);
}
- if($buffer[$this->id]['dima'])
+ if($name=='dima')
{
- $buffer[$this->id]['loc1'] =
$loc1=substr($buffer[$this->id]['dima'],0,4);
+ $value = $this->check_dima($value);
+ $buffer[$this->id]['loc1'] =
$loc1=substr($value,0,4);
}
$buffer[$this->id][$name] = $value;
@@ -207,17 +206,61 @@
$buffer[$this->id]['oppsynsmannid'] =
$invoice_common['janitor'];
$buffer[$this->id]['saksbehandlerid'] =
$invoice_common['supervisor'];
$buffer[$this->id]['budsjettansvarligid'] =
$invoice_common['budget_responsible'];
+
if($invoice_common['auto_tax'])
{
$buffer[$this->id]['mvakode'] =
$this->soXport->tax_b_account_override($buffer[$this->id]['mvakode']
,$buffer[$this->id]['spbudact_code']);
$buffer[$this->id]['mvakode'] =
$this->soXport->tax_vendor_override($buffer[$this->id]['mvakode']
,$buffer[$this->id]['spvend_code']);
$buffer[$this->id]['kostra_id'] =
$this->soXport->get_kostra_id($buffer[$this->id]['dima']);
}
-
}
return $buffer;
}
+ function check_spbudact_code($id)
+ {
+ $b_account='';
+ $this->db->query("select id from fm_b_account where
id='$id'");
+ $this->db->next_record();
+ if ($this->db->f('id'))
+ {
+ $b_account = $this->db->f('id');
+ }
+ else
+ {
+ $this->db->query("select id from
fm_b_account_convert where old_id='$id'");
+ $this->db->next_record();
+ $b_account = $this->db->f('id');
+ }
+
+ return $b_account;
+ }
+
+ function check_dima($id)
+ {
+ $loc1=substr($id,0,4);
+ $loc2=substr($id,4,2);
+
+ $this->db->query("select loc1 from fm_location1 where
loc1='$loc1'");
+ $this->db->next_record();
+ if ($this->db->f('loc1'))
+ {
+ $dima = $this->db->f('loc1');
+
+ if ($loc2)
+ {
+ $this->db->query("select location_code
from fm_location2 where loc1='$loc1' AND loc2='$loc2'");
+ $this->db->next_record();
+ if ($this->db->f('location_code'))
+ {
+ $dima =
str_replace('-','',$this->db->f('location_code'));
+ }
+ }
+ }
+
+ return $dima;
+ }
+
function import_end_file($buffer,$bilagsnr)
{
$num = $this->soXport->add($buffer);
====================================================
Index: property/inc/import/Import_fra_Service
diff -u property/inc/import/Import_fra_Service:1.10
property/inc/import/Import_fra_Service:1.11
--- property/inc/import/Import_fra_Service:1.10 Thu Sep 30 12:25:41 2004
+++ property/inc/import/Import_fra_Service Thu Jan 13 16:52:48 2005
@@ -26,6 +26,7 @@
function import_conv()
{
+ $this->db = $GLOBALS['phpgw']->db;
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->soXport =
CreateObject($this->currentapp.'.soXport');
$this->invoice =
CreateObject($this->currentapp.'.boinvoice');
@@ -152,10 +153,7 @@
}
if($name=='spbudact_code')
{
-
if(!$this->soXport->check_spbudact_code(intval($value)))
- {
- $value='';
- }
+ $value =
$this->check_spbudact_code($value);
}
if($name=='fakturanr')
@@ -166,15 +164,15 @@
}
}
-//_debug_array($name);
if($name=='mvakode' &&
$invoice_common['auto_tax'])
{
$value =
$this->soXport->auto_tax($buffer[$this->id]['dima']);
}
- if($buffer[$this->id]['dima'])
+ if($name=='dima')
{
- $buffer[$this->id]['loc1'] =
$loc1=substr($buffer[$this->id]['dima'],0,4);
+ $value = $this->check_dima($value);
+ $buffer[$this->id]['loc1'] =
$loc1=substr($value,0,4);
}
$buffer[$this->id][$name] = $value;
@@ -204,6 +202,50 @@
}
return $buffer;
}
+
+ function check_spbudact_code($id)
+ {
+ $b_account='';
+ $this->db->query("select id from fm_b_account where
id='$id'");
+ $this->db->next_record();
+ if ($this->db->f('id'))
+ {
+ $b_account = $this->db->f('id');
+ }
+ else
+ {
+ $this->db->query("select id from
fm_b_account_convert where old_id='$id'");
+ $this->db->next_record();
+ $b_account = $this->db->f('id');
+ }
+
+ return $b_account;
+ }
+
+ function check_dima($id)
+ {
+ $loc1=substr($id,0,4);
+ $loc2=substr($id,4,2);
+
+ $this->db->query("select loc1 from fm_location1 where
loc1='$loc1'");
+ $this->db->next_record();
+ if ($this->db->f('loc1'))
+ {
+ $dima = $this->db->f('loc1');
+
+ if ($loc2)
+ {
+ $this->db->query("select location_code
from fm_location2 where loc1='$loc1' AND loc2='$loc2'");
+ $this->db->next_record();
+ if ($this->db->f('location_code'))
+ {
+ $dima =
str_replace('-','',$this->db->f('location_code'));
+ }
+ }
+ }
+
+ return $dima;
+ }
function import_end_file($buffer,$bilagsnr)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc/import Import_fra_Service_xml, 1.11 Import_fra_Service, 1.11,
ceb <=
- Prev by Date:
[Phpgroupware-cvs] property/templates/default async.xsl, 1.2 attributes_form.xsl, 1.4 attributes_view.xsl, 1.3 alarm.xsl, 1.2 agreement.xsl, 1.2 actor.xsl, 1.3 admin_entity.xsl, 1.3 b_account.xsl, 1.4 document.xsl, 1.3 values.xsl, 1.3 wo_hour.xsl, 1.3 workorder.xsl, 1.3 project.xsl, 1.6 location_view.xsl, 1.3 entity.xsl, 1.3 invoice.xsl, 1.8 abook_view.xsl, 1.3 abook_form.xsl, 1.3
- Next by Date:
[Phpgroupware-cvs] email/templates/base/images/moz filters-24.png, 1.1 arrow-left-no-24.png, 1.1 compose-message-16.png, 1.1 reply.png, 1.1 spellcheck-24.png, 1.1 arrow-2left-no-24.png, 1.1 address-conduit-24.png, 1.1 arrow-2left-no-16.png, 1.1 search-16.png, 1.1 trash-16.png, 1.1 arrow-right-no-24.png, 1.1 delete-message.png, 1.1 add-attachment-16.png, 1.1 arrow-left-16.png, 1.1 arrow-left-24.png, 1.1 arrow-2left-24.png, 1.1 accounts-24.png, 1.1 send-24.png, 1.1 folder-16.png, 1.1 address-conduit-16.png, 1.1 spellcheck-16.png, 1.1 trash-24.png, 1.1 customize-16.png, 1.1 arrow-right-no-16.png, 1.1 reply-all.png, 1.1 forward.png, 1.1 arrow-left-no-16.png, 1.1 compose-message-24.png, 1.1 arrow-right-16.png, 1.1 arrow-2right-24.png, 1.1 filters-16.png, 1.1 accounts-16.png, 1.1 arrow-2left-16.png, 1.1 add-attachment-24.png, 1.1 search-24.png, 1.1 arrow-2right-no-24.png, 1.1 arrow-2right-no-16.png, 1.1 send-16.png, 1.1 customize-24.png, 1.1 arrow-right-24.png, 1.1 arrow-2right-16.png, 1.1 folder-24.png, 1.1
- Previous by thread:
[Phpgroupware-cvs] property/templates/default async.xsl, 1.2 attributes_form.xsl, 1.4 attributes_view.xsl, 1.3 alarm.xsl, 1.2 agreement.xsl, 1.2 actor.xsl, 1.3 admin_entity.xsl, 1.3 b_account.xsl, 1.4 document.xsl, 1.3 values.xsl, 1.3 wo_hour.xsl, 1.3 workorder.xsl, 1.3 project.xsl, 1.6 location_view.xsl, 1.3 entity.xsl, 1.3 invoice.xsl, 1.8 abook_view.xsl, 1.3 abook_form.xsl, 1.3
- Next by thread:
[Phpgroupware-cvs] email/templates/base/images/moz filters-24.png, 1.1 arrow-left-no-24.png, 1.1 compose-message-16.png, 1.1 reply.png, 1.1 spellcheck-24.png, 1.1 arrow-2left-no-24.png, 1.1 address-conduit-24.png, 1.1 arrow-2left-no-16.png, 1.1 search-16.png, 1.1 trash-16.png, 1.1 arrow-right-no-24.png, 1.1 delete-message.png, 1.1 add-attachment-16.png, 1.1 arrow-left-16.png, 1.1 arrow-left-24.png, 1.1 arrow-2left-24.png, 1.1 accounts-24.png, 1.1 send-24.png, 1.1 folder-16.png, 1.1 address-conduit-16.png, 1.1 spellcheck-16.png, 1.1 trash-24.png, 1.1 customize-16.png, 1.1 arrow-right-no-16.png, 1.1 reply-all.png, 1.1 forward.png, 1.1 arrow-left-no-16.png, 1.1 compose-message-24.png, 1.1 arrow-right-16.png, 1.1 arrow-2right-24.png, 1.1 filters-16.png, 1.1 accounts-16.png, 1.1 arrow-2left-16.png, 1.1 add-attachment-24.png, 1.1 search-24.png, 1.1 arrow-2right-no-24.png, 1.1 arrow-2right-no-16.png, 1.1 send-16.png, 1.1 customize-24.png, 1.1 arrow-right-24.png, 1.1 arrow-2right-16.png, 1.1 folder-24.png, 1.1
- Index(es):