phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property list_workorder.php,1.7,1.8 add_workorde


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property list_workorder.php,1.7,1.8 add_workorder.php,1.6,1.7 list_invoice.php,1.6,1.7 edit_workorder.php,1.5,1.6 invoice_detail.php,1.4,1.5 view_workorder.php,1.4,1.5 list_project.php,1.3,1.4 add_invoice.php,1.2,1.3 edit_project.php,1.2,1.3 project_matrix.php,1.1,1.2
Date: Tue, 24 Sep 2002 11:44:49 -0400

Update of /cvsroot/phpgroupware/property
In directory subversions:/tmp/cvs-serv15647

Modified Files:
        list_workorder.php add_workorder.php list_invoice.php 
        edit_workorder.php invoice_detail.php view_workorder.php 
        list_project.php add_invoice.php edit_project.php 
        project_matrix.php 
Log Message:
no message

Index: list_workorder.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/list_workorder.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** list_workorder.php  20 Sep 2002 17:05:36 -0000      1.7
--- list_workorder.php  24 Sep 2002 15:44:47 -0000      1.8
***************
*** 79,84 ****
  //---------------------- nextmatch variable template-declarations 
---------------------------
  
!       $left = 
$GLOBALS['phpgw']->nextmatchs->left('/property/list_workorder.php',$start,$fm_wrkorder->total_records,"&coordinator_id=$coordinator_id&query_location=$query_location&query_vendor=$query_vendor&status=$status");
!       $right = 
$GLOBALS['phpgw']->nextmatchs->right('/property/list_workorder.php',$start,$fm_wrkorder->total_records,"&coordinator_id=$coordinator_id&query_location=$query_location&query_vendor=$query_vendor&status=$status");
        $t->set_var('left',$left);
        $t->set_var('right',$right);
--- 79,84 ----
  //---------------------- nextmatch variable template-declarations 
---------------------------
  
!       $left = 
$GLOBALS['phpgw']->nextmatchs->left('/property/list_workorder.php',$start,$fm_wrkorder->total_records,"&coordinator_id=$coordinator_id&query_location=$query_location&query_vendor=$query_vendor&status=$status&location_code=$location_code");
!       $right = 
$GLOBALS['phpgw']->nextmatchs->right('/property/list_workorder.php',$start,$fm_wrkorder->total_records,"&coordinator_id=$coordinator_id&query_location=$query_location&query_vendor=$query_vendor&status=$status&location_code=$location_code");
        $t->set_var('left',$left);
        $t->set_var('right',$right);
***************
*** 100,104 ****
        
$t->set_var('sort_status',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'status',$order,'/property/list_workorder.php',lang('Status')));
        
$t->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'title',$order,'/property/list_workorder.php',lang('Title')));
!       
$t->set_var('sort_end_date',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'end_date',$order,'/property/list_workorder.php',lang('Date
 due')));
        
$t->set_var('sort_coordinator',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'coordinator',$order,'/property/list_workorder.php',lang('Coordinator')));
        $t->set_var('lang_jobs',lang('Calculation'));
--- 100,104 ----
        
$t->set_var('sort_status',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'status',$order,'/property/list_workorder.php',lang('Status')));
        
$t->set_var('sort_title',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'title',$order,'/property/list_workorder.php',lang('Title')));
!       
$t->set_var('sort_entry_date',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'entry_date',$order,'/property/list_workorder.php',lang('Date
 registered')));
        
$t->set_var('sort_coordinator',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'coordinator',$order,'/property/list_workorder.php',lang('Coordinator')));
        $t->set_var('lang_jobs',lang('Calculation'));
***************
*** 164,169 ****
                $vendor = $pro[$i]['vendor'];
  
!               $end_date = $pro[$i]['end_date'];
!               if ($end_date == 0) { $end_dateout = '&nbsp;'; }
                else
                {
--- 164,169 ----
                $vendor = $pro[$i]['vendor'];
  
!               $entry_date = $pro[$i]['entry_date'];
!               if ($entry_date == 0) { $entry_dateout = '&nbsp;'; }
                else
                {
***************
*** 172,179 ****
                        $year = 
$GLOBALS['phpgw']->common->show_date(time(),'Y');
  
!                       $end_date = $end_date + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $end_dateout = 
$GLOBALS['phpgw']->common->show_date($end_date,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!       //              if (mktime(2,0,0,$month,$day,$year) == $end_date) { 
$end_dateout = '<b>' . $end_dateout . '</b>'; }
!       //              if (mktime(2,0,0,$month,$day,$year) >= $end_date) { 
$end_dateout = '<font color="CC0000"><b>' . $end_dateout . '</b></font>'; }
                }
  
--- 172,179 ----
                        $year = 
$GLOBALS['phpgw']->common->show_date(time(),'Y');
  
!                       $entry_date = $entry_date + (60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
!                       $entry_dateout = 
$GLOBALS['phpgw']->common->show_date($entry_date,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!       //              if (mktime(2,0,0,$month,$day,$year) == $entry_date) { 
$entry_dateout = '<b>' . $entry_dateout . '</b>'; }
!       //              if (mktime(2,0,0,$month,$day,$year) >= $entry_date) { 
$entry_dateout = '<font color="CC0000"><b>' . $entry_dateout . '</b></font>'; }
                }
  
