fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9182] invoice handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [9182] invoice handling
Date: Wed, 18 Apr 2012 18:35:47 +0000

Revision: 9182
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9182
Author:   sigurdne
Date:     2012-04-18 18:35:47 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
invoice handling

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/js/yahoo/invoice2.index.js
    trunk/property/templates/base/invoice2.xsl

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-04-18 18:35:24 UTC (rev 
9181)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-04-18 18:35:47 UTC (rev 
9182)
@@ -1812,7 +1812,11 @@
 
                public function update_voucher2($data)
                {
-
+                       if(!isset($data['line_id']) || !$data['line_id'])
+                       {
+                               phpgwapi_cache::message_set(lang('select 
invoice'), 'error');
+                               return false;
+                       }
                        $GLOBALS['phpgw']->db->transaction_begin();
                        $value_set = array();
                        
@@ -1827,12 +1831,13 @@
 
                        $value_set_line = array();
 
-                       $value_set_line['pmwrkord_code'] = $data['order_id'];
-                       $value_set_line['dimb'] = $data['dim_b'];
-                       $value_set_line['dima'] = $data['dim_a'];
-                       $value_set_line['mvakode'] = $data['tax_code'];
-                       $value_set_line['project_id'] = $data['project_group'];
-                       $value_set_line['spbudact_code'] = 
$data['b_account_id'];
+                       $value_set_line['pmwrkord_code']        = 
$data['order_id'];
+                       $value_set_line['dimb']                         = 
$data['dim_b'];
+                       $value_set_line['dima']                         = 
$data['dim_a'];
+                       $value_set_line['mvakode']                      = 
$data['tax_code'];
+                       $value_set_line['project_id']           = 
$data['project_group'];
+                       $value_set_line['spbudact_code']        = 
$data['b_account_id'];
+                       $value_set_line['line_text']            = 
$data['line_text'];
 
                        $value_set_line = 
$this->db->validate_update($value_set_line);
                        $this->db->query("UPDATE fm_ecobilag SET 
$value_set_line WHERE id = " . (int)$data['line_id'],__LINE__,__FILE__);
@@ -1960,6 +1965,7 @@
                        }
 
                        $receipt = $this->forward($data);
+                       phpgwapi_cache::message_set(lang('voucher is updated'), 
'message');
 
                        $GLOBALS['phpgw']->db->transaction_commit();
                }

Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-04-18 18:35:24 UTC (rev 
9181)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-04-18 18:35:47 UTC (rev 
9182)
@@ -86,7 +86,7 @@
                        $receipt = array();
                        $voucher_id     = phpgw::get_var('voucher_id', 'int');
                        $line_id        = phpgw::get_var('line_id', 'int');
-                       
+
                        if($values = phpgw::get_var('values'))
                        {
                                $approve = 
execMethod('property.uiinvoice.get_approve_role');
@@ -104,8 +104,6 @@
                                        $receipt = 
$this->bo->update_voucher2($values);
                                }
 
-                               phpgwapi_cache::message_set(lang('voucher is 
updated'), 'message');
-
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uiinvoice2.index', 'voucher_id' => $voucher_id, 
'line_id' => $line_id));
                        }
                        else
@@ -132,10 +130,18 @@
                                        $budget_responsible_list = 
array_merge(array($default), $budget_responsible_list);
                                }
 
