fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11083] property: allow minor changes to historical i


From: Sigurd Nes
Subject: [Fmsystem-commits] [11083] property: allow minor changes to historical invoices
Date: Sun, 28 Apr 2013 11:06:51 +0000

Revision: 11083
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11083
Author:   sigurdne
Date:     2013-04-28 11:06:50 +0000 (Sun, 28 Apr 2013)
Log Message:
-----------
property: allow minor changes to historical invoices

Modified Paths:
--------------
    trunk/property/inc/class.boinvoice.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice.inc.php
    trunk/property/js/yahoo/property.js
    trunk/property/templates/base/invoice.xsl

Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php  2013-04-26 12:43:35 UTC (rev 
11082)
+++ trunk/property/inc/class.boinvoice.inc.php  2013-04-28 11:06:50 UTC (rev 
11083)
@@ -235,9 +235,9 @@
                        return $this->so->update_invoice_sub($values);
                }
 
-               function update_single_line($values)
+               function update_single_line($values, $paid = false)
                {
-                       return $this->so->update_single_line($values);
+                       return $this->so->update_single_line($values, $paid);
                }
 
                function select_account_class($selected='')
@@ -770,9 +770,9 @@
                        return $values;
                }
 
-               public function get_single_line($id)
+               public function get_single_line($id, $paid = false)
                {
-                       $line = $this->so->get_single_line($id);
+                       $line = $this->so->get_single_line($id, $paid);
 
                        $soXport    = CreateObject('property.soXport');
                        $soworkorder = CreateObject('property.soworkorder');

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2013-04-26 12:43:35 UTC (rev 
11082)
+++ trunk/property/inc/class.soinvoice.inc.php  2013-04-28 11:06:50 UTC (rev 
11083)
@@ -935,13 +935,33 @@
                        return $receipt;
                }
 
-               function update_single_line($values)
+               function update_single_line($values, $paid = false)
                {
-                       $table ='fm_ecobilag';
+                       $this->db->transaction_begin();
+
                        $id = (int)$values['id'];
 
-                       $this->db->transaction_begin();
+                       $table ='fm_ecobilag';
 
+                       if($paid) // only minor corrections are allowed
+                       {
+                               $table = 'fm_ecobilagoverf';
+
+                               $value_set = array
+                               (
+               //                      'project_id'    => 
$values['project_group'] ? $values['project_group'] : '',
+                                       'pmwrkord_code' => $values['order_id'],
+               //                      'process_log'   => 
$this->db->db_addslashes($values['process_log']),
+               //                      'process_code'  => 
$values['process_code'],
+                               );
+
+                               $value_set      = 
$this->db->validate_update($value_set);
+
+                               $this->db->query("UPDATE {$table} SET 
$value_set WHERE id= {$id}" ,__LINE__,__FILE__);
+
+                               return $this->db->transaction_commit();
+                       }
+
                        if( $values['approve'] != $values['sign_orig'] )
                        {
                                switch ( $values['sign_orig'] )
@@ -973,12 +993,6 @@
                                                break;
                                }
 
-       //                      $sql ="SELECT bilagsnr FROM {$table} WHERE id= 
{$id}";
-       //                      $this->db->query($sql,__LINE__,__FILE__);
-       //                      $this->db->next_record();
-       //                      $bilagsnr = (int)$this->db->f('bilagsnr');
-       //                      $value_set      = 
$this->db->validate_update($value_set);
-       //                      $this->db->query("UPDATE {$table} SET 
$value_set WHERE bilagsnr= {$bilagsnr}" ,__LINE__,__FILE__);
 
                                if(isset($value_set['budsjettansvarligid']) && 
!$value_set['budsjettansvarligid'])
                                {
@@ -1054,7 +1068,7 @@
                                $this->db->query("UPDATE {$table} SET 
$value_set WHERE id= {$new_id}" ,__LINE__,__FILE__);
                        }
 
-                       $this->db->transaction_commit();
+                       return $this->db->transaction_commit();
                }
 
                function read_remark($id='',$paid='')
@@ -1412,9 +1426,13 @@
                        $this->db->query("DELETE FROM fm_ecobilag WHERE 
bilagsnr ='" . $bilagsnr  ."'",__LINE__,__FILE__);
                }
 
-               function read_single_voucher($bilagsnr = 0, $id = 0)
+               function read_single_voucher($bilagsnr = 0, $id = 0, $paid = 
false)
                {
                        $table = 'fm_ecobilag';
+                       if($paid)
+                       {
+                               $table = 'fm_ecobilagoverf';
+                       }
 
                        $bilagsnr =(int)$bilagsnr;
                        $id = (int)$id;
@@ -1803,9 +1821,9 @@
                }
 
 
-               public function get_single_line($id)
+               public function get_single_line($id,$paid = false)
                {
-                       $line = $this->read_single_voucher(0, $id);
+                       $line = $this->read_single_voucher(0, $id, $paid);
                        return $line[0];
                }
 

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2013-04-26 12:43:35 UTC (rev 
11082)
+++ trunk/property/inc/class.uiinvoice.inc.php  2013-04-28 11:06:50 UTC (rev 
11083)
@@ -2210,7 +2210,8 @@
                                                        'menuaction'            
=> 'property.uiinvoice.edit',
                                                        'voucher_id'            
=> $voucher_id,
                                                        'user_lid'              
        => $this->user_lid,
-                                                       'target'                
        => '_lightbox'
+                                                       'target'                
        => '_tinybox',
+                                                       'paid'                  
        => $paid
                                                )),
                                                'parameters'    => $parameters
                                        );