***************
*** 193,197 ****
                                                'entrance_id'   => $entrance_id,
                                                'apartment_id'  => 
$apartment_id,
!                                               'end_date'      => $end_dateout,
                                                'coordinator'   => 
$coordinatorout));
  
--- 193,197 ----
                                                'entrance_id'   => $entrance_id,
                                                'apartment_id'  => 
$apartment_id,
!                                               'entry_date'    => 
$entry_dateout,
                                                'coordinator'   => 
$coordinatorout));
  

Index: add_workorder.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/add_workorder.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** add_workorder.php   19 Sep 2002 18:42:37 -0000      1.6
--- add_workorder.php   24 Sep 2002 15:44:47 -0000      1.7
***************
*** 281,285 ****
                        }
  
!                       
$GLOBALS['phpgw']->db->lock(array('fm_wo_wrkorders','boei_leietaker','fm_wo_wrkorderactivities','fm_wo_wrkorderbranch'));
  
                        $num_last=$num-1;
--- 281,285 ----
                        }
  
!                       
$GLOBALS['phpgw']->db->lock(array('fm_wo_wrkorders','boei_leietaker','fm_wo_wrkorderbranch'));
  
                        $num_last=$num-1;
***************
*** 385,403 ****
                        //      $p_id = $db2->f('maximum');
                                $p_id = $num;
