mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-01-24 11:51:12 +01:00
adresse XML-Rechnung Smarty Template zuordnen
This commit is contained in:
parent
5079b32ea9
commit
1bae56a574
@ -3682,6 +3682,17 @@
|
|||||||
"Extra": "",
|
"Extra": "",
|
||||||
"Privileges": "select,insert,update,references",
|
"Privileges": "select,insert,update,references",
|
||||||
"Comment": ""
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "rechnung_smarty_template",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": "0",
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"keys": [
|
"keys": [
|
||||||
|
@ -13824,6 +13824,18 @@ function SendPaypalFromAuftrag($auftrag, $test = false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ReplaceSmartyTemplate($db,$value,$fromform = null) {
|
||||||
|
$value = $this->app->DB->real_escape_string($value);
|
||||||
|
|
||||||
|
if ($db) {
|
||||||
|
$smarty_template = explode(' ',$value)[0];
|
||||||
|
return($smarty_template);
|
||||||
|
} else {
|
||||||
|
$smarty_template = $this->app->DB->Select("SELECT CONCAT(id,' ',name) FROM smarty_templates WHERE id = '$value' LIMIT 1");
|
||||||
|
return($smarty_template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// @refactor FormHelper Komponente
|
// @refactor FormHelper Komponente
|
||||||
function ReplaceLieferant($db,$value,$fromform)
|
function ReplaceLieferant($db,$value,$fromform)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -4195,6 +4195,14 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
|
|||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
case "smarty_template":
|
||||||
|
$newarr = $this->app->DB->SelectFirstCols(
|
||||||
|
sprintf(
|
||||||
|
"SELECT CONCAT(`id`,' ',`name`) FROM `smarty_templates` WHERE (`name` LIKE '%%%s%%')",
|
||||||
|
$term
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$newarr = null;
|
$newarr = null;
|
||||||
$this->app->erp->RunHook('ajax_filter_hook1', 5,$filtername,$newarr, $term, $term2, $term3);
|
$this->app->erp->RunHook('ajax_filter_hook1', 5,$filtername,$newarr, $term, $term2, $term3);
|
||||||
|
@ -1296,17 +1296,24 @@ class Rechnung extends GenRechnung
|
|||||||
header('Content-Disposition: attachment;filename='.$filename.'.json');
|
header('Content-Disposition: attachment;filename='.$filename.'.json');
|
||||||
echo(json_encode($result,JSON_PRETTY_PRINT));
|
echo(json_encode($result,JSON_PRETTY_PRINT));
|
||||||
} else {
|
} else {
|
||||||
$template = $this->app->DB->Select("SELECT template from smarty_templates LIMIT 1");
|
|
||||||
$smarty = new Smarty;
|
|
||||||
$directory = $this->app->erp->GetTMP().'/smarty/templates';
|
|
||||||
$smarty->setCompileDir($directory);
|
|
||||||
$smarty->assign('rechnung', $result);
|
|
||||||
$html = $smarty->fetch('string:'.$template);
|
|
||||||
header('Content-type:application/xml');
|
|
||||||
header('Content-Disposition: attachment;filename='.$filename.'.xml');
|
|
||||||
echo($html);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$template = $this->app->DB->Select("SELECT template from smarty_templates WHERE id = '".$adresse[0]['rechnung_smarty_template']."' LIMIT 1");
|
||||||
|
|
||||||
|
if(empty($template)) {
|
||||||
|
header('Content-type:text/plain');
|
||||||
|
header('Content-Disposition: attachment;filename='.$filename.'.xml');
|
||||||
|
echo('Kein Smarty Template in der Adresse hinterlegt.');
|
||||||
|
} else {
|
||||||
|
$smarty = new Smarty;
|
||||||
|
$directory = $this->app->erp->GetTMP().'/smarty/templates';
|
||||||
|
$smarty->setCompileDir($directory);
|
||||||
|
$smarty->assign('rechnung', $result);
|
||||||
|
$html = $smarty->fetch('string:'.$template);
|
||||||
|
header('Content-type:application/xml');
|
||||||
|
header('Content-Disposition: attachment;filename='.$filename.'.xml');
|
||||||
|
echo($html);
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->app->ExitXentral();
|
$this->app->ExitXentral();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +279,9 @@ class WidgetGenadresse
|
|||||||
$field->AddOption('{|nur Rechnung erstellen|}','rechnung');
|
$field->AddOption('{|nur Rechnung erstellen|}','rechnung');
|
||||||
$this->form->NewField($field);
|
$this->form->NewField($field);
|
||||||
|
|
||||||
|
$field = new HTMLInput("rechnung_smarty_template","text","","","","","","","","","","0","","");
|
||||||
|
$this->form->NewField($field);
|
||||||
|
|
||||||
$field = new HTMLInput("kommissionskonsignationslager","text","","","","","","","","","","0","","");
|
$field = new HTMLInput("kommissionskonsignationslager","text","","","","","","","","","","0","","");
|
||||||
$this->form->NewField($field);
|
$this->form->NewField($field);
|
||||||
|
|
||||||
|
@ -478,6 +478,10 @@ function abweichend(cmd) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{|Belege im Auto-Versand erstellen|}:</td>
|
<td>{|Belege im Auto-Versand erstellen|}:</td>
|
||||||
<td>[ART][MSGART]</td>
|
<td>[ART][MSGART]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{|Smarty Template für XML-Rechnung|}:</td>
|
||||||
|
<td>[RECHNUNG_SMARTY_TEMPLATE][MSGRECHNUNG_SMARTY_TEMPLATE]</td>
|
||||||
</tr> [VORKOMMISSIONIERLAGER]
|
</tr> [VORKOMMISSIONIERLAGER]
|
||||||
<tr>
|
<tr>
|
||||||
<td>{|Kommissions-/Konsignationslager|}:</td>
|
<td>{|Kommissions-/Konsignationslager|}:</td>
|
||||||
|
@ -35,7 +35,9 @@ class WidgetAdresse extends WidgetGenAdresse
|
|||||||
$this->form->ReplaceFunction("kreditlimiteinmalig",$this,"ReplaceBetrag");
|
$this->form->ReplaceFunction("kreditlimiteinmalig",$this,"ReplaceBetrag");
|
||||||
|
|
||||||
$this->app->YUI->AutoComplete("sachkonto","sachkonto",1);
|
$this->app->YUI->AutoComplete("sachkonto","sachkonto",1);
|
||||||
$this->form->ReplaceFunction("sachkonto",$this,"ReplaceKontorahmen");
|
$this->form->ReplaceFunction("sachkonto",$this,"ReplaceKontorahmen");
|
||||||
|
|
||||||
|
$this->form->ReplaceFunction("rechnung_smarty_template",$this,"ReplaceSmartyTemplate");
|
||||||
|
|
||||||
$this->form->ReplaceFunction("lat",$this,"ReplaceBetrag");
|
$this->form->ReplaceFunction("lat",$this,"ReplaceBetrag");
|
||||||
$this->form->ReplaceFunction("lng",$this,"ReplaceBetrag");
|
$this->form->ReplaceFunction("lng",$this,"ReplaceBetrag");
|
||||||
@ -48,6 +50,8 @@ class WidgetAdresse extends WidgetGenAdresse
|
|||||||
|
|
||||||
$this->app->YUI->AutoComplete("lieferbedingung","lieferbedingungen");
|
$this->app->YUI->AutoComplete("lieferbedingung","lieferbedingungen");
|
||||||
|
|
||||||
|
$this->app->YUI->AutoComplete("rechnung_smarty_template","smarty_template",1);
|
||||||
|
|
||||||
$this->app->YUI->AutoComplete("kassiererprojekt","projektname",1);
|
$this->app->YUI->AutoComplete("kassiererprojekt","projektname",1);
|
||||||
$this->form->ReplaceFunction("kassiererprojekt",$this,"ReplaceProjekt");
|
$this->form->ReplaceFunction("kassiererprojekt",$this,"ReplaceProjekt");
|
||||||
|
|
||||||
@ -485,6 +489,11 @@ class WidgetAdresse extends WidgetGenAdresse
|
|||||||
{
|
{
|
||||||
return $this->app->erp->ReplaceKontorahmen($db,$value,$fromform);
|
return $this->app->erp->ReplaceKontorahmen($db,$value,$fromform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ReplaceSmartyTemplate($db,$value,$fromform)
|
||||||
|
{
|
||||||
|
return $this->app->erp->ReplaceSmartyTemplate($db,$value,$fromform);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int|bool $db
|
* @param int|bool $db
|
||||||
|
Loading…
x
Reference in New Issue
Block a user