@@ -2260,6 +2261,12 @@
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
 
+
+                       $GLOBALS['phpgw']->js->validate_file( 'tinybox2', 
'packed', 'phpgwapi' );
+                       
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css');
+
+
+
                        //Title of Page
                        $appname = lang('location');
                        if ($paid)
@@ -2285,6 +2292,7 @@
                {
                        $GLOBALS['phpgw_info']['flags']['noframework'] =  true;
 
+                       $paid           = phpgw::get_var('paid', 'bool');
                        $id                     = phpgw::get_var('id', 'int', 
'GET' , 0);
                        $user_lid       = phpgw::get_var('user_lid', 'string', 
'GET');
                        $voucher_id     = phpgw::get_var('voucher_id', 'int', 
'GET');
@@ -2349,11 +2357,11 @@
                                {
                                        $redirect = true;
                                        $values['id'] = $id;
-                                       $line = 
$this->bo->update_single_line($values);
+                                       $line = 
$this->bo->update_single_line($values,$paid);
                                }
                        }
 
-                       $line = $this->bo->get_single_line($id);
+                       $line = $this->bo->get_single_line($id, $paid);
 
 //                     _debug_array($line);
 
@@ -2437,7 +2445,7 @@
 
                        $data = array
                        (
-                                       'redirect'                              
=> $redirect ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiinvoice.list_sub', 'user_lid' => $user_lid, 'voucher_id' => 
$voucher_id)) : null,
+                                       'redirect'                              
=> $redirect ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiinvoice.list_sub', 'user_lid' => $user_lid, 'voucher_id' => 
$voucher_id, 'paid' => $paid)) : null,
                                        'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)),
                                        'from_name'                             
=> $GLOBALS['phpgw_info']['user']['fullname'],
                                        'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiinvoice.edit', 'id' => $id, 'user_lid' => $user_lid, 'voucher_id' 
=> $voucher_id)),
@@ -2451,7 +2459,8 @@
                                        'value_amount'                  => 
$line['amount'],
                                        'value_approved_amount' => 
$line['approved_amount'],
                                        'value_currency'                => 
$line['currency'],
-                                       'value_process_log'             =>  
isset($values['process_log']) && $values['process_log'] ? 
$values['process_log'] : $line['process_log']
+                                       'value_process_log'             => 
isset($values['process_log']) && $values['process_log'] ? 
$values['process_log'] : $line['process_log'],
+                                       'paid'                                  
=> $paid
                        );
 
                        $GLOBALS['phpgw']->xslttpl->add_file('invoice');

Modified: trunk/property/js/yahoo/property.js
===================================================================
--- trunk/property/js/yahoo/property.js 2013-04-26 12:43:35 UTC (rev 11082)
+++ trunk/property/js/yahoo/property.js 2013-04-28 11:06:50 UTC (rev 11083)
@@ -1483,7 +1483,7 @@
                iframe:sUrl,
                boxid:'frameless',
                width:750,