-                               if (count($ba_activities) != 0)
-                               {
-                                       while($activ=each($ba_activities))
-                                       {
-                                               
$GLOBALS['phpgw']->db->query("insert into fm_wo_wrkorderactivities 
(wrkorder_id,activity_id,billable) values ('$p_id','$activ[1]','N')");
-                                       }
-                               }
- 
-                               if (count($bill_activities) != 0)
-                               {
-                                       while($activ=each($bill_activities))
-                                       {
-                                               
$GLOBALS['phpgw']->db->query("insert into fm_wo_wrkorderactivities 
(wrkorder_id,activity_id,billable) values ('$p_id','$activ[1]','Y')");
-                                       }
-                               }
  
        // -----------------which branch is represented
--- 385,388 ----

Index: list_invoice.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/list_invoice.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** list_invoice.php    20 Sep 2002 17:05:36 -0000      1.6
--- list_invoice.php    24 Sep 2002 15:44:47 -0000      1.7
***************
*** 844,847 ****
--- 844,864 ----
  
                        $belop=$bilag[$i]['belop'];
+ 
+                       $belop = round($belop,2);
+                       $place_comma=strrpos($belop, ".");
+                       $lenght=strlen ($belop);
+ 
+       //              echo 'place_comma: '.$place_comma .'<BR>';
+       //              echo 'lenght: '.$lenght .'<BR>';
+ 
+                       if($place_comma>($lenght-3))
+                       {
+                       $belop.=0;
+                       }
+ 
+                       if($belop && !$place_comma)
+                       {
+                       $belop.=".00";
+                       }
                        if (! $belop)  $belop  = '&nbsp;';
  

Index: edit_workorder.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/edit_workorder.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** edit_workorder.php  18 Sep 2002 19:54:15 -0000      1.5
--- edit_workorder.php  24 Sep 2002 15:44:47 -0000      1.6
***************
*** 242,246 ****
                        }
  
!                       
$GLOBALS['phpgw']->db->lock(array('fm_wo_wrkorders','boei_leietaker','fm_wo_wrkorderactivities','fm_wo_wrkorderbranch'));
  
                        $GLOBALS['phpgw']->db->query("update fm_wo_wrkorders 
set project_id=$project_id_value, access='$access', category='$cat_id', 
entry_date='" . time() . "', start_date='"
--- 242,246 ----
                        }
  
!                       
$GLOBALS['phpgw']->db->lock(array('fm_wo_wrkorders','boei_leietaker','fm_wo_wrkorderbranch'));
  
                        $GLOBALS['phpgw']->db->query("update fm_wo_wrkorders 
set project_id=$project_id_value, access='$access', category='$cat_id', 
entry_date='" . time() . "', start_date='"
***************
*** 258,262 ****
  
  
- //                    $GLOBALS['phpgw']->db->query("delete from 
fm_wo_wrkorderactivities where wrkorder_id='$id' and billable='N'");
  
  //------------------Integration with FacilityCenter
--- 258,261 ----
***************
*** 297,320 ****
                        }
  //------------------Integration with FacilityCenter
- 
-                       if (count($ba_activities) != 0)
-                       {
-                               while($activ=each($ba_activities))
-                               {
-                                       $GLOBALS['phpgw']->db->query("insert 
into fm_wo_wrkorderactivities (wrkorder_id, activity_id, billable) values 
('$id','$activ[1]','N')");
-                               }
-                       }
- 
-                       $GLOBALS['phpgw']->db->query("delete from 
fm_wo_wrkorderactivities where wrkorder_id='$id' and billable='Y'");
- 
-                       if (count($bill_activities) != 0)
-                       {
-                               while($activ=each($bill_activities))
-                               {
-                                       $GLOBALS['phpgw']->db->query("delete 
from fm_wo_wrkorderactivities where wrkorder_id='$id' and 
activity_id='$activ[1]' and billable='N'");
-                                       $GLOBALS['phpgw']->db->query("insert 
into fm_wo_wrkorderactivities (wrkorder_id, activity_id, billable) values 
('$id','$activ[1]','Y')");
-                               }
-                       }
- 
  // -----------update branches----------------
                        $GLOBALS['phpgw']->db->query("delete from 
fm_wo_wrkorderbranch where wrkorder_id='$id' ");
--- 296,299 ----
***************
*** 652,655 ****
--- 631,635 ----
  
        $abid = $GLOBALS['phpgw']->db->f('vendor');
+       $status = $GLOBALS['phpgw']->db->f('status');
  
        $budget = $GLOBALS['phpgw']->db->f('budget');

Index: invoice_detail.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/invoice_detail.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** invoice_detail.php  2 Sep 2002 15:22:23 -0000       1.4
--- invoice_detail.php  24 Sep 2002 15:44:47 -0000      1.5
***************
*** 83,86 ****
--- 83,88 ----
                $errorcount = 0;
  
+               $GLOBALS['phpgw']->db->transaction_begin();
+ 
                while($entry=each($select))
                {
***************
*** 144,149 ****
                        if (! $local_error)
                        {
-                               
$GLOBALS['phpgw']->db->lock(array('fm_wo_wrkorders','t_ecobilag'));
  
                                if($close_order[$n])
                                {
--- 146,152 ----
                        if (! $local_error)
                        {
  
+ //                            $sql="update t_ecobilag set  $dima_field , 
$dimd_field, mvakode = '$mvakode[$n]',spbudact_code = '$wo_account_id[$n]' 
where id='$invoice_id_h[$n]'";
+ //                            echo 'sql: '.$sql .'<BR>';
                                if($close_order[$n])
                                {
***************
*** 151,162 ****
                                }
  
- 
-                       //      $GLOBALS['phpgw']->db->query("update t_ecobilag 
set  godkjentbelop = CONVERT(MONEY,"."'$godkjentbelop[$n]'".",0) , $dima_field 
, $dimd_field, mvakode = '$mvakode[$n]',spbudact_code = '$wo_account_id[$n]' 
where id='$invoice_id_h[$n]'");
                                $GLOBALS['phpgw']->db->query("update t_ecobilag 
set  $dima_field , $dimd_field, mvakode = '$mvakode[$n]',spbudact_code = 
'$wo_account_id[$n]' where id='$invoice_id_h[$n]'");
- 
-                               $GLOBALS['phpgw']->db->unlock();
- 
                        }
                }
        }
  
--- 154,162 ----
                                }
  
                                $GLOBALS['phpgw']->db->query("update t_ecobilag 
set  $dima_field , $dimd_field, mvakode = '$mvakode[$n]',spbudact_code = 
'$wo_account_id[$n]' where id='$invoice_id_h[$n]'");
                        }
                }
+               $GLOBALS['phpgw']->db->transaction_commit();
+ 
        }
  
***************
*** 264,268 ****
        $remark_table='t_ecobilag';
  
!       $sql = "SELECT  fm_wo_wrkorders.status, t_ecobilag.id, 
pmwrkord_code,spbudact_code,dima,dimb,dimd,merknad,mvakode,belop, 
godkjentbelop, bilagsnr,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
                . 
"utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,fakturadato,charge_tenant,fakturanr,"
                . "forfallsdato,periode,artid,kidnr FROM t_ecobilag left join 
fm_wo_wrkorders on fm_wo_wrkorders.id = t_ecobilag.pmwrkord_code "
--- 264,268 ----
        $remark_table='t_ecobilag';
  
!       $sql = "SELECT  fm_wo_wrkorders.status, t_ecobilag.id, 
pmwrkord_code,spbudact_code,dima,dimb,dimd,merknad,t_ecobilag.mvakode,belop, 
godkjentbelop, bilagsnr,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
                . 
"utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,fakturadato,charge_tenant,fakturanr,"
                . "forfallsdato,periode,artid,kidnr FROM t_ecobilag left join 
fm_wo_wrkorders on fm_wo_wrkorders.id = t_ecobilag.pmwrkord_code "
***************
*** 424,428 ****
                if ($status_order == 'Avsluttet')
                {
!                       $checked_closed = 'checked';
                }
                else
--- 424,428 ----
                if ($status_order == 'Avsluttet')
                {
!                       $checked_closed = 'x';
                }
                else
***************
*** 431,436 ****
                }
  
- 
- 
                $wrkorder_id = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('pmwrkord_code'));
                if (! $wrkorder_id)
--- 431,434 ----
***************
*** 442,451 ****
                else
                {
!                       $close_order = '<input type="checkbox" 
name="close_order[' . $j . ']" value="'. $j . '"' .$checked_closed .'>';
                        $wrkorder_id_h ='<input type="hidden" size = "6" 
name="wrkorder_id_h[' . $j . ']" value="'. $wrkorder_id . '">';
                }
  
- 
- 
                $wo_account_id_temp = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('spbudact_code'));
                $wo_account_id ='<input type="text"  size = "4" 
name="wo_account_id[' . $j . ']" value="'. $wo_account_id_temp . '">';
--- 440,447 ----
                else
                {
!                       $close_order = '<input type="checkbox" 
name="close_order[' . $j . ']" value="'. $j . '" checked >'.$checked_closed;
                        $wrkorder_id_h ='<input type="hidden" size = "6" 
name="wrkorder_id_h[' . $j . ']" value="'. $wrkorder_id . '">';
                }
  
                $wo_account_id_temp = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('spbudact_code'));
                $wo_account_id ='<input type="text"  size = "4" 
name="wo_account_id[' . $j . ']" value="'. $wo_account_id_temp . '">';
***************
*** 469,496 ****
                }
  
