[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/export Agresso,1.16
From: |
ceb |
Subject: |
[Phpgroupware-cvs] property/inc/export Agresso,1.16 |
Date: |
Thu, 24 Feb 2005 14:30:44 -0000 |
Update of property/inc/export
Modified Files:
Branch: MAIN
Agresso lines: +72 -17
Log Message:
committed prop-18-branch version to head
====================================================
Index: property/inc/export/Agresso
diff -u property/inc/export/Agresso:1.15 property/inc/export/Agresso:1.16
--- property/inc/export/Agresso:1.15 Tue Nov 2 09:56:26 2004
+++ property/inc/export/Agresso Thu Jan 13 16:52:48 2005
@@ -56,8 +56,8 @@
function increment_batchid()
{
- $this->db->query("update fm_idgenerator set value =
value + 1 where name = 'Ecobatchid'");
- $this->db->query("select value from fm_idgenerator
where name = 'Ecobatchid'");
+ $this->db->query("update fm_idgenerator set value =
value + 1 where name = 'Ecobatchid'",__LINE__,__FILE__);
+ $this->db->query("select value from fm_idgenerator
where name = 'Ecobatchid'",__LINE__,__FILE__);
$this->db->next_record();
$bilagsnr = $this->db->f('value');
return $bilagsnr;
@@ -67,7 +67,7 @@
function next_batchid()
{
- $this->db->query("select value from fm_idgenerator
where name = 'Ecobatchid'");
+ $this->db->query("select value from fm_idgenerator
where name = 'Ecobatchid'",__LINE__,__FILE__);
$this->db->next_record();
$batchid = $this->db->f('value')+1;
@@ -85,7 +85,7 @@
function get_vendor_info($vendor_id='')
{
$sql = "select org_nr,konto_nr from fm_vendor where
id='$vendor_id'";
- $this->db->query($sql);
+ $this->db->query($sql,__LINE__,__FILE__);
$this->db->next_record();
$vendor_info= array(
@@ -96,6 +96,32 @@
return $vendor_info;
}
+ function get_order_title($order_id='')
+ {
+ $sql = "select type from fm_orders where
id='$order_id'";
+ $this->db->query($sql,__LINE__,__FILE__);
+ $this->db->next_record();
+
+ switch($this->db->f('type'))
+ {
+ case 'workorder':
+ $sql2 = "select title from fm_workorder
where id='$order_id'";
+
$this->db->query($sql2,__LINE__,__FILE__);
+ $this->db->next_record();
+ $order_title = $this->db->f('title');
+ break;
+ case 's_agreement':
+ $sql2 = "select descr as title from
fm_s_agreement where id='$order_id'";
+
$this->db->query($sql2,__LINE__,__FILE__);
+ $this->db->next_record();
+ $order_title = $this->db->f('title');
+ break;
+ }
+
+ return $order_title;
+ }
+
+
function select_invoice_roleback($day,$month,$year,$Filnavn)
{
@@ -242,7 +268,7 @@
// $download = 'on';
// $download = False;
$pre_transfer=True;
- $this->debug=False;
+// $this->debug=True;
//Generer batch ID
$batchid = $this->soXport->next_batchid();
@@ -256,12 +282,15 @@
//Velg ut alle perioder som har bilag som skal overføres
- $periode =
$this->select_periods_with_invoice_to_transfer($pre_transfer);
-
- for ($i=0;$i<count($periode);$i++)
+ if ($pre_transfer)
{
+ $periode =
$this->select_periods_with_invoice_to_transfer($pre_transfer);
- $receipt['message'][]= array('msg' =>
$this->OverforPeriode($batchid,$periode[$i],$download,$pre_transfer));
+ for ($i=0;$i<count($periode);$i++)
+ {
+
+ $receipt['message'][]= array('msg' =>
$this->OverforPeriode($batchid,$periode[$i],$download,$pre_transfer));
+ }
}
@@ -288,6 +317,8 @@
function errorhandler($error_desr)
{
+ $this->db->transaction_abort();
+
$meld = $error_desr;
//Vis feilmelding
@@ -452,6 +483,8 @@
//Bestem filnavn
+ $this->db->transaction_begin();
+
$Filnavn = $this->LagFilnavn($batchid,$pre_transfer);
if (!$Filnavn)
{
@@ -472,11 +505,9 @@
}
//Velg ut alle hoved bilag som skal overføres
-
+
$oRsBilag=$this->soXport->hoved_bilag($periode,$pre_transfer);
- $this->db->transaction_begin();
-
$bilag_count= count($oRsBilag);
for ($k=0;$k<$bilag_count;$k++)
{
@@ -557,8 +588,21 @@
$Bet_mottager = sprintf("%-8s",'');// verdi:
Blank, type: c8, plass: 416 - 423
$Att_ansvarlig =
sprintf("%-6s",$oRsBilag[$k]['saksbehandler']);// verdi: Blank, type: c6,
plass: 424 - 429
-
$vendor_info =
$this->get_vendor_info($oRsBilag[$k]['spvend_code']);
+
+ if(!$vendor_info['org_nr'])
+ {
+ $message = 'mangler org_nr for
reskontronr: ' . $oRsBilag[$k]['spvend_code'];
+ $this->errorhandler($message);
+ return $message;
+ }
+
+ if(!$vendor_info['konto_nr'])
+ {
+ $message = 'mangler konto for
reskontronr: ' . $oRsBilag[$k]['spvend_code'];
+ $this->errorhandler($message);
+ return $message;
+ }
$Resk_navn =
sprintf("%-50s",$vendor_info['org_nr']);// verdi: Fødselsnr, type: c50, plass:
430 - 479
$Postadresse = sprintf("%-160s",'');//
verdi: Blank, type: c160, plass: 480 - 639
@@ -575,7 +619,6 @@
$oRsUnderbilag=$this->soXport->select_underbilag($oRsBilag[$k]['bilagsnr']);
-//_debug_array($oRsUnderbilag);
$underbilag_count= count($oRsUnderbilag);
$last_record = $underbilag_count - 1;
@@ -674,11 +717,22 @@
$Belop2 = sprintf("%20s",'');//
verdi: Blank, type: f8, plass: 141 - 160
$Belop3 = sprintf("%20s",'');//
verdi: Blank, type: money, plass: 161 - 180
$Belop4 = sprintf("%20s",'');//
verdi: Blank, type: money, plass: 181 - 200
- $Tekst =
sprintf("%-50s",'');//sprintf("%-50s",substr($oRsOverfBilag['merknad'],0,50));//
verdi: Tekst, type: text (50), plass: 201 - 250
+
+
+ if($oRsOverfBilag['pmwrkord_code'])
+ {
+ $Tekst =
sprintf("%-50s",$this->get_order_title($oRsOverfBilag['pmwrkord_code']));//sprintf("%-50s",substr($oRsOverfBilag['merknad'],0,50));//
verdi: Tekst, type: text (50), plass: 201 - 250
+ }
+ else
+ {
+ $Tekst =
sprintf("%-50s",'');//sprintf("%-50s",substr($oRsOverfBilag['merknad'],0,50));//
verdi: Tekst, type: text (50), plass: 201 - 250
+ }
+
$Fakturanr =
sprintf("%-15s",$oRsOverfBilag['fakturanr']);// verdi: Fakturanr, type: c15,
plass: 283 - 297
$Ordrenummer =
sprintf("%-9s",$oRsOverfBilag['pmwrkord_code']);// verdi: Infodoc ordrenr,
type: i4, plass: 342 - 350
+
//Kopier verdier
if ($download=='on' && !$pre_transfer
&& !$this->debug)
{
@@ -707,6 +761,7 @@
$Dim_7 =
sprintf("%-4s",'');// verdi: Blank, type: c4, plass: 77 - 80
$Fakturanr =
sprintf("%-15s",'');// verdi: Fakturanr, type: c15, plass: 283 - 297
$Ordrenummer =
sprintf("%-9s",'');// verdi: Infodoc ordrenr, type: i4, plass: 342 - 350
+ $Tekst =
sprintf("%-50s",'');//sprintf("%-50s",substr($oRsOverfBilag['merknad'],0,50));//
verdi: Tekst, type: text (50), plass: 201 - 250
if($Belop_motpost < 0)
{
@@ -767,7 +822,7 @@
//Fullfør transaksjon
- if ($download=='on' && !$pre_transfer):
+ if ($download=='on' && !$pre_transfer && !$this->debug):
{
$fp = fopen($Filnavn, "wb");
fwrite($fp,$buffer);
@@ -787,7 +842,7 @@
$message = 'Noe gikk galt med
overføring av godkjendte fakturaer!';
}
}
- elseif($download=='on' && $pre_transfer):
+ elseif($download=='on' && $pre_transfer &&
!$this->debug):
{
$fp = fopen($Filnavn, "wb");
fwrite($fp,$buffer);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc/export Agresso,1.16,
ceb <=
- Prev by Date:
[Phpgroupware-cvs] property/inc class.uientity.inc.php, 1.7 class.uiinvestment.inc.php, 1.5 class.uigab.inc.php, 1.7 class.uidrawing.inc.php, 1.5 class.uicategory.inc.php, 1.5 class.uicustom.inc.php, 1.5 class.uidocument.inc.php, 1.5 class.uiinvoice.inc.php, 1.13 class.uipricebook.inc.php, 1.7 class.uiproject.inc.php, 1.11 class.uirequest.inc.php, 1.6 class.uis_agreement.inc.php, 1.14 class.uib_account.inc.php, 1.6 class.uip_of_town.inc.php, 1.5 class.uilookup.inc.php, 1.8 class.uimeter.inc.php, 1.5 class.uilocation.inc.php, 1.7 class.uiadmin_entity.inc.php, 1.5 class.sotemplate.inc.php, 1.3 class.sotts.inc.php, 1.3 class.sotts2.inc.php, 1.4 class.sostandard_entity.inc.php, 1.3 class.sostandard_3.inc.php, 1.5 class.sorequest.inc.php, 1.3 class.sos_agreement.inc.php, 1.11 class.sostandard_2.inc.php, 1.3 class.sowo_hour.inc.php, 1.3 class.soworkorder.inc.php, 1.4 class.uiadmin_location.inc.php, 1.5 class.uiagreement.inc.php, 1.6 class.uialarm.inc.php, 1.6 class.uistandard_2.inc.php, 1.5 class.uiadmin.inc.php, 1.6 class. uiXport.inc.php, 1.8 class.uiactor.inc.php, 1.7 class.uiasync.inc.php, 1.6 class.uitts.inc.php, 1.6 class.uiworkorder.inc.php, 1.5 hook_admin.inc.php, 1.10 hook_help.inc.php, 1.3 class.uiwo_hour.inc.php, 1.6 class.soproject.inc.php, 1.8 class.uistandard_entity.inc.php, 1.5 class.uitemplate.inc.php, 1.5 hook_home.inc.php, 1.3 hook_manual.inc.php, 1.4 hook_preferences.inc.php, 1.3 hook_settings.inc.php, 1.4 class.uistandard_3.inc.php, 1.5 class.bometer.inc.php, 1.3 class.bocommon.inc.php, 1.8 class.bocustom.inc.php, 1.3 class.bodocument.inc.php, 1.3 class.bocategory.inc.php, 1.3 class.bob_account.inc.php, 1.3 class.boalarm.inc.php, 1.8 class.boasync.inc.php, 1.2 class.bodrawing.inc.php, 1.3 class.boentity.inc.php, 1.4 class.sopricebook.inc.php, 1.8 class.bop_of_town.inc.php, 1.3 class.bopricebook.inc.php, 1.4 class.bolocation.inc.php, 1.4 class.boinvoice.inc.php, 1.12 class.bogab.inc.php, 1.3 class.boinvestment.inc.php, 1.3 class.boagreement.inc.php, 1.3 class.boadmin_location.inc.php, 1.3 class.boactor.inc.php ,1.4 class.boadmin.inc.php,1.3 class.boadmin_entity.inc.php,! 1.4 clas
- Next by Date:
[Phpgroupware-cvs] property/inc/pdf class.ezpdf.php, 1.3 class.pdf.php, 1.3
- Previous by thread:
[Phpgroupware-cvs] property/inc class.uientity.inc.php, 1.7 class.uiinvestment.inc.php, 1.5 class.uigab.inc.php, 1.7 class.uidrawing.inc.php, 1.5 class.uicategory.inc.php, 1.5 class.uicustom.inc.php, 1.5 class.uidocument.inc.php, 1.5 class.uiinvoice.inc.php, 1.13 class.uipricebook.inc.php, 1.7 class.uiproject.inc.php, 1.11 class.uirequest.inc.php, 1.6 class.uis_agreement.inc.php, 1.14 class.uib_account.inc.php, 1.6 class.uip_of_town.inc.php, 1.5 class.uilookup.inc.php, 1.8 class.uimeter.inc.php, 1.5 class.uilocation.inc.php, 1.7 class.uiadmin_entity.inc.php, 1.5 class.sotemplate.inc.php, 1.3 class.sotts.inc.php, 1.3 class.sotts2.inc.php, 1.4 class.sostandard_entity.inc.php, 1.3 class.sostandard_3.inc.php, 1.5 class.sorequest.inc.php, 1.3 class.sos_agreement.inc.php, 1.11 class.sostandard_2.inc.php, 1.3 class.sowo_hour.inc.php, 1.3 class.soworkorder.inc.php, 1.4 class.uiadmin_location.inc.php, 1.5 class.uiagreement.inc.php, 1.6 class.uialarm.inc.php, 1.6 class.uistandard_2.inc.php, 1.5 class.uiadmin.inc.php, 1.6 class. uiXport.inc.php, 1.8 class.uiactor.inc.php, 1.7 class.uiasync.inc.php, 1.6 class.uitts.inc.php, 1.6 class.uiworkorder.inc.php, 1.5 hook_admin.inc.php, 1.10 hook_help.inc.php, 1.3 class.uiwo_hour.inc.php, 1.6 class.soproject.inc.php, 1.8 class.uistandard_entity.inc.php, 1.5 class.uitemplate.inc.php, 1.5 hook_home.inc.php, 1.3 hook_manual.inc.php, 1.4 hook_preferences.inc.php, 1.3 hook_settings.inc.php, 1.4 class.uistandard_3.inc.php, 1.5 class.bometer.inc.php, 1.3 class.bocommon.inc.php, 1.8 class.bocustom.inc.php, 1.3 class.bodocument.inc.php, 1.3 class.bocategory.inc.php, 1.3 class.bob_account.inc.php, 1.3 class.boalarm.inc.php, 1.8 class.boasync.inc.php, 1.2 class.bodrawing.inc.php, 1.3 class.boentity.inc.php, 1.4 class.sopricebook.inc.php, 1.8 class.bop_of_town.inc.php, 1.3 class.bopricebook.inc.php, 1.4 class.bolocation.inc.php, 1.4 class.boinvoice.inc.php, 1.12 class.bogab.inc.php, 1.3 class.boinvestment.inc.php, 1.3 class.boagreement.inc.php, 1.3 class.boadmin_location.inc.php, 1.3 class.boactor.inc.php ,1.4 class.boadmin.inc.php,1.3 class.boadmin_entity.inc.php,! 1.4 clas
- Next by thread:
[Phpgroupware-cvs] property/inc/pdf class.ezpdf.php, 1.3 class.pdf.php, 1.3
- Index(es):