-               height:450,
+               height:500,
                fixed:false,
                maskid:'darkmask',
                maskopacity:40,

Modified: trunk/property/templates/base/invoice.xsl
===================================================================
--- trunk/property/templates/base/invoice.xsl   2013-04-26 12:43:35 UTC (rev 
11082)
+++ trunk/property/templates/base/invoice.xsl   2013-04-28 11:06:50 UTC (rev 
11083)
@@ -1376,6 +1376,7 @@
                        </xsl:when>
                </xsl:choose>
                <form name="form" method="post" action="{form_action}">
+                       <input type="hidden" name="paid" value="{paid}"/>
                        <table cellpadding="0" cellspacing="0" width="100%">
                                <xsl:choose>
                                        <xsl:when test="msgbox_data != ''">
@@ -1386,6 +1387,21 @@
                                                </tr>
                                        </xsl:when>
                                </xsl:choose>
+                               <tr>
+                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
+                                               <xsl:value-of 
select="php:function('lang', 'order id')"/>
+                                       </td>
+                                       <td align="left" class="th_text" 
valign="top">
+                                               <input type="text" 
name="values[order_id]" value="{order_id}">
+                                                       <xsl:attribute 
name="size">
+                                                               
<xsl:text>20</xsl:text>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'order id')"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                               </tr>
 
                                <xsl:for-each select="approved_list">
                                        <tr>
@@ -1401,121 +1417,111 @@
                                                </td>
                                        </tr>
                                </xsl:for-each>                         
-                               <tr>
-                                       <input type="hidden" 
name="values[sign_orig]" value="{sign_orig}"/>
-                                       <input type="hidden" 
name="values[my_initials]" value="{my_initials}"/>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'approve')"/>
-                                       </td>
-                                       <td class="th_text" valign="top" 
align="left">
-                                               <select name="values[approve]">
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'grant')"/>
-                                                       </xsl:attribute>
-                                                       <option value="">
-                                                               <xsl:value-of 
select="php:function('lang', 'select')"/>
-                                                       </option>
-                                                       <xsl:apply-templates 
select="approve_list"/>
-                                               </select>
-                                       </td>
-                               </tr>
+                               <xsl:choose>
+                                       <xsl:when test="paid = ''">
+                                               <tr>
+                                                       <input type="hidden" 
name="values[sign_orig]" value="{sign_orig}"/>
+                                                       <input type="hidden" 
name="values[my_initials]" value="{my_initials}"/>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
+                                                               <xsl:value-of 
select="php:function('lang', 'approve')"/>
+                                                       </td>
+                                                       <td class="th_text" 
valign="top" align="left">
+                                                               <select 
name="values[approve]">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'grant')"/>
+                                                                       
</xsl:attribute>
+                                                                       <option 
value="">
+                                                                               
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                                       
</option>
+                                                                       
<xsl:apply-templates select="approve_list"/>
+                                                               </select>
+                                                       </td>
+                                               </tr>
 
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'voucher process code')"/>
-                                       </td>
-                                       <td align="left" class="th_text" 
valign="top">
-                                               <select 
name="values[process_code]">
-                                                       <xsl:attribute 
name="title">
+                                               <tr>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
                                                                <xsl:value-of 
select="php:function('lang', 'voucher process code')"/>
-                                                       </xsl:attribute>
-                                                       <option value="">
-                                                               <xsl:value-of 
select="php:function('lang', 'voucher process code')"/>
-                                                       </option>
-                                                       <xsl:apply-templates 
select="process_code_list"/>
-                                               </select>
-                                       </td>
-                               </tr>
-                               <xsl:call-template name="project_group_form"/>
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'order id')"/>
-                                       </td>
-                                       <td align="left" class="th_text" 
valign="top">
-                                               <input type="text" 
name="values[order_id]" value="{order_id}">
-                                                       <xsl:attribute 
name="size">
-                                                               
<xsl:text>20</xsl:text>
-                                                       </xsl:attribute>
-                                                       <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="php:function('lang', 'order id')"/>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'voucher process log')"/>
-                                       </td>
-                                       <td align="left">
-                                               <textarea cols="60" rows="10" 
name="values[process_log]" wrap="virtual">
-                                                       <xsl:attribute 
name="title">
+                                                       </td>
+                                                       <td align="left" 
class="th_text" valign="top">
+                                                               <select 
name="values[process_code]">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'voucher process code')"/>
+                                                                       
</xsl:attribute>
+                                                                       <option 
value="">
+                                                                               
<xsl:value-of select="php:function('lang', 'voucher process code')"/>
+                                                                       
</option>
+                                                                       
<xsl:apply-templates select="process_code_list"/>
+                                                               </select>
+                                                       </td>
+                                               </tr>
+                                               <xsl:call-template 
name="project_group_form"/>
+                                               <tr>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
                                                                <xsl:value-of 