!               $mvakode_temp = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('mvakode'));
! 
  //---------------mva -----------------------------
!       if ($mvakode_temp=='0'):
!               $mva_sel[0]=' selected';
! 
!       elseif ($mvakode_temp=='1'):
!               $mva_sel[1]=' selected';
! 
!       elseif ($mvakode_temp=='2'):
!               $mva_sel[2]=' selected';
  
!       elseif ($mvakode_temp=='3'):
!               $mva_sel[3]=' selected';
! 
!       elseif ($mvakode_temp=='4'):
!               $mva_sel[4]=' selected';
! 
!       elseif ($mvakode_temp=='5'):
!               $mva_sel[5]=' selected';
! 
!       endif;
  
!       $mvakode_list = '<option value="0"' . $mva_sel[0] . '>0</option>' . "\n"
                        . '<option value="1"' . $mva_sel[1] . '>1</option>' . 
"\n"
                        . '<option value="2"' . $mva_sel[2] . '>2</option>' . 
"\n"
--- 465,487 ----
                }
  
!               $mvakode_temp = $GLOBALS['phpgw']->db->f('mvakode');
  //---------------mva -----------------------------
!               $mva_sel='';
  
!               if ($mvakode_temp=='0'):
!                       $mva_sel[0]=' selected';
!               elseif ($mvakode_temp=='1'):
!                       $mva_sel[1]=' selected';
!               elseif ($mvakode_temp=='2'):
!                       $mva_sel[2]=' selected';
!               elseif ($mvakode_temp=='3'):
!                       $mva_sel[3]=' selected';
!               elseif ($mvakode_temp=='4'):
!                       $mva_sel[4]=' selected';
!               elseif ($mvakode_temp=='5'):
!                       $mva_sel[5]=' selected';
!               endif;
  
