fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9160] property: image of invoice


From: Sigurd Nes
Subject: [Fmsystem-commits] [9160] property: image of invoice
Date: Mon, 16 Apr 2012 17:21:31 +0000

Revision: 9160
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9160
Author:   sigurdne
Date:     2012-04-16 17:21:31 +0000 (Mon, 16 Apr 2012)
Log Message:
-----------
property: image of invoice

Modified Paths:
--------------
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice2.inc.php
    trunk/property/js/portico/ajax_invoice.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/invoice2.xsl

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-04-16 16:09:32 UTC (rev 
9159)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-04-16 17:21:31 UTC (rev 
9160)
@@ -1977,11 +1977,12 @@
                                $where = 'AND';
                        }
 
-                       $sql = "SELECT DISTINCT bilagsnr,bilagsnr_ut, org_name, 
currency, kreditnota, fm_ecoart.descr as type, sum(godkjentbelop) as 
godkjentbelop FROM fm_ecobilag"
+                       $sql = "SELECT DISTINCT bilagsnr,bilagsnr_ut, org_name, 
currency, kreditnota, fm_ecoart.descr as type, sum(godkjentbelop) as 
godkjentbelop, oppsynsigndato, saksigndato,budsjettsigndato"
+                       ." FROM fm_ecobilag"
                        ." {$this->join} fm_vendor ON fm_vendor.id = 
fm_ecobilag.spvend_code"
                        ." {$this->join} fm_ecoart ON fm_ecoart.id = 
fm_ecobilag.artid"
                        ." $filtermethod $querymethod"
-                       ." GROUP BY bilagsnr,bilagsnr_ut, org_name, currency, 
kreditnota, fm_ecoart.descr";
+                       ." GROUP BY bilagsnr,bilagsnr_ut, org_name, currency, 
kreditnota, fm_ecoart.descr, oppsynsigndato, saksigndato,budsjettsigndato";
 
                        $lang_voucer = lang('voucher id');
                        $lang_vendor = lang('vendor');
@@ -1995,14 +1996,29 @@
 
                        while($this->db->next_record())
                        {
+                               $status = 'O';
+                               if($this->db->f('budsjettsigndato'))
+                               {
+                                       $status = 'C';
+                               }
+                               else if($this->db->f('saksigndato'))
+                               {
+                                       $status = 'B';
+                               }
+                               else if($this->db->f('oppsynsigndato'))
+                               {
+                                       $status = 'A';
+                               }
+                               
                                $voucher_id = $this->db->f('bilagsnr_ut') ? 
$this->db->f('bilagsnr_ut') : $this->db->f('bilagsnr');
-                               $name = sprintf("{$lang_voucer}:% 8s | 
{$lang_vendor}:% 20s | {$lang_currency}:% 3s | {$lang_parked}: % 1s | 
{$lang_type}: % 12s | {$lang_approved_amount}: % 19s",
+                               $name = sprintf("{$lang_voucer}:% 8s | 
{$lang_vendor}:% 20s | {$lang_currency}:% 3s | {$lang_parked}: % 1s | 
{$lang_type}: % 12s | {$lang_approved_amount}: % 19s | Status: % 1s",
                                                        $voucher_id,
                                                        
trim(strtoupper($this->db->f('org_name',true))),
                                                        
$this->db->f('currency'),
                                                        
$this->db->f('kreditnota') ? 'X' : '',
                                                        $this->db->f('type'),
-                                                       
number_format($this->db->f('godkjentbelop'), 2, ',', ' ')
+                                                       
number_format($this->db->f('godkjentbelop'), 2, ',', ' '),
+                                                       $status
                                                );
 
                                $values[] = array

Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-04-16 16:09:32 UTC (rev 
9159)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-04-16 17:21:31 UTC (rev 
9160)
@@ -403,9 +403,10 @@
 
                                if($voucher[0]['external_ref'])
                                {
-                                       $voucher[0]['external_ref'] = " <a 
href=\"javascript:openwindow('{$baseurl_invoice}{$voucher[0]['external_ref']}','640','800')\"
 >" . lang('invoice number') . '</a>';
+                                       $_image_url = 
"{$baseurl_invoice}{$voucher[0]['external_ref']}";
+                                       $voucher[0]['external_ref'] = " <a 
href=\"javascript:openwindow('{$_image_url}','640','800')\" >" . lang('invoice 
number') . '</a>';
+                                       $voucher[0]['image_url']        = 
$_image_url;
                                }
-
                                $voucher_info['generic']['process_log'] = 
$voucher[0]['process_log'];
                        }
                        else

Modified: trunk/property/js/portico/ajax_invoice.js
===================================================================
--- trunk/property/js/portico/ajax_invoice.js   2012-04-16 16:09:32 UTC (rev 
9159)
+++ trunk/property/js/portico/ajax_invoice.js   2012-04-16 17:21:31 UTC (rev 
9160)
@@ -196,10 +196,12 @@
                                        if(voucher[0].external_ref)
                                        {
                                                
$("#invoice_id_text").html(voucher[0].external_ref );
+                                               
document.getElementById('image_content').src = voucher[0].image_url;
                                        }
                                        else
                                        {
                                                
$("#invoice_id_text").html('FakturaNr');
+                                               
document.getElementById('image_content').src = '';
                                        }
 
                                        $("#invoice_id").html( 
voucher[0].invoice_id );
@@ -443,6 +445,7 @@
                                        $("#approve_as").html( 
"<option>Velg</option>" );
                                        $("#order_text").html( 'Bestilling' );
                                        $("#invoice_id_text").html('FakturaNr');
+                                       
document.getElementById('image_content').src = '';
                                }
                        }
                        });

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2012-04-16 16:09:32 UTC (rev 9159)
+++ trunk/property/setup/phpgw_no.lang  2012-04-16 17:21:31 UTC (rev 9160)
@@ -1164,6 +1164,7 @@
 owner type     property        no      Eiertype
 paid   property        no      Betalt
 paid percent   property        no      Prosentvis betalt
