[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6711] property: invoice handling
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6711] property: invoice handling |
Date: |
Tue, 28 Dec 2010 15:15:43 +0000 |
Revision: 6711
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6711
Author: sigurdne
Date: 2010-12-28 15:15:42 +0000 (Tue, 28 Dec 2010)
Log Message:
-----------
property: invoice handling
Modified Paths:
--------------
trunk/property/inc/class.boinvoice.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/class.uiinvoice.inc.php
trunk/property/inc/cron/default/Import_fra_basware_X205.php
trunk/property/js/yahoo/invoice.list_sub.js
trunk/property/setup/phpgw_no.lang
trunk/property/setup/setup.inc.php
trunk/property/setup/tables_current.inc.php
trunk/property/setup/tables_update.inc.php
trunk/property/templates/base/invoice.xsl
Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/inc/class.boinvoice.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -194,6 +194,11 @@
return $this->so->update_invoice_sub($values);
}
+ function update_single_line($values)
+ {
+ return $this->so->update_single_line($values);
+ }
+
function select_account_class($selected='')
{
$b_account_class_list=
$this->so->select_account_class();
Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/inc/class.menu.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -190,6 +190,11 @@
'text' =>
lang('Accounting tax'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'tax') )
),
+ 'process_code' => array
+ (
+ 'text' =>
lang('voucher process code'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'voucher_process_code') )
+ ),
'voucher_cats' => array
(
'text' =>
lang('Accounting voucher category'),
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/inc/class.sogeneric.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -126,8 +126,10 @@
$uicols['sortable'][] =
isset($field['sortable']) && $field['sortable'] ? true : false;
}
+ $custom_fields = false;
if($GLOBALS['phpgw']->locations->get_attrib_table('property',
$this->location_info['acl_location']))
{
+ $custom_fields = true;
$choice_table = 'phpgw_cust_choice';
$attribute_table = 'phpgw_cust_attribute';
$location_id =
$GLOBALS['phpgw']->locations->get_id('property',
$this->location_info['acl_location']);
@@ -221,34 +223,37 @@
}
$querymethod .= ')';
- $_querymethod = array();
+ if($custom_fields)
+ {
+ $_querymethod = array();
- $this->_db->query("SELECT * FROM
$attribute_table WHERE $attribute_filter AND search='1'",__LINE__,__FILE__);
+ $this->_db->query("SELECT * FROM
$attribute_table WHERE $attribute_filter AND search='1'",__LINE__,__FILE__);
- while ($this->_db->next_record())
- {
- if($this->_db->f('datatype')=='V' ||
$this->_db->f('datatype')=='email' || $this->_db->f('datatype')=='CH')
+ while ($this->_db->next_record())
{
- $_querymethod[]= "$table." .
$this->_db->f('column_name') . " {$this->_like} '%{$query}%'";
- }
- else if($this->_db->f('datatype')=='I')
- {
- if(ctype_digit($query))
+
if($this->_db->f('datatype')=='V' || $this->_db->f('datatype')=='email' ||
$this->_db->f('datatype')=='CH')
{
- $_querymethod[]=
"$table." . $this->_db->f('column_name') . '=' . (int)$query;
+ $_querymethod[]=
"$table." . $this->_db->f('column_name') . " {$this->_like} '%{$query}%'";
}
+ else
if($this->_db->f('datatype')=='I')
+ {
+ if(ctype_digit($query))
+ {
+
$_querymethod[]= "$table." . $this->_db->f('column_name') . '=' . (int)$query;
+ }
+ }
+ else
+ {
+ $_querymethod[]=
"$table." . $this->_db->f('column_name') . " = '$query'";
+ }
}
- else
+
+ if (isset($_querymethod) AND
is_array($_querymethod))
{
- $_querymethod[]= "$table." .
$this->_db->f('column_name') . " = '$query'";
+ $querymethod .= " $where (" .
implode (' OR ',$_querymethod) . ')';
}
}
- if (isset($_querymethod) AND
is_array($_querymethod))
- {
- $querymethod .= " $where (" . implode
(' OR ',$_querymethod) . ')';
- }
-
$querymethod .= $_query_end;
}
@@ -299,13 +304,13 @@
{
switch ($method)
{
- case 'get_user':
-
if($value)
- {
-
$value = $GLOBALS['phpgw']->accounts->get($value)->__toString();
- }
- break;
- default:
+ case
'get_user':
+
if($value)
+
{
+
$value = $GLOBALS['phpgw']->accounts->get($value)->__toString();
+
}
+
break;
+ default:
//
nothing
}
}
@@ -322,8 +327,13 @@
$type_id = (int)$type_id;
$this->type = $type;
$this->type_id = $type_id;
+ $info = array();
- $info = array();
+ if(!$type)
+ {
+ return $info;
+ }
+
switch($type)
{
//-------- ID type integer
@@ -1171,6 +1181,33 @@
);
break;
+ case 'voucher_process_code':
+ $info = array
+ (
+ 'table'
=> 'fm_ecobilag_process_code',
+ 'id'
=> array('name' => 'id', 'type' => 'varchar'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ ),
+ 'edit_msg'
=> lang('edit process code'),
+ 'add_msg'
=> lang('add process code'),
+ 'name'
=> lang('process code'),
+ 'acl_location' =>
'.admin',
+ 'menu_selection' =>
'admin::property::accounting::process_code',
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ )
+ );
+ break;
//-------- ID type auto
case 'order_dim1':
@@ -1593,7 +1630,7 @@
$receipt = array();
$receipt['error'][]=array('msg'=>lang('ERROR:
illegal type %1', $type));
phpgwapi_cache::session_set('phpgwapi',
'phpgw_messages', $receipt);
- // throw new Exception(lang('ERROR:
illegal type %1', $type));
+// throw new Exception(lang('ERROR: illegal type
%1', $type));
}
$this->location_info = $info;
@@ -1672,8 +1709,18 @@
$filtermthod = 'WHERE ' . implode(' AND
', $_filter);
}
}
- $order = isset($data['order']) &&
$data['order'] ? $data['order'] :'descr';
+ $order = isset($data['order']) &&
$data['order'] ? $data['order'] :'';
+
+ if ($order)
+ {
+ $ordermethod = " ORDER BY {$table}.{$order}
{$sort}";
+ }
+ else
+ {
+ $ordermethod = " ORDER BY
{$table}.{$this->location_info['id']['name']} ASC";
+ }
+
foreach ($this->location_info['fields'] as $field)
{
$fields[] = $field['name'];
@@ -1691,7 +1738,7 @@
$fields = implode(',', $fields);
- $this->_db->query("SELECT id, {$fields} FROM {$table}
{$filtermthod} ORDER BY {$order}");
+ $this->_db->query("SELECT id, {$fields} FROM {$table}
{$filtermthod} {$ordermethod}");
while ($this->_db->next_record())
{
Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/inc/class.soinvoice.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -358,9 +358,9 @@
}
$sql = "SELECT
$table.*,fm_workorder.status,fm_workorder.charge_tenant,org_name,"
- . "fm_workorder.claim_issued,
fm_workorder.paid_percent, project_group FROM $table"
+ . "fm_workorder.claim_issued,
fm_workorder.paid_percent FROM $table"
. " $this->left_join fm_workorder ON
fm_workorder.id = $table.pmwrkord_code"
- . " $this->left_join fm_project ON
fm_workorder.project_id = fm_project.id"
+ // . " $this->left_join fm_project ON
fm_workorder.project_id = fm_project.id"
. " $this->join fm_vendor ON $table.spvend_code
= fm_vendor.id $filtermethod";
$this->db->query($sql . $ordermethod,__LINE__,__FILE__);
@@ -376,7 +376,7 @@
(
'counter'
=> $i,
'claim_issued'
=> $this->db->f('claim_issued'),
- 'project_id'
=> $this->db->f('project_id'),
+ // 'project_id'
=> $this->db->f('project_id'),
'workorder_id'
=> $this->db->f('pmwrkord_code'),
'status'
=> $this->db->f('status'),
'closed'
=> $this->db->f('status') == $closed,
@@ -393,7 +393,7 @@
'charge_tenant'
=> $this->db->f('charge_tenant'),
'vendor'
=> $this->db->f('org_name'),
'paid_percent'
=> $this->db->f('paid_percent'),
- 'project_group'
=> $this->db->f('project_group'),
+ 'project_group'
=> $this->db->f('project_id'),
'external_ref'
=> $this->db->f('external_ref'),
'currency'
=> $this->db->f('currency')
);
@@ -706,6 +706,70 @@
return $receipt;
}
+ function update_single_line($values)
+ {
+ $table ='fm_ecobilag';
+ $id = (int)$values['id'];
+
+ $value_set= array
+ (
+ 'project_id' => $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->transaction_begin();
+ $this->db->query("UPDATE {$table} SET $value_set WHERE
id= {$id}" ,__LINE__,__FILE__);
+
+ if(isset($values['split_line']) &&
$values['split_amount'] && isset($values['split_amount']) &&
$values['split_amount'])
+ {
+ $sql ="SELECT * FROM {$table} WHERE id= {$id}";
+ $this->db->query($sql,__LINE__,__FILE__);
+ $this->db->next_record();
+ $metadata = $this->db->metadata($table);
+
+ $value_set = array();
+
+ foreach($metadata as $_field)
+ {
+ if($_field->name != 'id')
+ {
+ $value_set[$_field->name] =
$this->db->f($_field->name,true);
+ }
+ }
+
+ $this->db->query( "INSERT INTO {$table} (" .
implode( ',', array_keys($value_set) ) . ')'
+ . ' VALUES (' .
$this->db->validate_insert( array_values($value_set) ) . ')',__LINE__,__FILE__);
+
+ $new_id =
$this->db->get_last_insert_id($table,'id');
+
+ $this->db->query("SELECT belop FROM {$table}
WHERE id={$id}",__LINE__,__FILE__);
+ $this->db->next_record();
+ $amount = $this->db->f('belop');
+ $new_amount = $amount - $values['split_amount'];
+
+ $value_set= array
+ (
+ 'belop' => $new_amount,
+ 'godkjentbelop' => $new_amount,
+ );
+ $value_set =
$this->db->validate_update($value_set);
+ $this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$id}" ,__LINE__,__FILE__);
+
+ $value_set= array
+ (
+ 'belop' =>
$values['split_amount'],
+ 'godkjentbelop' =>
$values['split_amount'],
+ );
+ $value_set =
$this->db->validate_update($value_set);
+ $this->db->query("UPDATE {$table} SET
$value_set WHERE id= {$new_id}" ,__LINE__,__FILE__);
+ }
+
+ $this->db->transaction_commit();
+ }
+
function read_remark($id='',$paid='')
{
if ($paid)
@@ -947,6 +1011,7 @@
'budget_responsible'=>
$this->db->f('budsjettansvarligid'),
'invoice_date' =>
$this->db->f('fakturadato'),
'project_id' =>
$this->db->f('project_id'),
+ 'project_group' =>
$this->db->f('project_id'),
'payment_date' =>
$this->db->f('forfallsdato'),
'merknad'
=> $this->db->f('merknad'),
'b_account_id' =>
$this->db->f('spbudact_code'),
@@ -954,7 +1019,9 @@
'order'
=> $this->db->f('pmwrkord_code'),
'order_id'
=> $this->db->f('pmwrkord_code'),
'kostra_id'
=> $this->db->f('kostra_id'),
- 'currency'
=> $this->db->f('currency')
+ 'currency'
=> $this->db->f('currency'),
+ 'process_code' =>
$this->db->f('process_code'),
+ 'process_log' =>
$this->db->f('process_log',true),
);
}
//_debug_array($values);
Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/inc/class.uiinvoice.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -1778,46 +1778,67 @@
$voucher_id = phpgw::get_var('voucher_id', 'int',
'GET');
$redirect = false;
- //_debug_array($id);
$values = phpgw::get_var('values');
-
$receipt = array();
if (isset($values['save']))
{
+ $values['project_group'] =
phpgw::get_var('project_group', 'int', 'POST');
if($GLOBALS['phpgw']->session->is_repost())
{
$receipt['error'][]=array('msg'=>lang('repost'));
}
- if(!isset($values['address']) ||
!$values['address'])
+ if(!isset($values['process_log']) ||
!$values['process_log'])
{
-
$receipt['error'][]=array('msg'=>lang('Missing address'));
+
$receipt['error'][]=array('msg'=>lang('Missing log message'));
}
- if(!isset($values['details']) ||
!$values['details'])
+ if( isset($values['order_id']) &&
$values['order_id'] &&
!execMethod('property.soXport.check_order',$values['order_id']) )
{
-
$receipt['error'][]=array('msg'=>lang('Please give som details'));
+
$receipt['error'][]=array('msg'=>lang('No such order:
%1',$values['order_id']));
}
+ if(isset($values['split_line']) &&
isset($values['split_amount']) && $values['split_amount'])
+ {
+ $values['split_amount']
= str_replace(' ','',$values['split_amount']);
+ $values['split_amount']
= str_replace(',','.',$values['split_amount']);
+ if(!is_numeric($values['split_amount']))
+ {
+
$receipt['error'][]=array('msg'=>lang('Not a valid amount'));
+ }
+ }
+
if (!$receipt['error'])
{
$redirect = true;
+ $values['id'] = $id;
+ $line =
$this->bo->update_single_line($values);
}
}
$line = $this->bo->get_single_line($id);
- _debug_array($line);
+// _debug_array($line);
+ $process_code_list =
execMethod('property.bogeneric.get_list', array(
+ 'type' => 'voucher_process_code',
+ 'selected' =>
isset($values['process_code']) ? $values['process_code'] :
$line['process_code']));
+ $project_group_data =
$this->bocommon->initiate_project_group_lookup(array(
+ 'project_group' =>
$values['project_group']?$values['project_group']:$line['project_group'],
+ 'project_group_descr' =>
$values['project_group_descr']));
+
+
$data = array
- (
- 'redirect' => $redirect ?
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiinvoice.list_sub', 'user_lid' => $user_lid, 'voucher_id' =>
$voucher_id)) : null,
- 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)),
- 'from_name' =>
$GLOBALS['phpgw_info']['user']['fullname'],
- 'from_address' =>
$GLOBALS['phpgw_info']['user']['preferences']['property']['email'],
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'property.uiinvoice.edit', 'id' => $id, 'user_lid' => $user_lid, 'voucher_id'
=> $voucher_id)),
- 'support_address' =>
$support_address,
- );
+ (
+ 'redirect'
=> $redirect ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiinvoice.list_sub', 'user_lid' => $user_lid, 'voucher_id' =>
$voucher_id)) : 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)),
+ 'process_code_list' =>
$process_code_list,
+ 'project_group_data' =>
$project_group_data,
+ 'order_id'
=> $line['order_id'],
+ 'value_process_log' =>
isset($values['process_log']) && $values['process_log'] ?
$values['process_log'] : $line['process_log']
+ );
$GLOBALS['phpgw']->xslttpl->add_file('invoice');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('edit' => $data));
Modified: trunk/property/inc/cron/default/Import_fra_basware_X205.php
===================================================================
--- trunk/property/inc/cron/default/Import_fra_basware_X205.php 2010-12-27
15:07:01 UTC (rev 6710)
+++ trunk/property/inc/cron/default/Import_fra_basware_X205.php 2010-12-28
15:15:42 UTC (rev 6711)
@@ -226,8 +226,7 @@
function import($file)
{
- $valid_data= False;
- $bilagsnr = $this->invoice->next_bilagsnr();
+// $valid_data= False;
$buffer = array();
@@ -270,8 +269,9 @@
// $_data['SUPPLIER.CODE']; // => 100644
// $_data['SUPPLIERREF']; // => 7869
$_data['VATAMOUNT']; // => 62500
+
+ $bilagsnr = isset($_data['VOUCHERID'])
? $_data['VOUCHERID'] : ''; // FIXME: innkommende bilagsnummer?
-
$order_id =
$_data['PURCHASEORDERNO'];
$fakturanr = $_data['KEY'];
$fakturadato =
date($this->dateformat,strtotime(str_replace('.', '-', $_data['INVOICEDATE'])));
@@ -372,6 +372,16 @@
if(!isset($this->receipt['error']) ||
!$this->receipt['error'])
{
+ if(!$bilagsnr)
+ {
+ $bilagsnr =
$this->invoice->next_bilagsnr();
+
+ foreach($buffer as &$entry)
+ {
+ $entry['bilagsnr'] = $bilagsnr;
+ }
+ }
+
return $this->import_end_file($buffer);
}
return false;
Modified: trunk/property/js/yahoo/invoice.list_sub.js
===================================================================
--- trunk/property/js/yahoo/invoice.list_sub.js 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/js/yahoo/invoice.list_sub.js 2010-12-28 15:15:42 UTC (rev
6711)
@@ -53,7 +53,7 @@
var frame = document.createElement('iframe');
frame.src = sUrl;
frame.width = "100%";
- frame.height = "350";
+ frame.height = "400";
o.setBody(frame);
};
lightbox.showEvent.subscribe(onDialogShow, lightbox);
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2010-12-27 15:07:01 UTC (rev 6710)
+++ trunk/property/setup/phpgw_no.lang 2010-12-28 15:15:42 UTC (rev 6711)
@@ -1007,6 +1007,7 @@
minor consequences property no Små konsekvenser
minute property no Minutt
minutes before the event property no Minutter til hendelse
+Missing log message property no Angi grunn for endring
missing value for %1 property no Mangler verdi for %1
month property no Måned
Monthly (by day) property no Månedlig (dag)
@@ -1778,6 +1779,8 @@
voucher is updated property no Bilag er oppdatert
voucher is updated: property no Bilag er oppdatert:
voucher period is updated property no bilags periode er
oppdatert
+voucher process code property no Årsakskode
+voucher process log property no Fakturalogg
Warning: the record has to be saved in order to plan an event property
no NB! posten må lagres før hendelse kan planlegges
warning: show cost estimate property no Advarsel:
kostnadsestimat blir synlig for leverandør
w_cost property no Arbeidskostnad
Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php 2010-12-27 15:07:01 UTC (rev 6710)
+++ trunk/property/setup/setup.inc.php 2010-12-28 15:15:42 UTC (rev 6711)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.601';
+ $setup_info['property']['version'] = '0.9.17.602';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -130,6 +130,7 @@
'fm_tts_views',
'fm_ecoart',
'fm_ecoavvik',
+ 'fm_ecobilag_process_code',
'fm_ecobilag',
'fm_ecobilagkilde',
'fm_ecobilagoverf',
Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/setup/tables_current.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -936,6 +936,19 @@
'fk' => array(),
'uc' => array()
),
+ 'fm_ecobilag_process_code' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'varchar', 'precision'
=> 10,'nullable' => False),
+ 'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'user_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'fm_ecobilag' => array(
'fd' => array(
'id' => array('type' => 'auto','precision' =>
'4','nullable' => False),
@@ -976,7 +989,9 @@
'item_type' => array('type' =>
'int','precision' => '4','nullable' => True),
'item_id' => array('type' =>
'varchar','precision' => '20','nullable' => True),
'external_ref' => array('type' =>
'varchar','precision' => '30','nullable' => True),
- 'currency' => array('type' =>
'varchar','precision' => '3','nullable' => True)
+ 'currency' => array('type' =>
'varchar','precision' => '3','nullable' => True),
+ 'process_log' => array('type' =>
'text','nullable' => True),
+ 'process_code' => array('type' =>
'varchar','precision' => '10','nullable' => True),
),
'pk' => array('id'),
'ix' => array(),
@@ -1025,7 +1040,9 @@
'item_type' => array('type' =>
'int','precision' => '4','nullable' => True),
'item_id' => array('type' =>
'varchar','precision' => '20','nullable' => True),
'external_ref' => array('type' =>
'varchar','precision' => '30','nullable' => True),
- 'currency' => array('type' =>
'varchar','precision' => '3','nullable' => True)
+ 'currency' => array('type' =>
'varchar','precision' => '3','nullable' => True),
+ 'process_log' => array('type' =>
'text','nullable' => True),
+ 'process_code' => array('type' =>
'varchar','precision' => '10','nullable' => True),
),
'pk' => array('id'),
'ix' => array(),
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/setup/tables_update.inc.php 2010-12-28 15:15:42 UTC (rev
6711)
@@ -4762,3 +4762,42 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+ /**
+ * Update property version from 0.9.17.601 to 0.9.17.602
+ * Add fields voucher handling
+ *
+ */
+
+ $test[] = '0.9.17.601';
+ function property_upgrade0_9_17_601()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_ecobilag_process_code', array(
+ 'fd' => array(
+ 'id' => array('type' => 'varchar',
'precision' => 10,'nullable' => False),
+ 'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'user_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' =>
'int', 'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','process_log',
array('type' => 'text','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','process_log',
array('type' => 'text','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','process_code',
array('type' => 'varchar','precision' => '10','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','process_code',
array('type' => 'varchar','precision' => '10','nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.602';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
Modified: trunk/property/templates/base/invoice.xsl
===================================================================
--- trunk/property/templates/base/invoice.xsl 2010-12-27 15:07:01 UTC (rev
6710)
+++ trunk/property/templates/base/invoice.xsl 2010-12-28 15:15:42 UTC (rev
6711)
@@ -1205,62 +1205,83 @@
</tr>
</xsl:when>
</xsl:choose>
-
- <tr class="th">
- <td class="th_text" valign="top">
- <xsl:value-of
select="php:function('lang', 'address')" />
+ <!--<xsl:variable
name="lang_process_code"><xsl:value-of select="php:function('lang', 'voucher
process code')" /></xsl:variable>-->
+ <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 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', 'order id')" />
+ </td>
<td class="th_text" valign="top">
- <input type="text"
name="values[address]" value="{support_address}">
+ <input type="text"
name="values[order_id]" value="{order_id}">
<xsl:attribute
name="size">
-
<xsl:text>60</xsl:text>
+
<xsl:text>20</xsl:text>
</xsl:attribute>
<xsl:attribute
name="title">
- <xsl:value-of
select="php:function('lang', 'address')" />
+ <xsl:value-of
select="php:function('lang', 'order id')" />
</xsl:attribute>
</input>
</td>
</tr>
<tr>
- <td class="th_text" valign="top">
- <xsl:value-of
select="php:function('lang', 'from')" />
+ <td class="th_text" align = "left"
valign="top" style="white-space: nowrap;">
+ <xsl:value-of
select="php:function('lang', 'voucher process log')" />
</td>
- <td class="th_text" valign="top">
- <xsl:value-of
select="from_name"/>
+ <td>
+ <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" valign="top">
- <xsl:value-of
select="php:function('lang', 'from adress')" />
+ <td class="th_text" align = "left"
valign="top" style="white-space: nowrap;">
+ <xsl:value-of
select="php:function('lang', 'split line')" />
</td>
- <td class="th_text" valign="top">
- <input type="text"
name="values[from_address]" value="{from_address}">
- <xsl:attribute
name="size">
-
<xsl:text>60</xsl:text>
- </xsl:attribute>
+ <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', 'address')" />
+ <xsl:value-of
select="php:function('lang', 'split line')" />
</xsl:attribute>
</input>
</td>
</tr>
<tr>
- <td valign="top">
- <xsl:value-of
select="php:function('lang', 'description')" />
+ <td class="th_text" align = "left"
valign="top" style="white-space: nowrap;">
+ <xsl:value-of
select="php:function('lang', 'amount')" />
</td>
- <td>
- <textarea cols="60" rows="10"
name="values[details]" wrap="virtual" onMouseout="window.status='';return
true;">
+ <td 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', 'details')" />
+ <xsl:value-of
select="php:function('lang', 'amount')" />
</xsl:attribute>
- <xsl:value-of
select="value_details"/>
- </textarea>
+ </input>
</td>
</tr>
<tr height="50">
<td>
- <xsl:variable
name="lang_send"><xsl:value-of select="php:function('lang', 'send')"
/></xsl:variable>
+ <xsl:variable
name="lang_send"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
<input type="submit"
name="values[save]" value="{$lang_send}" title='{$lang_send}'>
</input>
</td>
@@ -1270,4 +1291,12 @@
</form>
</xsl:template>
+ <xsl:template match="process_code_list">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected" value="selected"
/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes"
select="name"/>
+ </option>
+ </xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6711] property: invoice handling,
Sigurd Nes <=