[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property inc/class.boinvoice.inc.php inc/class....
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property inc/class.boinvoice.inc.php inc/class.... |
Date: |
Wed, 10 May 2006 11:10:21 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Branch:
Changes by: Sigurd Nes <address@hidden> 06/05/10 11:10:21
Modified files:
inc : class.boinvoice.inc.php
class.boworkorder.inc.php
class.sobudget.inc.php class.soinvoice.inc.php
class.soworkorder.inc.php
class.uibudget.inc.php class.uiinvoice.inc.php
class.uiworkorder.inc.php
inc/export : Agresso
setup : tables_current.inc.php tables_update.inc.php
templates/base : invoice.xsl
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boinvoice.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.boworkorder.inc.php.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.sobudget.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soinvoice.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.soworkorder.inc.php.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uibudget.inc.php.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiinvoice.inc.php.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/class.uiworkorder.inc.php.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/inc/export/Agresso.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_current.inc.php.diff?tr1=1.62&tr2=1.63&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/setup/tables_update.inc.php.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/property/templates/base/invoice.xsl.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: property/inc/class.boinvoice.inc.php
diff -u property/inc/class.boinvoice.inc.php:1.18
property/inc/class.boinvoice.inc.php:1.19
--- property/inc/class.boinvoice.inc.php:1.18 Mon Apr 17 11:36:05 2006
+++ property/inc/class.boinvoice.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage eco
- * @version $Id: class.boinvoice.inc.php,v 1.18 2006/04/17 11:36:05
sigurdne Exp $
+ * @version $Id: class.boinvoice.inc.php,v 1.19 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -42,7 +42,8 @@
$cat_id =
get_var('cat_id',array('POST','GET'));
$user_lid =
get_var('user_lid',array('POST','GET'));
$allrows =
get_var('allrows',array('POST','GET'));
-
+ $b_account_class =
get_var('b_account_class',array('POST','GET'));
+
if ($start)
{
$this->start=$start;
@@ -52,10 +53,16 @@
$this->start=0;
}
+ if(isset($b_account_class))
+ {
+ $this->b_account_class = $b_account_class;
+ }
+
if(isset($query))
{
$this->query = $query;
}
+
if(!empty($filter))
{
$this->filter = $filter;
@@ -114,7 +121,7 @@
'user_lid' => $this->user_lid,'cat_id' => $this->cat_id, 'paid' =>
$paid,
'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
'loc1'=>$loc1,'workorder_id'=>$workorder_id,'allrows'=>$this->allrows,
-
'voucher_id'=>$voucher_id));
+
'voucher_id'=>$voucher_id,'b_account_class' =>$this->b_account_class));
$this->total_records = $this->so->total_records;
$this->end_time = $this->so->end_time;
Index: property/inc/class.boworkorder.inc.php
diff -u property/inc/class.boworkorder.inc.php:1.14
property/inc/class.boworkorder.inc.php:1.15
--- property/inc/class.boworkorder.inc.php:1.14 Tue May 9 20:15:45 2006
+++ property/inc/class.boworkorder.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.boworkorder.inc.php,v 1.14 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: class.boworkorder.inc.php,v 1.15 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -85,11 +85,11 @@
{
$this->filter = $filter;
}
- if(array_key_exists('sort',$_POST))
+ if(isset($sort))
{
$this->sort = $sort;
}
- if(array_key_exists('order',$_POST))
+ if(isset($order))
{
$this->order = $order;
}
Index: property/inc/class.sobudget.inc.php
diff -u property/inc/class.sobudget.inc.php:1.19
property/inc/class.sobudget.inc.php:1.20
--- property/inc/class.sobudget.inc.php:1.19 Tue May 9 20:15:45 2006
+++ property/inc/class.sobudget.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage budget
- * @version $Id: class.sobudget.inc.php,v 1.19 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: class.sobudget.inc.php,v 1.20 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -422,7 +422,8 @@
$year = (isset($data['year'])?$data['year']:'');
}
- $filtermethod = " WHERE fm_workorder.paid is NULL ";
+ /* 0 => cancelled, 1 => obligation , 2 => paid */
+ $filtermethod = " WHERE fm_workorder.paid = 1 and
fm_workorder.vendor_id > 0";
$where = 'AND';
if ($district_id > 0)
@@ -530,8 +531,8 @@
. " $this->join fm_b_account ON
fm_ecobilagoverf.spbudact_code =fm_b_account.id "
. " $this->join fm_location1 ON
fm_ecobilagoverf.loc1 = fm_location1.loc1 "
. " $this->join fm_part_of_town ON
fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id"
- . " WHERE (forfallsdato > '$start_date1' AND
forfallsdato < '$end_date' $filtermethod)"
- . " OR (forfallsdato > '$start_date2' AND
forfallsdato < '$end_date' AND periode < 3 $filtermethod)"
+ . " WHERE (fakturadato > '$start_date1' AND
fakturadato < '$end_date' $filtermethod)"
+ . " OR (fakturadato > '$start_date2' AND
fakturadato < '$end_date' AND periode < 3 $filtermethod)"
. " GROUP BY b_group, district_id";
//_debug_array($sql);
Index: property/inc/class.soinvoice.inc.php
diff -u property/inc/class.soinvoice.inc.php:1.22
property/inc/class.soinvoice.inc.php:1.23
--- property/inc/class.soinvoice.inc.php:1.22 Tue May 9 13:41:25 2006
+++ property/inc/class.soinvoice.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage eco
- * @version $Id: class.soinvoice.inc.php,v 1.22 2006/05/09 13:41:25
sigurdne Exp $
+ * @version $Id: class.soinvoice.inc.php,v 1.23 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -52,13 +52,14 @@
$cat_id =
(isset($data['cat_id'])?$data['cat_id']:0);
$user_lid =
(isset($data['user_lid'])?$data['user_lid']:'none');
$paid =
(isset($data['paid'])?$data['paid']:'');
- $start_date =
(isset($data['start_date'])?$data['start_date']:'');
+ $start_date =
(isset($data['start_date'])?$data['start_date']:'');
$end_date =
(isset($data['end_date'])?$data['end_date']:'');
$vendor_id =
(isset($data['vendor_id'])?$data['vendor_id']:'');
$loc1 =
(isset($data['loc1'])?$data['loc1']:'');
- $workorder_id =
(isset($data['workorder_id'])?$data['workorder_id']:'');
+ $workorder_id =
(isset($data['workorder_id'])?$data['workorder_id']:'');
$allrows =
(isset($data['allrows'])?$data['allrows']:'');
$voucher_id =
(isset($data['voucher_id'])?$data['voucher_id']:'');
+ $b_account_class =
(isset($data['b_account_class'])?$data['b_account_class']:'');
}
//_debug_array($data);
@@ -112,6 +113,8 @@
$filtermethod .= " $where pmwrkord_code
='$workorder_id' ";
$where= 'AND';
}
+
+
if ($voucher_id)
{
$filtermethod .= " $where bilagsnr $this->like
'%$voucher_id%' ";
@@ -122,30 +125,50 @@
if ($paid)
{
$table = 'fm_ecobilagoverf';
- $dateformat =
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $dateformat = str_replace(".","",$dateformat);
- $dateformat = str_replace("-","",$dateformat);
- $dateformat = str_replace("/","",$dateformat);
- $y=strpos($dateformat,'y');
- $d=strpos($dateformat,'d');
- $m=strpos($dateformat,'m');
-
- $dateparts = explode('/', $start_date);
- $sday = $dateparts[$d];
- $smonth = $dateparts[$m];
- $syear = $dateparts[$y];
-
- $dateparts = explode('/', $end_date);
- $eday = $dateparts[$d];
- $emonth = $dateparts[$m];
- $eyear = $dateparts[$y];
- $start_date =
date($this->bocommon->dateformat,mktime(2,0,0,$smonth,$sday,$syear));
- $end_date =
date($this->bocommon->dateformat,mktime(2,0,0,$emonth,$eday,$eyear));
+ if ($b_account_class)
+ {
+ $filtermethod .= " $where
fm_b_account.category ='$b_account_class' ";
+ $where= 'AND';
+ $join_account = " $this->join
fm_b_account ON fm_ecobilagoverf.spbudact_code = fm_b_account.id";
+ }
if (!$workorder_id && !$voucher_id)
{
- $filtermethod .= " $where overftid
>'$start_date' and overftid < '$end_date'";
+ $dateformat =
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $dateformat =
str_replace(".","",$dateformat);
+ $dateformat =
str_replace("-","",$dateformat);
+ $dateformat =
str_replace("/","",$dateformat);
+ $y=strpos($dateformat,'y');
+ $d=strpos($dateformat,'d');
+ $m=strpos($dateformat,'m');
+
+ $dateparts = explode('/', $start_date);
+ $sday = $dateparts[$d];
+ $smonth = $dateparts[$m];
+ $syear = $dateparts[$y];
+
+ $dateparts = explode('/', $end_date);
+ $eday = $dateparts[$d];
+ $emonth = $dateparts[$m];
+ $eyear = $dateparts[$y];
+
+ $end_date =
date($this->bocommon->dateformat,mktime(2,0,0,$emonth,$eday,$eyear));
+
+ $start_date2 =
date($this->bocommon->dateformat,mktime(2,0,0,$smonth,$sday,$syear));
+
+ if($smonth < 3)
+ {
+ $start_date =
date($this->bocommon->dateformat,mktime(2,0,0,3,1,$syear));
+ $filtermethod .= " $where
(fakturadato >'$start_date' AND fakturadato < '$end_date')";
+ $filtermethod .= " OR
(fakturadato >'$start_date2' AND fakturadato < '$end_date' AND periode < 3)";
+ }
+ else
+ {
+ $filtermethod .= " $where
(fakturadato >'$start_date2' AND fakturadato < '$end_date')";
+ }
+
+ // $filtermethod .= " $where overftid
>'$start_date' and overftid < '$end_date'";
}
}
else
@@ -163,8 +186,8 @@
}
- $sql = "SELECT DISTINCT bilagsnr, count(bilagsnr) as
invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM $table
$filtermethod $querymethod group by bilagsnr,spvend_code,fakturadato ";
- $sql2 = "SELECT DISTINCT bilagsnr FROM $table
$filtermethod $querymethod";
+ $sql = "SELECT DISTINCT bilagsnr, count(bilagsnr) as
invoice_count, sum(belop) as belop,spvend_code,fakturadato FROM $table
$join_account $filtermethod $querymethod group by
bilagsnr,spvend_code,fakturadato ";
+ $sql2 = "SELECT DISTINCT bilagsnr FROM $table
$join_account $filtermethod $querymethod";
//echo $sql;
$this->db2->query($sql2,__LINE__,__FILE__);
@@ -504,8 +527,8 @@
. " FROM fm_ecobilagoverf $this->join
fm_location1 ON (fm_ecobilagoverf.loc1 = fm_location1.loc1) "
. " $this->join fm_part_of_town ON
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id) "
. " $this->join fm_b_account ON
(fm_ecobilagoverf.spbudact_code = fm_b_account.id) "
- . " WHERE (forfallsdato >'$start_date' AND
forfallsdato < '$end_date' $filtermethod )"
- . " OR (forfallsdato >'$start_date2' AND
forfallsdato < '$end_date' AND periode < 3 $filtermethod) "
+ . " WHERE (fakturadato >'$start_date' AND
fakturadato < '$end_date' $filtermethod )"
+ . " OR (fakturadato >'$start_date2' AND
fakturadato < '$end_date' AND periode < 3 $filtermethod) "
. " GROUP BY district_id,periode
$group_account_class"
. " ORDER BY periode";
//echo $sql;
@@ -902,13 +925,14 @@
function select_account_class()
{
- $sql = "SELECT DISTINCT category from fm_b_account ";
+ $sql = "SELECT id from fm_b_account_category order by
id";
$this->db->query($sql,__LINE__,__FILE__);
while ($this->db->next_record())
{
$class[] = Array(
- 'id' => $this->db->f('category')
+ 'id' => $this->db->f('id'),
+ 'name' => $this->db->f('id')
);
}
return $class;
Index: property/inc/class.soworkorder.inc.php
diff -u property/inc/class.soworkorder.inc.php:1.19
property/inc/class.soworkorder.inc.php:1.20
--- property/inc/class.soworkorder.inc.php:1.19 Tue May 9 20:15:45 2006
+++ property/inc/class.soworkorder.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.soworkorder.inc.php,v 1.19 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: class.soworkorder.inc.php,v 1.20 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -298,7 +298,8 @@
if ($paid)
{
- $filtermethod .= " $where fm_workorder.paid
!='1' ";
+ /* 0 => cancelled, 1 => obligation , 2 => paid
*/
+ $filtermethod .= " $where fm_workorder.paid =
$paid AND vendor_id > 0";
$where= 'AND';
}
@@ -542,7 +543,6 @@
$this->db->query("SELECT status,budget,calculation FROM
fm_workorder where id='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
$this->db->next_record();
-
if ($this->db->f('calculation') > 0)
{
$config = CreateObject('phpgwapi.config');
@@ -558,6 +558,22 @@
$old_status = $this->db->f('status');
$old_budget = $this->db->f('budget');
+ $this->db->query("SELECT bilagsnr FROM fm_ecobilag
where pmwrkord_code ='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
+ $this->db->next_record();
+
+ if($this->db->f('bilagsnr'))
+ {
+ $paid = 1;
+ }
+
+ $this->db->query("SELECT bilagsnr FROM fm_ecobilagoverf
where pmwrkord_code ='" .$workorder['workorder_id']."'",__LINE__,__FILE__);
+ $this->db->next_record();
+ if($this->db->f('bilagsnr'))
+ {
+ $paid = 2;
+ }
+
+
$value_set=array(
'title' => $workorder['title'],
'status' => $workorder['status'],
@@ -575,6 +591,11 @@
'vendor_id' =>
$workorder['vendor_id']
);
+ if($workorder['status'] == 'closed')
+ {
+ $value_set['paid'] = $paid =
(isset($paid)?$paid:0);
+ }
+
$value_set =
$this->bocommon->validate_db_update($value_set);
$this->db->transaction_begin();
Index: property/inc/class.uibudget.inc.php
diff -u property/inc/class.uibudget.inc.php:1.18
property/inc/class.uibudget.inc.php:1.19
--- property/inc/class.uibudget.inc.php:1.18 Tue May 9 20:15:45 2006
+++ property/inc/class.uibudget.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage budget
- * @version $Id: class.uibudget.inc.php,v 1.18 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: class.uibudget.inc.php,v 1.19 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -537,7 +537,7 @@
'grouping'
=> $entry['grouping'],
'district_id'
=> $entry['district_id'],
'obligation'
=> number_format($entry['obligation'], 0, ',', ' '),
- 'link_obligation'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.index&filter=all&paid=true&district_id='
. $entry['district_id'] . '&b_group=' . $entry['grouping']),
+ 'link_obligation'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiworkorder.index&filter=all&paid=1&district_id='
. $entry['district_id'] . '&b_group=' . $entry['grouping']),
'actual_cost'
=> number_format($entry['actual_cost'], 0, ',', ' '),
'link_actual_cost'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.consume&district_id='
. $entry['district_id'] . '&b_account_class=' . $entry['grouping'] .
'&start_date=' . $start_date . '&end_date=' . $end_date .
'&submit_search=true'),
'diff'
=> number_format($entry['budget_cost'] - $entry['actual_cost'] -
$entry['obligation'], 0, ',', ' '),
Index: property/inc/class.uiinvoice.inc.php
diff -u property/inc/class.uiinvoice.inc.php:1.25
property/inc/class.uiinvoice.inc.php:1.26
--- property/inc/class.uiinvoice.inc.php:1.25 Tue May 9 13:41:25 2006
+++ property/inc/class.uiinvoice.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage eco
- * @version $Id: class.uiinvoice.inc.php,v 1.25 2006/05/09 13:41:25
sigurdne Exp $
+ * @version $Id: class.uiinvoice.inc.php,v 1.26 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -144,7 +144,8 @@
$vendor_id =
get_var('vendor_id',array('POST','GET'));
$workorder_id =
get_var('workorder_id',array('POST','GET'));
$loc1 = get_var('loc1',array('POST','GET'));
- $voucher_id =
get_var('voucher_id',array('POST','GET'));
+ $voucher_id =
get_var('voucher_id',array('POST','GET'));
+ $b_account_class=
get_var('b_account_class',array('POST','GET'));
$start_date=urldecode($start_date);
$end_date=urldecode($end_date);
@@ -174,7 +175,7 @@
{
$sum
= $sum + $extra['amount'];
- $content[$i]['amount']
= number_format($extra['amount'], 2, ',', '');
+ $content[$i]['amount'] =
number_format($extra['amount'], 2, ',', '');
$content[$i]['lang_payment_date']
= lang('Payment Date');
$content[$i]['link_sub']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.list_sub&user_lid='.$this->user_lid
. '&query=' . $this->query);
$content[$i]['lang_sub']
= lang('Voucher ID');
@@ -206,7 +207,8 @@
'sub'
=>$this->sub,
'paid'
=> $paid,
'vendor_id'
=> $vendor_id,
-
'user_lid'
=> $this->user_lid)
+
'user_lid'
=> $this->user_lid,
+
'b_account_class' => $b_account_class)
)),
'lang_voucher' =>
lang('voucher'),
'sort_voucher_date'
=> $this->nextmatchs->show_sort_order(array
@@ -219,7 +221,8 @@
'sub'
=>$this->sub,
'paid'
=> $paid,
'vendor_id'
=> $vendor_id,
-
'user_lid'
=> $this->user_lid)
+
'user_lid'
=> $this->user_lid,
+
'b_account_class' => $b_account_class)
)),
'lang_voucher_date' =>
lang('Voucher Date'),
'lang_days'
=> lang('Days'),
@@ -234,43 +237,45 @@
'sub'
=>$this->sub,
'paid'
=> $paid,
'vendor_id'
=> $vendor_id,
-
'user_lid'
=> $this->user_lid)
+
'user_lid'
=> $this->user_lid,
+
'b_account_class' => $b_account_class)
)),
- 'lang_vendor_id' =>
lang('Vendor'),
+ 'lang_vendor_id' =>
lang('Vendor'),
'lang_num_sub_invoice' =>
lang('Count'),
- 'lang_type'
=> lang('Type'),
- 'lang_period' =>
lang('Period'),
- 'lang_kredit' =>
lang('KreditNota'),
- 'lang_none'
=> lang('None'),
- 'lang_janitor' =>
lang('Janitor'),
- 'lang_supervisor' =>
lang('Supervisor'),
+ 'lang_type' => lang('Type'),
+ 'lang_period' =>
lang('Period'),
+ 'lang_kredit' =>
lang('KreditNota'),
+ 'lang_none' => lang('None'),
+ 'lang_janitor' =>
lang('Janitor'),
+ 'lang_supervisor' =>
lang('Supervisor'),
'lang_budget_responsible' => lang('Budget
Responsible'),
- 'lang_transfer' =>
lang('Transfer'),
- 'lang_delete' =>
lang('delete')
+ 'lang_transfer' =>
lang('Transfer'),
+ 'lang_delete' =>
lang('delete')
);
$table_done[] = array
(
- 'lang_done' =>
lang('Done'),
- 'lang_done_statustext' => lang('Close this
window')
+ 'lang_done' => lang('Done'),
+ 'lang_done_statustext' => lang('Close
this window')
);
$link_data = array
(
'menuaction' =>
$this->currentapp.'.uiinvoice.index',
- 'order' => $this->order,
- 'sort' => $this->sort,
- 'cat_id' =>
$this->cat_id,
- 'user_lid' =>
$this->user_lid,
- 'sub' => $this->sub,
- 'query' => $this->query,
- 'start' => $this->start,
- 'paid' => $paid,
- 'vendor_id' => $vendor_id,
+ 'order' => $this->order,
+ 'sort' => $this->sort,
+ 'cat_id' => $this->cat_id,
+ 'user_lid' => $this->user_lid,
+ 'sub' => $this->sub,
+ 'query' => $this->query,
+ 'start' => $this->start,
+ 'paid' => $paid,
+ 'vendor_id' => $vendor_id,
'workorder_id' => $workorder_id,
'start_date' => $start_date,
- 'end_date' => $end_date,
- 'filter' => $this->filter
+ 'end_date' => $end_date,
+ 'filter' => $this->filter,
+ 'b_account_class' => $b_account_class
);
if($this->acl_add)
@@ -311,7 +316,8 @@
'start_date' => $start_date,
'end_date' => $end_date,
'filter' => $this->filter,
- 'allrows' => $this->allrows
+ 'allrows' => $this->allrows,
+ 'b_account_class' => $b_account_class
);
$data['lang_excel'] =
'excel';
@@ -392,6 +398,11 @@
$data['lang_voucher_id']
= lang('Voucher ID');
$data['voucher_id']
= $voucher_id;
+ $data['account_class_list']
= $this->bo->select_account_class($b_account_class);
+ $data['lang_no_account_class']
= lang('No account');
+ $data['lang_account_class_statustext']
= lang('Select the account class the selection belongs to');
+ $data['select_account_class_name']
= 'b_account_class';
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_voucher_paid' =>
$data));
// $GLOBALS['phpgw']->xslttpl->pp();
}
@@ -557,7 +568,7 @@
'query' => $this->query,
'start' => $this->start,
'paid' => $paid,
- 'voucher_id' => $voucher_id,
+ 'voucher_id' => $voucher_id,
'user_lid' =>
$this->user_lid,
'query' => $this->query
);
@@ -685,25 +696,24 @@
function consume()
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
'nextmatchs',
'search_field'));
$start_date =
get_var('start_date',array('POST','GET'));
- $end_date =
get_var('end_date',array('POST','GET'));
+ $end_date =
get_var('end_date',array('POST','GET'));
$submit_search =
get_var('submit_search',array('POST','GET'));
- $vendor_id =
get_var('vendor_id',array('POST','GET'));
+ $vendor_id =
get_var('vendor_id',array('POST','GET'));
$workorder_id =
get_var('workorder_id',array('POST','GET'));
- $loc1 =
get_var('loc1',array('POST','GET'));
+ $loc1 =
get_var('loc1',array('POST','GET'));
$district_id =
get_var('district_id',array('POST','GET'));
$b_account_class =
get_var('b_account_class',array('POST','GET'));
if($vendor_id)
{
$contacts =
CreateObject($this->currentapp.'.soactor');
- $contacts->role='vendor';
+ $contacts->role = 'vendor';
$vendor =
$contacts->read_single(array('actor_id'=>(int)$vendor_id));
if(is_array($vendor))
{
@@ -720,11 +730,11 @@
$links = $this->menu->links('consume');
-
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
//_debug_array($values);
if(!$submit_search)
{
- $start_date =
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,date("m"),date("d"),date("Y")),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+ $start_date =
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,date("m"),date("d"),date("Y")),$dateformat);
$end_date = $start_date;
}
else
@@ -734,11 +744,17 @@
if(is_array($content))
{
+ $p_year = date("Y",strtotime($start_date));
+ $p_month = date("m",strtotime($start_date));
$i=0;
while(each($content))
- {
- $sum=$sum+$content[$i]['consume'];
- $content[$i]['consume']
=number_format($content[$i]['consume'], 0, ',', ' ');
+ {
+ $p_start_date =
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,$content[$i]['period'],1,$p_year),$dateformat);
+ $p_end_date =
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,($content[$i]['period']+1),0,$p_year),$dateformat);
+
+ $sum =
$sum+$content[$i]['consume'];
+ $content[$i]['link_voucher'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvoice.index&paid=true&user_lid=all&district_id='.$district_id
. '&b_account_class=' . $b_account_class . '&start_date=' . $p_start_date .
'&end_date=' . $p_end_date);
+ $content[$i]['consume'] =
number_format($content[$i]['consume'], 0, ',', ' ');
$i++;
}
}
@@ -746,103 +762,103 @@
$table_header[] = array
(
- 'lang_district' =>
lang('District'),
- 'lang_period' =>
lang('Period'),
+ 'lang_district' =>
lang('District'),
+ 'lang_period' =>
lang('Period'),
'lang_budget_account' => lang('Budget
account'),
- 'lang_consume' =>
lang('Consume'),
+ 'lang_consume' =>
lang('Consume'),
);
$table_done[] = array
(
- 'lang_done' =>
lang('Done'),
+ 'lang_done' => lang('Done'),
'lang_done_statustext' => lang('Close this
window')
);
$link_data = array
(
'menuaction' =>
$this->currentapp.'.uiinvoice.consume',
- 'order' => $this->order,
- 'sort' => $this->sort,
- 'cat_id' =>
$this->cat_id,
+ 'order' => $this->order,
+ 'sort' => $this->sort,
+ 'cat_id' => $this->cat_id,
'district_id' => $district_id,
- 'sub' => $this->sub,
- 'query' => $this->query,
- 'start' => $this->start,
- 'filter' => $this->filter
+ 'sub' => $this->sub,
+ 'query' => $this->query,
+ 'start' => $this->start,
+ 'filter' => $this->filter
);
- $data['lang_sum']
= lang('Sum');
- $data['sum']
= number_format($sum, 0, ',', ' ');
- $data['overlib_source']
= './'.$this->currentapp.'/inc/overlib.js';
- $data['links']
= $links;
- $data['allow_allrows']
= false;
- $data['start_record']
= $this->start;
- $data['record_limit']
= $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- $data['num_records']
= count($content);
- $data['all_records']
= $this->bo->total_records;
- $data['link_url']
= $GLOBALS['phpgw']->link('/index.php',$link_data);
- $data['img_path']
= $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default');
- $data['lang_no_cat']
= lang('no category');
+ $data['lang_sum'] =
lang('Sum');
+ $data['sum'] =
number_format($sum, 0, ',', ' ');
+ $data['overlib_source'] =
'./'.$this->currentapp.'/inc/overlib.js';
+ $data['links'] =
$links;
+ $data['allow_allrows'] = false;
+ $data['start_record'] =
$this->start;
+ $data['record_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ $data['num_records'] =
count($content);
+ $data['all_records'] =
$this->bo->total_records;
+ $data['link_url'] =
$GLOBALS['phpgw']->link('/index.php',$link_data);
+ $data['img_path'] =
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default');
+ $data['lang_no_cat'] =
lang('no category');
$data['lang_cat_statustext'] =
lang('Select the category the building belongs to. To do not use a category
select NO CATEGORY');
- $data['select_name']
= 'cat_id';
- $data['select_action']
= $GLOBALS['phpgw']->link('/index.php',$link_data);
- $data['lang_no_district']
= lang('No district');
+ $data['select_name'] =
'cat_id';
+ $data['select_action'] =
$GLOBALS['phpgw']->link('/index.php',$link_data);
+ $data['lang_no_district'] =
lang('No district');
$data['lang_district_statustext'] =
lang('Select the district the selection belongs to. To do not use a district
select NO DISTRICT');
$data['select_district_name'] =
'district_id';
- $data['lang_searchfield_statustext'] = lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again');
- $data['lang_searchbutton_statustext'] = lang('Submit
the search string');
- $data['lang_search']
= lang('search');
- $data['query']
= $this->query;
- $data['form_action']
= $GLOBALS['phpgw']->link('/index.php',$link_data);
-
-
- $data['district_list']
= $this->bocommon->select_district_list('select',$district_id);
- $data['cat_list']
= $this->bo->select_category('select',$this->cat_id);
- $data['start_date']
= $start_date;
- $data['end_date']
= $end_date;
- $data['vendor_id']
= $vendor_id;
- $data['vendor_name']
= $vendor_name;
-
- $data['account_class_list']
= $this->bo->select_account_class($b_account_class);
- $data['lang_no_account_class_'] =
lang('No account');
- $data['lang_account_class_statustext'] = lang('Select
the account class the selection belongs to');
+ $data['lang_searchfield_statustext'] =
lang('Enter the search string. To show all entries, empty this field and press
the SUBMIT button again');
+ $data['lang_searchbutton_statustext'] =
lang('Submit the search string');
+ $data['lang_search'] =
lang('search');
+ $data['query'] =
$this->query;
+ $data['form_action'] =
$GLOBALS['phpgw']->link('/index.php',$link_data);
+
+
+ $data['district_list'] =
$this->bocommon->select_district_list('select',$district_id);
+ $data['cat_list'] =
$this->bo->select_category('select',$this->cat_id);
+ $data['start_date'] =
$start_date;
+ $data['end_date'] =
$end_date;
+ $data['vendor_id'] =
$vendor_id;
+ $data['vendor_name'] =
$vendor_name;
+
+ $data['account_class_list'] =
$this->bo->select_account_class($b_account_class);
+ $data['lang_no_account_class'] =
lang('No account');
+ $data['lang_account_class_statustext'] =
lang('Select the account class the selection belongs to');
$data['select_account_class_name'] =
'b_account_class';
- $cal_info = $this->bocommon->jscalendar();
- $jsDateFormat=$cal_info['jsDateFormat'];
+ $cal_info =
$this->bocommon->jscalendar();
+ $jsDateFormat =
$cal_info['jsDateFormat'];
- $data['jsDateFormat']
= $jsDateFormat;
- $data['date_img']
= $cal_info['img'];
- $data['lang_datetitle']
= lang('Select date');
+ $data['jsDateFormat'] =
$jsDateFormat;
+ $data['date_img'] =
$cal_info['img'];
+ $data['lang_datetitle'] =
lang('Select date');
$data['calendar_setup_start'] =
"Calendar.setup({inputField : 'start_date',ifFormat : '" . $jsDateFormat .
"',button : 'start_date-trigger'});";
- $data['calendar_setup_end']
= "Calendar.setup({inputField : 'end_date',ifFormat : '" . $jsDateFormat .
"',button : 'end_date-trigger'});";
+ $data['calendar_setup_end'] =
"Calendar.setup({inputField : 'end_date',ifFormat : '" . $jsDateFormat .
"',button : 'end_date-trigger'});";
- $data['lang_workorder']
= lang('Workorder ID');
+ $data['lang_workorder'] =
lang('Workorder ID');
$data['lang_workorder_statustext'] =
lang('enter the Workorder ID to search by workorder - at any date');
- $data['workorder_id']
= $workorder_id;
+ $data['workorder_id'] =
$workorder_id;
- $data['addressbook_link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor');
- $data['lang_select_vendor_statustext'] = lang('Select
the vendor by klicking this link');
- $data['lang_vendor']
= lang('Vendor');
+ $data['addressbook_link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor');
+ $data['lang_select_vendor_statustext'] =
lang('Select the vendor by klicking this link');
+ $data['lang_vendor'] =
lang('Vendor');
- $bolocation =
CreateObject($this->currentapp.'.bolocation');
-
$location_data=$bolocation->initiate_ui_location(array('type_id'=> 1));
+ $bolocation =
CreateObject($this->currentapp.'.bolocation');
+ $location_data =
$bolocation->initiate_ui_location(array('type_id'=> 1));
- $data['property_link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.index&lookup=1&type_id=1&lookup_name=0');
+ $data['property_link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.index&lookup=1&type_id=1&lookup_name=0');
- $data['lang_select_property_statustext']= lang('Select
the property by klicking this link');
+ $data['lang_select_property_statustext'] =
lang('Select the property by klicking this link');
$data['lang_property_statustext'] =
lang('Search by property');
- $data['lang_property']
= lang('property');
- $data['loc1']
= $loc1;
- $data['lang_search']
= lang('Search');
+ $data['lang_property'] =
lang('property');
+ $data['loc1'] = $loc1;
+ $data['lang_search'] =
lang('Search');
$data['lang_search_statustext'] =
lang('Search for paid invoices');
$data['table_header_consume'] =
$table_header;
- $data['values_consume']
= $content;
+ $data['values_consume'] = $content;
- $appname
= lang('consume');
- $function_msg
= lang('list consume');
+ $appname =
lang('consume');
+ $function_msg =
lang('list consume');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('consume' => $data));
Index: property/inc/class.uiworkorder.inc.php
diff -u property/inc/class.uiworkorder.inc.php:1.22
property/inc/class.uiworkorder.inc.php:1.23
--- property/inc/class.uiworkorder.inc.php:1.22 Tue May 9 20:15:45 2006
+++ property/inc/class.uiworkorder.inc.php Wed May 10 11:10:20 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage project
- * @version $Id: class.uiworkorder.inc.php,v 1.22 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: class.uiworkorder.inc.php,v 1.23 2006/05/10 11:10:20
sigurdne Exp $
*/
/**
@@ -88,7 +88,7 @@
'wo_hour_cat_id' =>
$this->wo_hour_cat_id,
'start_date' =>
$this->start_date,
'end_date' =>
$this->end_date,
- 'b_group' =>
$this->b_group
+ 'b_group' =>
$this->b_group,
'paid' => $this->paid,
);
$this->bo->save_sessiondata($data);
Index: property/inc/export/Agresso
diff -u property/inc/export/Agresso:1.32 property/inc/export/Agresso:1.33
--- property/inc/export/Agresso:1.32 Tue May 9 20:15:45 2006
+++ property/inc/export/Agresso Wed May 10 11:10:21 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage export
- * @version $Id: Agresso,v 1.32 2006/05/09 20:15:45 sigurdne Exp $
+ * @version $Id: Agresso,v 1.33 2006/05/10 11:10:21 sigurdne Exp $
*/
/**
@@ -289,11 +289,11 @@
if($operator == "-")
{
- $update_paid = ", paid = NULL";
+ $update_paid = ", paid = 1";
}
else
{
- $update_paid = ", paid = 1";
+ $update_paid = ", paid = 2";
}
$sql="UPDATE fm_workorder SET
$actual_cost_field=$actual_cost_field $operator $Belop $update_paid WHERE
id='$pmwrkord_code'";
Index: property/setup/tables_current.inc.php
diff -u property/setup/tables_current.inc.php:1.62
property/setup/tables_current.inc.php:1.63
--- property/setup/tables_current.inc.php:1.62 Tue May 9 20:15:45 2006
+++ property/setup/tables_current.inc.php Wed May 10 11:10:21 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_current.inc.php,v 1.62 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: tables_current.inc.php,v 1.63 2006/05/10 11:10:21
sigurdne Exp $
*/
$phpgw_baseline = array(
@@ -570,7 +570,7 @@
'integration' => array('type' =>
'int','precision' => '4','nullable' => True),
'charge_tenant' => array('type' =>
'int','precision' => '2','nullable' => True),
'claim_issued' => array('type' =>
'int','precision' => '2','nullable' => True),
- 'paid' => array('type' => 'int','precision' =>
'2','nullable' => True)
+ 'paid' => array('type' => 'int','precision' =>
'2','nullable' => True,'default' => '1')
),
'pk' => array('id'),
'fk' => array(),
Index: property/setup/tables_update.inc.php
diff -u property/setup/tables_update.inc.php:1.48
property/setup/tables_update.inc.php:1.49
--- property/setup/tables_update.inc.php:1.48 Tue May 9 20:15:45 2006
+++ property/setup/tables_update.inc.php Wed May 10 11:10:21 2006
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage setup
- * @version $Id: tables_update.inc.php,v 1.48 2006/05/09 20:15:45
sigurdne Exp $
+ * @version $Id: tables_update.inc.php,v 1.49 2006/05/10 11:10:21
sigurdne Exp $
*/
/**
@@ -1347,7 +1347,7 @@
{
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
-
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','paid', array('type'
=> 'int','precision' => '2','nullable' => True));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','paid', array('type'
=> 'int','precision' => '2','nullable' => True,'default' => '1'));
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.523';
Index: property/templates/base/invoice.xsl
diff -u property/templates/base/invoice.xsl:1.11
property/templates/base/invoice.xsl:1.12
--- property/templates/base/invoice.xsl:1.11 Mon Apr 17 11:36:05 2006
+++ property/templates/base/invoice.xsl Wed May 10 11:10:21 2006
@@ -1,4 +1,4 @@
-<!-- $Id: invoice.xsl,v 1.11 2006/04/17 11:36:05 sigurdne Exp $ -->
+<!-- $Id: invoice.xsl,v 1.12 2006/05/10 11:10:21 sigurdne Exp $ -->
<xsl:template name="app_data">
<xsl:choose>
@@ -652,6 +652,17 @@
<td align="left">
<xsl:call-template
name="user_lid_select"/>
</td>
+
+ <td align="left">
+ <xsl:variable
name="lang_account_class_statustext"><xsl:value-of
select="lang_account_class_statustext"/></xsl:variable>
+ <xsl:variable
name="select_account_class_name"><xsl:value-of
select="select_account_class_name"/></xsl:variable>
+ <select
name="{$select_account_class_name}" class="forms"
onMouseover="window.status='{$lang_account_class_statustext}'; return true;"
onMouseout="window.status='';return true;">
+ <option value=""><xsl:value-of
select="lang_no_account_class"/></option>
+ <xsl:apply-templates
select="account_class_list"/>
+ </select>
+
+ </td>
+
<td align="left">
<input type="text" name="loc1"
value="{loc1}" size="4" onMouseout="window.status='';return true;">
<xsl:attribute
name="onMouseover">
@@ -938,7 +949,7 @@
<xsl:variable
name="lang_account_class_statustext"><xsl:value-of
select="lang_account_class_statustext"/></xsl:variable>
<xsl:variable
name="select_account_class_name"><xsl:value-of
select="select_account_class_name"/></xsl:variable>
<select
name="{$select_account_class_name}" class="forms"
onMouseover="window.status='{$lang_account_class_statustext}'; return true;"
onMouseout="window.status='';return true;">
- <option value=""><xsl:value-of
select="lang_no_account_class_"/></option>
+ <option value=""><xsl:value-of
select="lang_no_account_class"/></option>
<xsl:apply-templates
select="account_class_list"/>
</select>
@@ -1098,8 +1109,10 @@
<td align="center">
<xsl:value-of select="account_class"/>
</td>
- <td align="right">
- <xsl:value-of select="consume"/>
+
+ <td align = "right">
+ <xsl:variable
name="link_voucher"><xsl:value-of select="link_voucher"/></xsl:variable>
+ <a href="{$link_voucher}"
onMouseover="window.status='{consume}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="consume"/></a>
</td>
</tr>
</xsl:template>
- [Phpgroupware-cvs] property inc/class.boinvoice.inc.php inc/class....,
Sigurd Nes <=