+                               $msgbox_data = array();
+                               if( phpgw::get_var('phpgw_return_as') != 'json' 
&& $receipt = phpgwapi_cache::session_get('phpgwapi', 'phpgw_messages'))
+                               {
+                                       
phpgwapi_cache::session_clear('phpgwapi', 'phpgw_messages');
+                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($receipt);
+                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
+                               }
 
                                $user = $GLOBALS['phpgw']->accounts->get( 
$GLOBALS['phpgw_info']['user']['id'] );
 
                                $data = array(
+                                       'msgbox_data'                   => 
$msgbox_data,
                                        'invoice_layout_config' => 
json_encode(execMethod('phpgwapi.template_portico.retrieve_local', 
'invoice_layout_config')),
                                        'preferences_url'       => 
$GLOBALS['phpgw']->link('/preferences/index.php'),
                                        'preferences_text'      => 
lang('preferences'),
@@ -225,7 +231,7 @@
 
                                                        array(
                                                                        'key' 
=> 'line_text',
-                                                                       'label' 
=> lang('text'),
+                                                                       'label' 
=> lang('invoice line text'),
                                                                        
'sortable' => false,
                                                                        
'formatter' => 'FormatterCenter',
                                                        ),
@@ -301,7 +307,7 @@
                                $entry['approve_line'] = "<input 
id=\"approve_line\" type =\"radio\" {$_checked} name=\"values[approve]\" 
value=\"{$entry['id']}\">";
                                $entry['split'] = "<input type =\"text\" 
name=\"values[split_amount][{$entry['id']}]\" value=\"\" size=\"8\">";
                                
-                               $entry['line_text'] = "<input type =\"text\" 
name=\"values[line_text][{$entry['id']}]\" value=\"{$entry['line_text']}\" 
size=\"20\">";
+                       //      $entry['line_text'] = "<input type =\"text\" 
name=\"values[line_text][{$entry['id']}]\" value=\"{$entry['line_text']}\" 
size=\"20\">";
                                $entry['approved_amount'] = "<input type 
=\"text\" name=\"values[approved_amount][{$entry['id']}]\" 
value=\"{$entry['approved_amount']}\" size=\"8\">";
                                $results['results'][]= $entry;
                        }
@@ -500,7 +506,7 @@
                                        $voucher[0]['image_url']        = 
$_image_url;
                                }
                                $voucher_info['generic']['process_log'] = 
$voucher[0]['process_log'];
-//                             $voucher[0]['image_url']        = 
'';//'http://www.nettavisen.no/';
+       //                      $voucher[0]['image_url']        = 
'http://www.nettavisen.no/';
                        }
                        else
                        {

Modified: trunk/property/js/portico/ajax_invoice.js
===================================================================
--- trunk/property/js/portico/ajax_invoice.js   2012-04-18 18:35:24 UTC (rev 
9181)
+++ trunk/property/js/portico/ajax_invoice.js   2012-04-18 18:35:47 UTC (rev 
9182)
@@ -156,6 +156,7 @@
                $("#voucher_id").val( '' );
                $("#voucher_id_text").html( '' );
                $("#line_id").val( '' );
+               $("#line_text").val( '' );
                $("#order_id").val( '' );
                $("#project_group").val( '' );
                $("#invoice_id").html( '' );
@@ -262,6 +263,7 @@
                                        $("#process_log").html( 
data['generic'].process_log );
                                        $("#my_initials").val( 
data['generic'].my_initials );
                                        $("#sign_orig").val( 
data['generic'].sign_orig );
+                                       $("#line_text").val( 
voucher[0].line_text );
 
                //                      $("#oppsynsigndato").html( 
voucher[0].oppsynsigndato );
                //                      $("#saksigndato").html( 
