phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc/class.boinvoice.inc.php, 1.3


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.boinvoice.inc.php, 1.3
Date: Wed, 28 Jul 2004 22:24:16 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.boinvoice.inc.php

date: 2004/07/28 20:24:16;  author: sigurdne;  state: Exp;  lines: +57 -1

Log Message:
no message
=====================================================================
Index: property/inc/class.boinvoice.inc.php
diff -u property/inc/class.boinvoice.inc.php:1.2 
property/inc/class.boinvoice.inc.php:1.3
--- property/inc/class.boinvoice.inc.php:1.2    Wed Jun  2 18:54:27 2004
+++ property/inc/class.boinvoice.inc.php        Wed Jul 28 20:24:16 2004
@@ -723,5 +723,61 @@
                                $this->so->delete($params);
                        }
                }
+
+               function add($values)
+               {
+                       $soXport    = 
CreateObject($this->currentapp.'.soXport');
+                       if($values['loc1']=$values['location']['loc1'])
+                       {
+                               $values['dima']=implode('',$values['location']);
+                       }
+
+                       $values['spbudact_code']=$values['b_account_id'];
+                       $values['fakturanr']=$values['invoice_num'];
+                       $values['spvend_code']=$values['vendor_id'];
+
+                       $values['belop'] = 
str_replace('kr','',$values['amount']);
+                       $values['belop'] = str_replace(' ','',$values['belop']);
+                       $values['belop'] = 
str_replace(',','.',$values['belop']);
+                       $values['godkjentbelop']=$values['belop'];
+
+                       $values['fakturadato'] = 
date($this->bocommon->dateformat,mktime(2,0,0,$values['smonth'],$values['sday'],$values['syear']));
+
+                       if($values['num_days'])
+                       {
+                               $values['forfallsdato'] = 
date($this->bocommon->dateformat,mktime(2,0,0,$values['smonth'],$values['sday'],$values['syear'])+(86400*$values['num_days']));
+                       }
+                       else
+                       {
+                               $values['forfallsdato'] = 
date($this->bocommon->dateformat,mktime(2,0,0,$values['emonth'],$values['eday'],$values['eyear']));
+                       }
+
+                       $values['artid']                        = 
$values['art'];
+                       $values['periode']                      = 
$values['smonth'];
+                       $values['dimb']                         = 
$values['dim_b'];
+                       $values['oppsynsmannid']        = $values['janitor'];
+                       $values['saksbehandlerid']      = $values['supervisor'];
+                       $values['budsjettansvarligid'] = 
$values['budget_responsible'];
+                       $values['kildeid']                      = 1;
+                       $values['kidnr']                        = 
$values['kid_nr'];
+                       $values['typeid']                       = 
$values['type'];
+
+
+                       if($values['auto_tax'])
+                       {
+                               $values['mvakode'] = 
$soXport->auto_tax($values['dima']);
+                       }
+
+                       $buffer[0]=$values;
+                       if($soXport->add($buffer)>0)
+                       {
+                               $receipt['message'][] = 
array('msg'=>lang('Invoice %1 is added',$values['bilagsnr']));
+                       }
+                       else
+                       {
+                               $receipt['error'][] = 
array('msg'=>lang('Invoice is NOT added!'));
+                       }
+                       return $receipt;
+               }
        }
 ?>




reply via email to

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