select="php:function('lang', 'voucher process log')"/>
-                                                       </xsl:attribute>
-                                                       <xsl:value-of 
select="value_process_log"/>
-                                               </textarea>
-                                       </td>
-                               </tr>
+                                                       </td>
+                                                       <td align="left">
+                                                               <textarea 
cols="60" rows="10" name="values[process_log]" wrap="virtual">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'voucher process log')"/>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:value-of select="value_process_log"/>
+                                                               </textarea>
+                                                       </td>
+                                               </tr>
 
 
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'approved amount')"/>
-                                       </td>
-                                       <td align="left" class="th_text" 
valign="top">
-                                               <input type="text" 
name="values[approved_amount]" value="{value_approved_amount}">
-                                                       <xsl:attribute 
name="size">
-                                                               
<xsl:text>20</xsl:text>
-                                                       </xsl:attribute>
-                                                       <xsl:attribute 
name="title">
+                                               <tr>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
                                                                <xsl:value-of 
select="php:function('lang', 'approved amount')"/>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </td>
-                               </tr>
+                                                       </td>
+                                                       <td align="left" 
class="th_text" valign="top">
+                                                               <input 
type="text" name="values[approved_amount]" value="{value_approved_amount}">
+                                                                       
<xsl:attribute name="size">
+                                                                               
<xsl:text>20</xsl:text>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'approved amount')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </td>
+                                               </tr>
 
 
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'split line')"/>
-                                       </td>
-                                       <td align="left" valign="top">
-                                               <input type="checkbox" 
name="values[split_line]" value="1">
-                                                       <xsl:attribute 
name="title">
+                                               <tr>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
                                                                <xsl:value-of 
select="php:function('lang', 'split line')"/>
-                                                       </xsl:attribute>
-                                               </input>
-                                               <xsl:text> [ </xsl:text>
-                                               <xsl:value-of 
select="value_amount"/>
-                                               <xsl:text> </xsl:text>
-                                               <xsl:value-of 
select="value_currency"/>
-                                               <xsl:text> ]</xsl:text>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td class="th_text" align="left" 
valign="top" style="white-space: nowrap;">
-                                               <xsl:value-of 
select="php:function('lang', 'amount')"/>
-                                       </td>
-                                       <td align="left" class="th_text" 
valign="top">
-                                               <input type="text" 
name="values[split_amount]">
-                                                       <xsl:attribute 
name="size">
-                                                               
<xsl:text>20</xsl:text>
-                                                       </xsl:attribute>
-                                                       <xsl:attribute 
name="title">
+                                                       </td>
+                                                       <td align="left" 
valign="top">
+                                                               <input 
type="checkbox" name="values[split_line]" value="1">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'split line')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                               <xsl:text> [ 
</xsl:text>
+                                                               <xsl:value-of 
select="value_amount"/>
+                                                               <xsl:text> 
</xsl:text>
+                                                               <xsl:value-of 
select="value_currency"/>
+                                                               <xsl:text> 
]</xsl:text>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td class="th_text" 
align="left" valign="top" style="white-space: nowrap;">
                                                                <xsl:value-of 
select="php:function('lang', 'amount')"/>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </td>
-                               </tr>
+                                                       </td>
+                                                       <td align="left" 
class="th_text" valign="top">
+                                                               <input 
type="text" name="values[split_amount]">
+                                                                       
<xsl:attribute name="size">
+                                                                               
<xsl:text>20</xsl:text>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'amount')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </td>
+                                               </tr>
+                                       </xsl:when>
+                               </xsl:choose>
+
                                <tr height="50">
                                        <td>
                                                <xsl:variable name="lang_send">




reply via email to

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