[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/export/Agresso, 1.9
From: |
nomail |
Subject: |
[Phpgroupware-cvs] property/inc/export/Agresso, 1.9 |
Date: |
Thu, 30 Sep 2004 19:02:46 +0200 |
Update of /property/inc/export
Modified Files:
Branch:
Agresso
date: 2004/09/30 17:02:46; author: sigurdne; state: Exp; lines: +81 -25
Log Message:
no message
=====================================================================
Index: property/inc/export/Agresso
diff -u property/inc/export/Agresso:1.8 property/inc/export/Agresso:1.9
--- property/inc/export/Agresso:1.8 Fri Sep 17 09:14:44 2004
+++ property/inc/export/Agresso Thu Sep 30 17:02:46 2004
@@ -485,25 +485,15 @@
return $message;
}
- //Formater beløp
- if ($oRsBilag[$k]['artid'] == 1)
- {
- $Belop = sprintf("%01.2f",
-$oRsBilag[$k][$BelopFelt]);
- }
- else
- {
- $Belop = sprintf("%01.2f",
$oRsBilag[$k][$BelopFelt]);
-
- }
-
- $Belop =$Belop *100;
-
+ $Belop_motpost =$oRsBilag[$k][$BelopFelt] *100;
+
//Skriv hovedbilag
$Buntnr =
sprintf("%-12s",date("md",time()) . 'F' .
substr($oRsBilag[$k]['bilagsnr'],-6));// verdi: MMDDFL, type: c12, plass: 1 - 12
$Forsystem = 'BI';// verdi: BI, type: c2,
plass: 13 - 14
$Bilagsart = sprintf("%2s",'');// verdi: ,
type: c2, plass: 15 - 16
- $Transtype = 'AP';// verdi: GL, type: c2,
plass: 17 - 18
+
+ $Transtype = 'GL';// verdi: GL, type: c2,
plass: 17 - 18
$Firmakode = sprintf("%-2s",'');// verdi:
Firmakode, type: c2, plass: 19 - 20
$Valuteringsdato=
date(Ymd,strtotime($oRsBilag[$k]['fakturadato']));// verdi: Dato, type: date,
plass: 251 - 258
@@ -556,23 +546,47 @@
//_debug_array($oRsUnderbilag);
$underbilag_count= count($oRsUnderbilag);
+ $last_record = $underbilag_count - 1;
for ($i=0;$i<$underbilag_count;$i++)
{
$BilagId = $oRsUnderbilag[$i]['id'];
- $Belop = sprintf("%01.2f",
$oRsUnderbilag[$i][$BelopFelt])*100;
- $Belop = sprintf("%019s",$Belop);
+ // $Belop = sprintf("%01.2f",
$oRsUnderbilag[$i][$BelopFelt])*100;
+ $Belop =
$oRsUnderbilag[$i][$BelopFelt]*100;
- if ($oRsUnderbilag[$i]['artid'] == 1)
- {
- $Belop = '+' . $Belop;
+ if($Belop < 0)
+ {
+ $Belop = abs($Belop);
+ $Belop =
sprintf("%019s",$Belop);
+
+ if ($oRsUnderbilag[$i]['artid']
== 2)
+ {
+ $Belop = '-' . $Belop;
+
+ }
+ else
+ {
+ $Belop = '+' . $Belop;
+ }
+
}
else
- {
- $Belop = '-' . $Belop;
+ {
+ $Belop =
sprintf("%019s",$Belop);
+
+ if ($oRsUnderbilag[$i]['artid']
== 2)
+ {
+ $Belop = '+' . $Belop;
+
+ }
+ else
+ {
+ $Belop = '-' . $Belop;
+ }
}
+
if($oRsUnderbilag[$i]['pmwrkord_code'])
{
//Hent DIM C
@@ -655,6 +669,51 @@
$Inkassokode . $Bet_mottager .
$Att_ansvarlig . $Resk_navn . $Postadresse . $Stat_Provins . $Sted .
$Bank_Postgiro_kontonr . $Betalingsmåte
. $Mva_reg_nr . $Postnummer . $Val_dok ."\r\n";
+ if($i==$last_record)
+ {
+
+
+ if($Belop_motpost < 0)
+ {
+ $Belop_motpost =
sprintf("%019s",abs($Belop_motpost));
+
+ if
($oRsUnderbilag[$i]['artid'] == 2)
+ {
+ $Belop_motpost
= '+' . $Belop_motpost;
+
+ }
+ else
+ {
+ $Belop_motpost
= '-' . $Belop_motpost;
+ }
+ }
+ else
+ {
+ $Belop_motpost =
sprintf("%019s",$Belop_motpost);
+
+ if
($oRsUnderbilag[$i]['artid'] == 2)
+ {
+ $Belop_motpost
= '-' . $Belop_motpost;
+
+ }
+ else
+ {
+ $Belop_motpost
= '+' . $Belop_motpost;
+ }
+ }
+
+ $Transtype = 'AP';//
verdi: GL, type: c2, plass: 17 - 18
+ $Valutabelop =
$Belop_motpost;// verdi: Beløp, type: money, plass: 90 - 109
+
$Belop_i_firmavaluta=$Belop_motpost;// verdi: Beløp, type: money, plass: 110 -
129
+
+ $buffer .= $Buntnr . $Forsystem
. $Bilagsart . $Transtype . $Firmakode . $Konto . $Dim_1 . $Dim_2 . $Dim_3 .
$Dim_4 .
+ $Dim_5 . $Dim_6 . $Dim_7 .
$Avgiftskode . $Avgiftssystem . $Valutakode . $Debet_Kredit . $Valutabelop .
+ $Belop_i_firmavaluta . $Antall
. $Belop2 . $Belop3 . $Belop4 . $Tekst . $Valuteringsdato . $Bilagsdato .
+ $Bilagsnr . $Periode . $ESL .
$Fakturanr . $Forfall . $Rab_forf . $Rabatt . $Avt_Kon . $Ordrenummer .
+ $Kid . $Bet_overforing .
$Status . $Resk_type . $Resk_nr . $Forskudd . $Fakturaref . $Fakturaref .
+ $Inkassokode . $Bet_mottager .
$Att_ansvarlig . $Resk_navn . $Postadresse . $Stat_Provins . $Sted .
+ $Bank_Postgiro_kontonr .
$Betalingsmåte . $Mva_reg_nr . $Postnummer . $Val_dok ."\r\n";
+ }
//Slett post i fm_ecobilag
if ($download=='on' && !$pre_transfer)
@@ -720,7 +779,6 @@
function
pre_transfer($buffer,$Filnavn,$batchid,$pre_tranfser_bilag)
{
-//_debug_array($Filnavn);
$fp = fopen($Filnavn, "wb");
fwrite($fp,$buffer);
if(fclose($fp))
@@ -728,8 +786,6 @@
$pre_transfer_ok = True;
}
-//_debug_array($pre_tranfser_bilag);
-
if($this->config->config_data['invoice_export_method']=='ftp')
{
$ftp = $this->phpftp_connect();
@@ -743,7 +799,7 @@
{
$newfile = basename($Filnavn);
}
-//_debug_array($newfile);
+
if (ftp_put($ftp,$newfile, $Filnavn,
FTP_BINARY))
{
for
($i=0;$i<count($pre_tranfser_bilag);$i++)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc/export/Agresso, 1.9,
nomail <=