!               $mvakode_list = '<option value="0"' . $mva_sel[0] . 
'>0</option>' . "\n"
                        . '<option value="1"' . $mva_sel[1] . '>1</option>' . 
"\n"
                        . '<option value="2"' . $mva_sel[2] . '>2</option>' . 
"\n"
***************
*** 499,505 ****
                        . '<option value="5"' . $mva_sel[5] . '>5</option>' . 
"\n";
  
!       $t->set_var('mvakode_list',$mvakode_list);
  
!       $mvakode ='<td><select name="mvakode[' . $j . 
']">'.$mvakode_list.'</select></td>';
  
  
--- 490,496 ----
                        . '<option value="5"' . $mva_sel[5] . '>5</option>' . 
"\n";
  
!               $t->set_var('mvakode_list',$mvakode_list);
  
!               $mvakode ='<td><select name="mvakode[' . $j . 
']">'.$mvakode_list.'</select></td>';
  
  
***************
*** 531,537 ****
                if (! $periode)  $periode  = '&nbsp;';
  
!               $belop = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('belop'));
!               if (! $belop)  $belop  = '&nbsp;';
  
  
                $fakturanr = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('fakturanr'));
--- 522,542 ----
                if (! $periode)  $periode  = '&nbsp;';
  
!               $belop = round($GLOBALS['phpgw']->db->f('belop'),2);
!               $place_comma=strrpos($belop, ".");
!               $lenght=strlen ($belop);
! 
! //            echo 'place_comma: '.$place_comma .'<BR>';
! //            echo 'lenght: '.$lenght .'<BR>';
  
+               if($place_comma>($lenght-3))
+               {
+               $belop.=0;
+               }
+ 
+               if($belop && !$place_comma)
+               {
+               $belop.=".00";
+               }
+               if (! $belop)  $belop  = '&nbsp;';
  
                $fakturanr = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('fakturanr'));

Index: view_workorder.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/view_workorder.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** view_workorder.php  18 Sep 2002 19:54:15 -0000      1.4
--- view_workorder.php  24 Sep 2002 15:44:47 -0000      1.5
***************
*** 435,440 ****
        }
  
!       $t->set_var('mail_adress',$mail_adress);
  
  
        $GLOBALS['phpgw']->db->query("select omraade_id from boei_bydel as b 
$join boei_objekt as o on b.bydel_id=o.bydel_id  where o.objekt_id  
='$objekt_id'");
--- 435,470 ----
        }
  
! //    $t->set_var('mail_adress',$mail_adress);
  
