From: Holger Lindemann Date: Tue, 10 Feb 2009 09:05:27 +0000 (+0000) Subject: Steuer aus Buchungsgruppen, Textapassung X-Git-Tag: release-2.6.0beta2~184 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=af9aae0924d299f1ea0f3c0d4050c6aadc489c60;p=kivitendo-erp.git Steuer aus Buchungsgruppen, Textapassung --- diff --git a/xtcom/confedit.php b/xtcom/confedit.php index 9a97448ae..b9d8d47a7 100644 --- a/xtcom/confedit.php +++ b/xtcom/confedit.php @@ -87,7 +87,19 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { return 0; } } - + function getBugru() { + global $dbP; + if (!$dbP) return; + $sql ="select BG.id as bugru,(T.rate * 100) as rate,TK.startdate from buchungsgruppen BG "; + $sql.="left join chart C on BG.income_accno_id_0=C.id left join taxkeys TK "; + $sql.="on TK.chart_id=C.id left join tax T on T.id=TK.tax_id where "; + $sql.="TK.startdate <= now() order by BG.id, TK.startdate"; + $rs=$dbP->getAll($sql,DB_FETCHMODE_ASSOC); + if ($rs) foreach ($rs as $row) { + $bugru[$row["bugru"]]=$row["rate"]; + } + return $bugru; + } if ($_POST["ok"]=="sichern") { $ok=true; $dsnP = array( @@ -105,32 +117,31 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { echo $dbP->userinfo; $dbP=false; } else { - $sql="SELECT P.id,P.description,(t.rate * 100) as rate FROM "; - $sql.="parts P left join chart c on c.id=P.income_accno_id left join tax t on c.taxkey_id=t.taxkey "; - $sql.="where P.partnumber = '%s'"; + $bugru=getBugru(); + $sql="SELECT id,description,buchungsgruppen_id FROM parts where partnumber = '%s'"; $rs=$dbP->getall(sprintf($sql,$_POST["div16NR"])); $_POST["div16ID"]=$rs[0][0]; $div16txt=addslashes($rs[0][1]); - $_POST["div16TAX"]=$rs[0][2]; + $_POST["div16TAX"]=$bugru[$rs[0][2]]; $rs=$dbP->getall(sprintf($sql,$_POST["div07NR"])); $_POST["div07ID"]=$rs[0][0]; - $_POST["div07TAX"]=$rs[0][2]; + $_POST["div07TAX"]=$bugru[$rs[0][2]]; $div07txt=addslashes($rs[0][1]); $rs=$dbP->getall(sprintf($sql,$_POST["versandNR"])); $_POST["versandID"]=$rs[0][0]; - $_POST["versandTAX"]=$rs[0][2]; + $_POST["versandTAX"]=$bugru[$rs[0][2]]; $versandtxt=addslashes($rs[0][1]); $rs=$dbP->getall(sprintf($sql,$_POST["nachnNR"])); $_POST["nachnID"]=$rs[0][0]; - $_POST["nachnTAX"]=$rs[0][2]; + $_POST["nachnTAX"]=$bugru[$rs[0][2]]; $nachntxt=addslashes($rs[0][1]); $rs=$dbP->getall(sprintf($sql,$_POST["minderNR"])); $_POST["minderID"]=$rs[0][0]; - $_POST["minderTAX"]=$rs[0][2]; + $_POST["minderTAX"]=$bugru[$rs[0][2]]; $mindertxt=addslashes($rs[0][1]); $rs=$dbP->getall(sprintf($sql,$_POST["paypalNR"])); $_POST["paypalID"]=$rs[0][0]; - $_POST["paypalTAX"]=$rs[0][2]; + $_POST["paypalTAX"]=$bugru[$rs[0][2]]; $paypaltxt=addslashes($rs[0][1]); $rs=$dbP->getall("select id from employee where login = '".$_POST["ERPusrN"]."'"); $_POST["ERPusrID"]=$rs[0][0]; @@ -145,7 +156,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { ); $dbM=@DB::connect($dsnM); if (DB::isError($dbM)||!$dbM) { - $ok=false; + //$ok=false; echo "Keine Verbindung zum Shop
"; echo $dbM->userinfo; $dbM=false; @@ -233,6 +244,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { fputs($f,"\$SpracheAlle=\"".$_POST["SpracheAlle"]."\";\n"); fputs($f,"?>"); fclose($f); + echo "
'conf.php' geschriebeni!
"; if (file_exists ("conf$login.php")) { require "conf$login.php"; } else { @@ -416,7 +428,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { - ID Diverse 16% + ID Diverse 19% "> > ID Diverse 7%