+parked property        no      Parkert
 park invoice   property        no      Parker faktura
 part of town   property        no      Bydel
 part of town id        property        no      Bydel

Modified: trunk/property/templates/base/invoice2.xsl
===================================================================
--- trunk/property/templates/base/invoice2.xsl  2012-04-16 16:09:32 UTC (rev 
9159)
+++ trunk/property/templates/base/invoice2.xsl  2012-04-16 17:21:31 UTC (rev 
9160)
@@ -55,25 +55,43 @@
        <xsl:call-template name="common"/>
 
        <div class="yui-content">
-               <div id="voucher_details">
-                       <xsl:call-template name="yui_phpgw_i18n"/>
-                       <table>
-                               <xsl:apply-templates select="filter_form" />
-                               <xsl:apply-templates select="filter_invoice" />
-                       </table>
-                       <form action="#" name="voucher_form" id="voucher_form" 
method="post">
-                       <table>
-                               <xsl:call-template name="voucher_fields" />
-                               <xsl:call-template name="approve"/>
-                               <tr>
-                                       <td colspan = '6'>
-                                               <xsl:apply-templates 
select="paging"/>
-                                               <xsl:apply-templates 
select="datatable"/>
-                                       </td>
-                               </tr>
-                       </table>
-                       </form>
-               </div>
+               <table>
+                       <tr>
+                               <td>
+                                       <div id="voucher_details">
+                                               <xsl:call-template 
name="yui_phpgw_i18n"/>
+                                               <table>
+                                                       <xsl:apply-templates 
select="filter_form" />
+                                                       <xsl:apply-templates 
select="filter_invoice" />
+                                               </table>
+                                               <form action="#" 
name="voucher_form" id="voucher_form" method="post">
+                                                       <table>
+                                                               
<xsl:call-template name="voucher_fields" />
+                                                               
<xsl:call-template name="approve"/>
+                                                               <tr>
+                                                                       <td 
colspan = '6'>
+                                                                               
<xsl:apply-templates select="paging"/>
+                                                                               
<xsl:apply-templates select="datatable"/>
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
+                                               </form>
+                                       </div>
+                               </td>
+                               <td>
+                                       <div id="image">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="voucher_info/voucher/image_url  != ''">
+                                                               <iframe 
id="image_content" width="400" height="500" src = 
"{voucher_info/voucher/image_url}" ><p>Your browser does not support 
iframes.</p></iframe>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <iframe 
id="image_content" width="400" height="500" ><p>Your browser does not support 
iframes.</p></iframe>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </div>
+                               </td>
+                       </tr>
+               </table>
        </div>
 </xsl:template>
 




reply via email to

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