+       $email_list = '<option value="">' . lang(Select_email)  . '</option>' . 
"\n"
+                               .'<option value="'.$db2->f('email') .'">' . 
$db2->f('email')  . '</option>' . "\n";
+ 
+       $GLOBALS['phpgw']->db->query("select contact_value from 
phpgw_addressbook_extra where contact_id='$vendor_id' and contact_value like 
'address@hidden'");
+       while ($GLOBALS['phpgw']->db->next_record())
+       {
+               $extra_address=True;
+               $contact_value = $GLOBALS['phpgw']->db->f('contact_value');
+ //            echo 'contact_value: '.$contact_value .'<BR>';
+ 
+               $email_list .= '<option value="'.$contact_value .'">' . 
$contact_value  . '</option>' . "\n";
+ 
+       }
+ 
+       if ($extra_address)
+       {
+ 
+               $to_mail_adress_field='<select name="to_mail_adress"> 
'.$email_list .'</select>';
+               $t->set_var('lang_update_email','');
+               $t->set_var('update_email','');
+       }
+       else
+       {
+               $to_mail_adress_field='<input type="text" name="to_mail_adress" 
value="'.$mail_adress.'">';
+               $t->set_var('update_email','<input type="checkbox" 
name="update_email" value="True" >');
+               $t->set_var('lang_update_email',lang('Update email'));
+       }
+       $t->set_var('to_mail_adress_field',$to_mail_adress_field);
+ 
+ //    echo 'email_list:<select> '.$email_list .'</select>';
  
        $GLOBALS['phpgw']->db->query("select omraade_id from boei_bydel as b 
$join boei_objekt as o on b.bydel_id=o.bydel_id  where o.objekt_id  
='$objekt_id'");
***************
*** 570,575 ****
        }
  
-       $t->set_var('update_email','<input type="checkbox" name="update_email" 
value="True" >');
-       $t->set_var('lang_update_email',lang('Update email'));
  
        if ($view_one_page)
--- 600,603 ----

Index: list_project.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/list_project.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** list_project.php    22 Sep 2002 20:10:48 -0000      1.3
--- list_project.php    24 Sep 2002 15:44:47 -0000      1.4
***************
*** 193,197 ****
        $t->set_var('lang_start_date',lang('Start Date'));
        $t->set_var('lang_user',lang('User'));
! 
  //    $property_table= boei_objekt;
  //    $t->set_var('property_table',$property_table);
--- 193,198 ----
        $t->set_var('lang_start_date',lang('Start Date'));
        $t->set_var('lang_user',lang('User'));
!       $t->set_var('lang_project_matrix',lang('Project matrix'));
!       $t->set_var('lang_project_matrix_help',lang('Time plane'));
  //    $property_table= boei_objekt;
  //    $t->set_var('property_table',$property_table);

Index: add_invoice.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/add_invoice.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** add_invoice.php     2 Sep 2002 15:22:23 -0000       1.2
--- add_invoice.php     24 Sep 2002 15:44:47 -0000      1.3
***************
*** 38,58 ****
        if ($submit)
        {
-               $bilagsnr = create_voucherid($year);
- 
  
                $errorcount = 0;
  
-               if (!$bilagsnr)
-               {
-                       $error[$errorcount++] = lang('Generating voucher_id 
failed!');
-               }
- 
-               $GLOBALS['phpgw']->db->query("select count(*) from t_ecobilag 
where bilagsnr='$bilagsnr'");
-               $GLOBALS['phpgw']->db->next_record();
-               if ($GLOBALS['phpgw']->db->f(0) != 0)
-               {
-                       $error[$errorcount++] = lang('That Voucher ID has been 
used already !');
-               }
- 
                if (checkdate($smonth,$sday,$syear))
                {
--- 38,44 ----
***************
*** 126,142 ****
                if (! $error)
                {
  
!                               $GLOBALS['phpgw']->db->query("insert into 
t_ecobilag (bilagsnr, kidnr, typeid, kildeid, pmwrkord_code, belop, 
fakturadato,"
!                               . "periode, forfallsdato, fakturanr, 
spbudact_code, regtid, artid, godkjentbelop,spvend_code, dima,dimb ,mvakode, 
dimd,"
!                               . " 
oppsynsmannid,saksbehandlerid,budsjettansvarligid,oppsynsigndato,saksigndato,budsjettsigndato,merknad,kreditnota)"
!                               . "values "
!                               . "( '$bilagsnr', '$kid_nr', '$type' , '3' 
,'$order_id',CONVERT(MONEY,"."'$belop'".",0), '$fakturadato', 
'$periode','$forfallsdato', '$invoice_num', "
!                                               . " 
'$account_id','$regtid','$art',CONVERT(MONEY,"."'$belop'".",0),'$abid', 
'$dim_a', 
'$dim_b','$tax_code','$dim_d','$janitor','$supervisor','$budget_responsible',"
!                                               . " 
$oppsynsigndato,$saksigndato,$budsjettsigndato,'$merknad','$kreditnota') ");
! 
!                               $GLOBALS['phpgw']->db->query("update 
IDGenerator set value='$bilagsnr' where name='Bilagsnummer'");
  
                }
! }
  
  //-----------------------
--- 112,133 ----
                if (! $error)
                {
+                       $GLOBALS['phpgw']->db->transaction_begin();
  
!                       $GLOBALS['phpgw']->db->query("select value from 
IDGenerator where name = 'Bilagsnummer'");
!                       $GLOBALS['phpgw']->db->next_record();
!                       $bilagsnr = $GLOBALS['phpgw']->db->f('value')+1;
! 
!                       $GLOBALS['phpgw']->db->query("insert into t_ecobilag 
(bilagsnr, kidnr, typeid, kildeid, pmwrkord_code, belop, fakturadato,"
!                       . "periode, forfallsdato, fakturanr, spbudact_code, 
regtid, artid, godkjentbelop,spvend_code, dima,dimb ,mvakode, dimd,"
!                       . " 
oppsynsmannid,saksbehandlerid,budsjettansvarligid,oppsynsigndato,saksigndato,budsjettsigndato,merknad,kreditnota)"
!                       . "values "
!                       . "( '$bilagsnr', '$kid_nr', '$type' , '3' 
,'$order_id',CONVERT(MONEY,"."'$belop'".",0), '$fakturadato', 
'$periode','$forfallsdato', '$invoice_num', "
!                       . " 
'$account_id','$regtid','$art',CONVERT(MONEY,"."'$belop'".",0),'$abid', 
'$dim_a', 
'$dim_b','$tax_code','$dim_d','$janitor','$supervisor','$budget_responsible',"
!                       . " 
$oppsynsigndato,$saksigndato,$budsjettsigndato,'$merknad','$kreditnota') ");
  
+                       $GLOBALS['phpgw']->db->query("update IDGenerator set 
value='$bilagsnr' where name='Bilagsnummer'");
+                       $GLOBALS['phpgw']->db->transaction_commit();
                }
!       }
  
  //-----------------------
***************
*** 159,162 ****
--- 150,154 ----
        
$t->set_var('tenant_link',$GLOBALS['phpgw']->link('/property/tenant.php','query='));
        
$t->set_var('addressbook_link',$GLOBALS['phpgw']->link('/property/addressbook.php','query='));
+       
$t->set_var('budget_account_link',$GLOBALS['phpgw']->link('/property/search_b_account.php','query='));
        $t->set_var('lang_action',lang('Add invoice'));
        $t->set_var('lang_select_account',lang('Select Budget Account'));
***************
*** 206,209 ****
--- 198,202 ----
        $t->set_var('lang_kreditnota',lang('Kreditnota'));
        $t->set_var('lang_wait_for_kreditnota',lang('Wait for Kreditnota'));
+       $t->set_var('account_id',$account_id);
  
        if($kreditnota)
***************
*** 217,237 ****
        $t->set_var('kreditnota',$kreditnota);
  
- //---------------- budgetting accounts
- 
-       $GLOBALS['phpgw']->db->query("SELECT * FROM fm_wo_accounts order by 
account_id asc ");
-       while ($GLOBALS['phpgw']->db->next_record())
-       {
-               $account_list .= '<option value="' . 
$GLOBALS['phpgw']->db->f('account_id') . '"';
-               
if($GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('account_id'))==$account_id)
-                       $account_list .= ' selected';
-                       $account_list .= '>'
-                       . 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('account_id'))
-                       . ' ['. 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('descr'))
-                       . '] ' .  '</option>';
- 
-       }
- 
-       $t->set_var('account_list',$account_list);
- 
        $t->set_var('lang_budget_account',lang('Budget account'));
  
--- 210,213 ----
***************
*** 331,335 ****
        $user_id=$GLOBALS['phpgw_info']['user']['account_id'];
  
!       $GLOBALS['phpgw']->db->query(" SELECT * from fm_admin  where account_id 
= $user_id");
        $GLOBALS['phpgw']->db->next_record();
        $is_janitor = $GLOBALS['phpgw']->db->f('janitor');
--- 307,311 ----
        $user_id=$GLOBALS['phpgw_info']['user']['account_id'];
  
!       $GLOBALS['phpgw']->db->query(" SELECT * from fm_admin  where sub_module 
= 'invoice' and account_id = $user_id");
        $GLOBALS['phpgw']->db->next_record();
        $is_janitor = $GLOBALS['phpgw']->db->f('janitor');
***************
*** 429,433 ****
        $t->set_var('lang_coordinator',lang('Coordinator'));
  
!       $employees = $GLOBALS['phpgw']->accounts->get_list('accounts', $start, 
$sort, $order, $query);
        while (list($null,$account) = each($employees))
        {
--- 405,411 ----
        $t->set_var('lang_coordinator',lang('Coordinator'));
  
! //    $employees = $GLOBALS['phpgw']->accounts->get_list('accounts', $start, 
$sort, $order, $query);
! 
!       $employees=get_list_role('janitor',$join);
        while (list($null,$account) = each($employees))
        {
***************
*** 441,445 ****
        $t->set_var('janitor_list',$janitor_list);
  
!       $employees = $GLOBALS['phpgw']->accounts->get_list('accounts', $start, 
$sort, $order, $query);
        while (list($null,$account) = each($employees))
        {
--- 419,423 ----
        $t->set_var('janitor_list',$janitor_list);
  
!       $employees=get_list_role('supervisor',$join);
        while (list($null,$account) = each($employees))
        {
***************
*** 453,457 ****
        $t->set_var('supervisor_list',$supervisor_list);
  
!       $employees = $GLOBALS['phpgw']->accounts->get_list('accounts', $start, 
$sort, $order, $query);
        while (list($null,$account) = each($employees))
        {
--- 431,435 ----
        $t->set_var('supervisor_list',$supervisor_list);
  
!       $employees=get_list_role('budget_responsible',$join);
        while (list($null,$account) = each($employees))
        {

Index: edit_project.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/edit_project.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** edit_project.php    19 Sep 2002 18:42:37 -0000      1.2
--- edit_project.php    24 Sep 2002 15:44:47 -0000      1.3
***************
*** 383,386 ****
--- 383,387 ----
  
        $abid = $GLOBALS['phpgw']->db->f('vendor');
+       $status = $GLOBALS['phpgw']->db->f('status');
  
        $budget = $GLOBALS['phpgw']->db->f('budget');
***************
*** 452,456 ****
  
  
-       $t->set_var('status_list',$status_list);
        $t->set_var('lang_start_date',lang('Start date'));
        $t->set_var('lang_end_date',lang('Date due'));
--- 453,456 ----

Index: project_matrix.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/project_matrix.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** project_matrix.php  22 Sep 2002 20:10:48 -0000      1.1
--- project_matrix.php  24 Sep 2002 15:44:47 -0000      1.2
***************
*** 14,17 ****
--- 14,26 ----
        include('../header.inc.php');
  
+       if ($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
+       {
+               $join = " JOIN ";
+       }
+       else
+       {
+               $join = " LEFT JOIN ";
+       }
+ 
        $this->matrix     = CreateObject('phpgwapi.matrixview');
  
***************
*** 33,37 ****
  
        $db2 = $GLOBALS['phpgw']->db;
!       $sql = "SELECT * from fm_wo_wrkorders where project_id = $project_id ";
        $db2->query($sql,__LINE__,__FILE__);
        while ($db2->next_record())
--- 42,46 ----
  
        $db2 = $GLOBALS['phpgw']->db;
!       $sql = "SELECT fm_wo_wrkorders.title,start_date,end_date,org_name from 
fm_wo_wrkorders $join phpgw_addressbook on 
fm_wo_wrkorders.vendor=phpgw_addressbook.id where project_id = $project_id ";
        $db2->query($sql,__LINE__,__FILE__);
        while ($db2->next_record())
***************
*** 41,45 ****
                $startd = date('Y',$db2->f('start_date')) . 
date('m',$db2->f('start_date')) . date('d',$db2->f('start_date'));
                $endd = date('Y',$db2->f('end_date')) . 
date('m',$db2->f('end_date')) . date('d',$db2->f('end_date'));
!               
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($db2->f('title')),$startd,$endd,$colors[$ind]);
        }
        
$this->matrix->out($GLOBALS['phpgw']->link('/property/project_matrix.php','project_id='.$project_id));
--- 50,54 ----
                $startd = date('Y',$db2->f('start_date')) . 
date('m',$db2->f('start_date')) . date('d',$db2->f('start_date'));
                $endd = date('Y',$db2->f('end_date')) . 
date('m',$db2->f('end_date')) . date('d',$db2->f('end_date'));
!               
$this->matrix->setPeriod($GLOBALS['phpgw']->strip_html($db2->f('org_name')),$startd,$endd,$colors[$ind]);
        }
        
$this->matrix->out($GLOBALS['phpgw']->link('/property/project_matrix.php','project_id='.$project_id));





reply via email to

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