voucher[0].saksigndato );
@@ -453,6 +455,7 @@
                                }
                                else
                                {
+                                       $("#line_text").val( '' );
                                        $("#voucher_id").val( '' );
                                        $("#voucher_id_text").html( '' );
                                        $("#order_id").val( '' );

Modified: trunk/property/js/yahoo/invoice2.index.js
===================================================================
--- trunk/property/js/yahoo/invoice2.index.js   2012-04-18 18:35:24 UTC (rev 
9181)
+++ trunk/property/js/yahoo/invoice2.index.js   2012-04-18 18:35:47 UTC (rev 
9182)
@@ -77,7 +77,7 @@
        {
                var DOM = YAHOO.util.Dom;
 //             var layouts = Array( 'north', 'west', 'center', 'south' );
-               var layouts = Array( 'north', 'west', 'center' );
+               var layouts = Array( 'north', 'center', 'east' );
                var layout = Array();
 
                // Collect layout units for border layout
@@ -94,7 +94,7 @@
 
                if( typeof this.config.unitRightWidth == 'undefined' )
                {
-                       this.config.unitRightWidth = 6;
+                       this.config.unitRightWidth = 600;
                }       
                
                this.layout = new YAHOO.widget.Layout({
@@ -102,8 +102,8 @@
                        minHeight: 400,
             units: [
                                { position: 'top', body: layout['north'], 
height: 26 },
-                               { position: 'left', header: this.getHeader( 
layout['west'] ), body: layout['west'], width: this.config.unitLeftWidth, 
resize: true, scroll: true, gutter: "5px", collapse: true,  maxWidth: 1200, 
minWidth: 400 },
-                { position: 'center', header: this.getHeader( layout['center'] 
), body: layout['center'], scroll: true, gutter: "5px 0px" }
+                { position: 'center', header: this.getHeader( layout['center'] 
), body: layout['center'], scroll: true, gutter: "5px 0px" },
+                               { position: 'right', header: this.getHeader( 
layout['east'] ), body: layout['east'], width: this.config.unitRightWidth, 
resize: true, scroll: true, gutter: "5px", collapse: true,  maxWidth: 1200, 
minWidth: 400 },
             ]
         });
 

Modified: trunk/property/templates/base/invoice2.xsl
===================================================================
--- trunk/property/templates/base/invoice2.xsl  2012-04-18 18:35:24 UTC (rev 
9181)
+++ trunk/property/templates/base/invoice2.xsl  2012-04-18 18:35:47 UTC (rev 
9182)
@@ -46,13 +46,7 @@
 
 </style>
 
-
-<div class="yui-navset yui-navset-top" id="pending_for_approval_tabview">
-       <div class="identifier-header">
-               <h1><xsl:value-of select="php:function('lang', 
'invoice')"/></h1>
-       </div>
-       <xsl:call-template name="invoice" />
-</div>
+<xsl:call-template name="invoice" />
        
 </xsl:template>
 
@@ -90,19 +84,25 @@
                                        </div>
                                </div>
 
-                       <div class="layout-west">
+                       <div class="layout-center">
                                <div class="header">
-                                       <h2>faktura</h2>
+                                       <h2><xsl:value-of 
select="php:function('lang', 'invoice')"/></h2>
                                </div>
+                       <xsl:choose>
+                               <xsl:when test="msgbox_data != ''">
+                                       <xsl:call-template name="msgbox"/>
+                               </xsl:when>
+                       </xsl:choose>
+
                                <div class="body">
                                        <div id="voucher_details">
                                                <xsl:call-template 
name="yui_phpgw_i18n"/>
-                                               <table>
+                                               <table align = "center" 
width="95%">
                                                        <xsl:apply-templates 
select="filter_form" />
                                                        <xsl:apply-templates 
select="filter_invoice" />
                                                </table>
                                                <form action="#" 
name="voucher_form" id="voucher_form" method="post">
-                                                       <table>
+                                               <table align = "center" 
width="95%">
                                                                <tr>
                                                                        <td 
colspan = '6'>
                                                                                
<xsl:apply-templates select="paging"/>
@@ -116,7 +116,7 @@
                                        </div>
                                </div>
                        </div>
-                       <div class="layout-center">
+                       <div class="layout-east">
                                <div class="header">
                                        <h2>Bilde</h2>
                                </div>
@@ -402,6 +402,14 @@
                </tr>
                <tr class ='row_off'>
                        <td>
+                               <xsl:value-of select="php:function('lang', 
'invoice line text')" />
+                       </td>
+                       <td>
+                               <input type="text" name="values[line_text]" 
id="line_text" value="{voucher_info/voucher/line_text}"/>
+                       </td>
+               </tr>
+               <tr class ='row_off'>
+                       <td>
                                <xsl:value-of select="php:function('lang', 
'close order')" />
                        </td>
                        <td>




reply via email to

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