AW: OSC jtl-Connection bei Tabellen Prefix (kontent.de)
Ich habe mir mal die ungewisse Wartezeit damit vertrieben in den Scripten die Tabellennamen zu suchen und manuell mit meinem prefix (Sho_01_) Versehen.
Das ist zwar etwas verwegen, weil die Gefahr eines Fehlers recht groß ist, aber irgendwie muss man ja mal weiterkommen
Als nächstes wollte ich nun den existierenden Web-
Shop in die
Wawi importieren, also hab eich "abgleichen" gewählt und prompt in einen neuen Fehler gestolpert:
GetBestellungPos.php meldet mir einen Returncode 200 zurück.
Anbei zur Veranschaulichung die von mir modifizierte Datei:
<?php
/**
* jtlwawi_Connector/dbeS/GetBestellungPos.php
* Synchronisationsscript
*
* Es gelten die Nutzungs- und Lizenzhinweise unter
JTL-Wawi - kostenlose Warenwirtschaft für Onlineshops und den stationären Vertrieb
*
* @author JTL-Software <thomas@jtl-software.de>
* @copyright 2006, JTL-Software
* @link
JTL-Wawi - kostenlose Warenwirtschaft für Onlineshops und den stationären Vertrieb
* @version v1.02 / 15.08.06
*/
require_once("syncinclude.php");
$return=3;
if (auth())
{
$return=5;
if (intval($_POST['KeyBestellung']))
{
//glob einstellungen
$cur_query = eS_execute_query("select versandMwst,tax_zone_id from eazysales_einstellungen");
$einstellungen = mysql_fetch_object($cur_query);
$return = 0;
//hole orderposes
$cur_query = eS_execute_query("select * from Sho_01_orders_products where orders_id=".intval($_POST['KeyBestellung'])." order by orders_products_id");
while ($BestellungPos = mysql_fetch_object($cur_query))
{
//mappe bestellpos
$kBestellPos = setMappingBestellPos($BestellungPos->orders_products_id);
echo(CSVkonform($kBestellPos).';');
echo(CSVkonform(intval($_POST['KeyBestellung'])).';');
echo(CSVkonform(getEsArtikel($BestellungPos->products_id)).';');
echo(CSVkonform($BestellungPos->products_name).';');
echo(CSVkonform($BestellungPos->products_price*(100+$BestellungPos->products_tax)/100).';');
echo(CSVkonform($BestellungPos->products_tax).';');
echo(CSVkonform($BestellungPos->products_quantity).';');
echo("\n");
}
//letzte Positionen wie Versand, Mindermengenzuschlag, Rabatt,
Kupon etc.
$cur_query = eS_execute_query("select * from Sho_01_orders_total where (class=\"ot_shipping\" OR class=\"ot_cod_fee\" OR class=\"ot_coupon\" OR class=\"ot_discount\" OR class=\"ot_gv\" OR class=\"ot_loworderfee\" OR class=\"ot_ps_fee\") and orders_id=".intval($_POST['KeyBestellung'])." order by sort_order");
while ($total_pos = mysql_fetch_object($cur_query))
{
if ($total_pos->class=="ot_shipping" || $total_pos->value!=0)
{
//mappe bestellpos
$kBestellPos = setMappingBestellPos(0);
$steuersatz = 0;
switch ($total_pos->class)
{
case 'ot_shipping':
//hole versand mwst aus einstellungen
$steuersatz = $einstellungen->versandMwst;
break;
case 'ot_cod_fee':
$tax_query = eS_execute_query("select configuration_value from Sho_01_configuration where configuration_key=\"MODULE_ORDER_TOTAL_COD_FEE_TAX_CLASS\"");
$tax_class = mysql_fetch_object($tax_query);
if ($tax_class->configuration_value>0)
$steuersatz = get_tax($tax_class->configuration_value);
break;
case 'ot_coupon':
//$tax_query = eS_execute_query("select configuration_value from configuration where configuration_key=\"MODULE_ORDER_TOTAL_COUPON_TAX_CLASS\"");
//$tax_class = mysql_fetch_object($tax_query);
//if ($tax_class->configuration_value>0)
// $steuersatz = get_tax($tax_class->configuration_value);
$steuersatz = $einstellungen->versandMwst;
$total_pos->value*=-1;
break;
case 'ot_gv':
$tax_query = eS_execute_query("select configuration_value from Sho_01_configuration where configuration_key=\"MODULE_ORDER_TOTAL_GV_TAX_CLASS\"");
$tax_class = mysql_fetch_object($tax_query);
if ($tax_class->configuration_value>0)
$steuersatz = get_tax($tax_class->configuration_value);
break;
case 'ot_loworderfee':
$tax_query = eS_execute_query("select configuration_value from Sho_01_configuration where configuration_key=\"MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS\"");
$tax_class = mysql_fetch_object($tax_query);
if ($tax_class->configuration_value>0)
$steuersatz = get_tax($tax_class->configuration_value);
break;
case 'ot_ps_fee':
$tax_query = eS_execute_query("select configuration_value from Sho_01_configuration where configuration_key=\"MODULE_ORDER_TOTAL_PS_FEE_TAX_CLASS\"");
$tax_class = mysql_fetch_object($tax_query);
if ($tax_class->configuration_value>0)
$steuersatz = get_tax($tax_class->configuration_value);
break;
}
echo(CSVkonform($kBestellPos).';');
echo(CSVkonform(intval($_POST['KeyBestellung'])).';');
echo(CSVkonform("0").';');
echo(CSVkonform(unhtmlentities($total_pos->title)).';');
echo(CSVkonform(unhtmlentities($total_pos->value)).';');
echo(CSVkonform($steuersatz).';');
echo(CSVkonform("1").';');
echo("\n");
}
}
}
}
mysql_close();
echo($return);
logge($return);
?>