phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/export/Agresso, 1.13.2.5


From: nomail
Subject: [Phpgroupware-cvs] property/inc/export/Agresso, 1.13.2.5
Date: Mon, 13 Dec 2004 17:09:09 +0100

Update of /property/inc/export
Modified Files:
        Branch: proposed-0_9_18-branch
          Agresso

date: 2004/12/13 16:09:09;  author: sigurdne;  state: Exp;  lines: +18 -18

Log Message:
no message
=====================================================================
Index: property/inc/export/Agresso
diff -u property/inc/export/Agresso:1.13.2.4 
property/inc/export/Agresso:1.13.2.5
--- property/inc/export/Agresso:1.13.2.4        Wed Nov  3 13:56:26 2004
+++ property/inc/export/Agresso Mon Dec 13 16:09:09 2004
@@ -56,8 +56,8 @@
                function increment_batchid()
                {
 
-                       $this->db->query("update fm_idgenerator  set value = 
value + 1 where name = 'Ecobatchid'");
-                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'");
+                       $this->db->query("update fm_idgenerator  set value = 
value + 1 where name = 'Ecobatchid'",__LINE__,__FILE__);
+                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $bilagsnr = $this->db->f('value');
                        return $bilagsnr;
@@ -67,7 +67,7 @@
                function next_batchid()
                {
 
-                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'");
+                       $this->db->query("select value from fm_idgenerator  
where name = 'Ecobatchid'",__LINE__,__FILE__);
                        $this->db->next_record();
                        $batchid = $this->db->f('value')+1;
 
@@ -85,7 +85,7 @@
                function get_vendor_info($vendor_id='')
                {
                        $sql = "select org_nr,konto_nr from fm_vendor where 
id='$vendor_id'";
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
 
                        $vendor_info= array(
@@ -99,20 +99,20 @@
                function get_order_title($order_id='')
                {
                        $sql = "select type from fm_orders where 
id='$order_id'";
-                       $this->db->query($sql);
+                       $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
 
                        switch($this->db->f('type'))
                        {
                                case 'workorder':
                                        $sql2 = "select title from fm_workorder 
where id='$order_id'";
-                                       $this->db->query($sql2);
+                                       
$this->db->query($sql2,__LINE__,__FILE__);
                                        $this->db->next_record();
                                        $order_title = $this->db->f('title');
                                        break;
                                case 's_agreement':
                                        $sql2 = "select descr as title from 
fm_s_agreement where id='$order_id'";
-                                       $this->db->query($sql2);
+                                       
$this->db->query($sql2,__LINE__,__FILE__);
                                        $this->db->next_record();
                                        $order_title = $this->db->f('title');
                                        break;
@@ -268,7 +268,7 @@
 //                     $download = 'on';
 //                     $download = False;
                        $pre_transfer=True;
-                       $this->debug=False;
+//                     $this->debug=True;
 
                        //Generer batch ID
                        $batchid = $this->soXport->next_batchid();
@@ -282,12 +282,15 @@
                        //Velg ut alle perioder som har bilag som skal overføres
 
 
-                       $periode = 
$this->select_periods_with_invoice_to_transfer($pre_transfer);
-
-                       for ($i=0;$i<count($periode);$i++)
+                       if ($pre_transfer)
                        {
+                               $periode = 
$this->select_periods_with_invoice_to_transfer($pre_transfer);
 
-                               $receipt['message'][]= array('msg' => 
$this->OverforPeriode($batchid,$periode[$i],$download,$pre_transfer));
+                               for ($i=0;$i<count($periode);$i++)
+                               {
+       
+                                       $receipt['message'][]= array('msg' => 
$this->OverforPeriode($batchid,$periode[$i],$download,$pre_transfer));
+                               }
                        }
 
 
@@ -502,10 +505,9 @@
                        }
                        
                        //Velg ut alle hoved bilag som skal overføres
-               
+
                        
$oRsBilag=$this->soXport->hoved_bilag($periode,$pre_transfer);
                                                                        
-
                        $bilag_count= count($oRsBilag);
                        for ($k=0;$k<$bilag_count;$k++)
                        {                               
@@ -586,7 +588,6 @@
                                $Bet_mottager   = sprintf("%-8s",'');// verdi: 
Blank, type: c8, plass: 416 - 423
                                $Att_ansvarlig  = 
sprintf("%-6s",$oRsBilag[$k]['saksbehandler']);// verdi: Blank, type: c6, 
plass: 424 - 429
 
-
                                $vendor_info = 
$this->get_vendor_info($oRsBilag[$k]['spvend_code']);
                                
                                if(!$vendor_info['org_nr'])
@@ -618,7 +619,6 @@
                                
$oRsUnderbilag=$this->soXport->select_underbilag($oRsBilag[$k]['bilagsnr']);    
        
 
 
-//_debug_array($oRsUnderbilag);
                                $underbilag_count= count($oRsUnderbilag);
                                $last_record = $underbilag_count - 1;
 
@@ -822,7 +822,7 @@
                        //Fullfør transaksjon
                        
                
-                       if ($download=='on' && !$pre_transfer):
+                       if ($download=='on' && !$pre_transfer && !$this->debug):
                        {
                                $fp = fopen($Filnavn, "wb");
                                fwrite($fp,$buffer);
@@ -842,7 +842,7 @@
                                        $message = 'Noe gikk galt med 
overføring av godkjendte fakturaer!';                             
                                }
                        }
-                       elseif($download=='on' && $pre_transfer):
+                       elseif($download=='on' && $pre_transfer && 
!$this->debug):
                        {
                                $fp = fopen($Filnavn, "wb");
                                fwrite($fp,$buffer);




reply via email to

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