fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11724] property: voucher export


From: Sigurd Nes
Subject: [Fmsystem-commits] [11724] property: voucher export
Date: Wed, 19 Feb 2014 14:16:29 +0000

Revision: 11724
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11724
Author:   sigurdne
Date:     2014-02-19 14:16:28 +0000 (Wed, 19 Feb 2014)
Log Message:
-----------
property: voucher export

Modified Paths:
--------------
    trunk/property/inc/export/default/Agresso_Bergen_Kostfordeling

Modified: trunk/property/inc/export/default/Agresso_Bergen_Kostfordeling
===================================================================
--- trunk/property/inc/export/default/Agresso_Bergen_Kostfordeling      
2014-02-19 14:15:30 UTC (rev 11723)
+++ trunk/property/inc/export/default/Agresso_Bergen_Kostfordeling      
2014-02-19 14:16:28 UTC (rev 11724)
@@ -43,6 +43,7 @@
                protected $db2;
                protected $soXport;
                protected $config;
+               protected $invoice_approval      = 2;
 
                function __construct()
                {
@@ -51,12 +52,21 @@
                        $this->db2               = clone($this->db);
                        $this->soXport   = CreateObject('property.soXport');
                        $this->config    = CreateObject('admin.soconfig', 
$GLOBALS['phpgw']->locations->get_id('property', '.invoice'));
+                       $this->invoice_approval  = 
isset($this->config->config_data['common']['invoice_approval']) && 
$this->config->config_data['common']['invoice_approval'] ? 
$this->config->config_data['common']['invoice_approval'] : 2;
                }
 
                function select_periods_with_invoice_to_transfer()
                {
-                       $sql = "SELECT DISTINCT periode from fm_ecobilag WHERE 
budsjettsigndato is not null and (saksigndato is not null or oppsynsigndato is 
not null) and utbetalingsigndato is not null";
+                       if($this->invoice_approval == 2)
+                       {
+                               $sql = "SELECT DISTINCT periode FROM 
fm_ecobilag WHERE budsjettsigndato IS NOT NULL AND (saksigndato IS NOT NULL or 
oppsynsigndato IS NOT NULL) AND utbetalingsigndato IS NOT NULL";
+                       }
+                       else
+                       {
+                               $sql = "SELECT DISTINCT periode FROM 
fm_ecobilag WHERE budsjettsigndato IS NOT NULL AND utbetalingsigndato IS NOT 
NULL";
+                       }
 
+
                        $periode = array();
                        $this->db->query($sql, __LINE__, __FILE__);
                        while($this->db->next_record())
@@ -449,7 +459,14 @@
 
                private function get_vouchers_to_transfer($periode)
                {
-                       $sql = "SELECT sum(belop) as belop, fakturanr, bilagsnr 
FROM fm_ecobilag WHERE periode='{$periode}' AND budsjettsigndato IS NOT NULL 
AND ( saksigndato IS NOT NULL OR oppsynsigndato IS NOT NULL ) AND 
utbetalingsigndato IS NOT NULL group by bilagsnr, fakturanr";
+                       if($this->invoice_approval == 2)
+                       {
+                               $sql = "SELECT sum(belop) AS belop, fakturanr, 
bilagsnr FROM fm_ecobilag WHERE periode='{$periode}' AND budsjettsigndato IS 
NOT NULL AND ( saksigndato IS NOT NULL OR oppsynsigndato IS NOT NULL ) AND 
utbetalingsigndato IS NOT NULL group by bilagsnr, fakturanr";
+                       }
+                       else
+                       {
+                               $sql = "SELECT sum(belop) AS belop, fakturanr, 
bilagsnr FROM fm_ecobilag WHERE periode='{$periode}' AND budsjettsigndato IS 
NOT NULL  AND utbetalingsigndato IS NOT NULL group by bilagsnr, fakturanr";     
                    
+                       }
 
                        $this->db->query($sql, __LINE__, __FILE__);
 
@@ -767,7 +784,7 @@
                                        $invoice_line['ordrebelop']      = 
$invoice_line[$BelopFelt];
 
                                        $Konto   = sprintf("%-8s", 
$invoice_line['spbudact_code']);// verdi: Art, type: c8, plass: 21 - 28
-                                       $Dim_1   = sprintf("%-8s", 
$invoice_line['dimb']);// 64040 verdi: Ansvarssted, type: c8, plass: 29 - 36
+                                       $Dim_1   = sprintf("%-8s", 
"0{$invoice_line['dimb']}");// 64040 verdi: Ansvarssted, type: c8, plass: 29 - 
36
                                        $Dim_2   = sprintf("%-8s", 
$invoice_line['kostra_id']);// verdi: Tjeneste, type: c8, plass: 37 - 44
                                        $Dim_3   = sprintf("%-8s", 
substr($invoice_line['dima'], 0, 6));// verdi: Objekt-bygg, type: c8, plass: 45 
- 52
 
@@ -816,7 +833,7 @@
                                        if($_key == $last_record)
                                        {
                                                $Konto           = 
sprintf("%-8s", '2139915');// verdi: Art, type: c8, plass: 21 - 28
-                                               $Dim_1           = 
sprintf("%-8s", $invoice_line['dimb']);//sprintf("%-8s",'');// verdi: 
Ansvarssted, type: c8, plass: 29 - 36
+                       //                      $Dim_1           = 
sprintf("%-8s", $invoice_line['dimb']);//sprintf("%-8s",'');// verdi: 
Ansvarssted, type: c8, plass: 29 - 36
                                                $Dim_2           = 
sprintf("%-8s", '');// verdi: Tjeneste, type: c8, plass: 37 - 44
                                                $Dim_3           = 
sprintf("%-8s", '');// verdi: Objekt, type: c8, plass: 45 - 52
                                                $Dim_4           = 
sprintf("%-8s", '');// verdi: Ressurs, type: c8, plass: 53 - 60
@@ -826,7 +843,7 @@
                                                $Fakturanr       = 
sprintf("%-15s", '');// verdi: Fakturanr, type: c15, plass: 283 - 297
                                                $Ordrenummer = sprintf("%-9s", 
'');// verdi: Infodoc ordrenr, type: i4, plass: 342 - 350
                                                //      $Tekst          = 
sprintf("%-50s",'');//sprintf("%-50s",substr($invoice_line['merknad'],0,50));// 
verdi: Tekst, type: text (50), plass: 201 - 250
-                                               $Tekst           = 
sprintf("%-50s", '');// verdi: Tekst, type: text (50), plass: 201 - 250
+                       //                      $Tekst           = 
sprintf("%-50s", '');// verdi: Tekst, type: text (50), plass: 201 - 250
                                                //Ikke fortegnskifte for 
kostfordeling (GL)
                                                if($Belop_motpost < 0)
                                                {




reply via email to

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