mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
Merge branch 'erechnung'
This commit is contained in:
commit
cc0f2eaaa8
@ -29217,6 +29217,16 @@ function Firmendaten($field,$projekt="")
|
||||
}
|
||||
}
|
||||
|
||||
function SetXMLRechnung($id)
|
||||
{
|
||||
/** @var Preisanfrage $obj */
|
||||
$obj = $this->app->erp->LoadModul('rechnung');
|
||||
if(!empty($obj) && method_exists($obj,'SetXMLRechnung')) {
|
||||
return $obj->SetXMLRechnung($id);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function BelegFreigabe($beleg,$id)
|
||||
{
|
||||
if($id <= 0 || empty($beleg)) {
|
||||
@ -29272,6 +29282,9 @@ function Firmendaten($field,$projekt="")
|
||||
)
|
||||
);
|
||||
}
|
||||
if ($beleg === 'rechnung') {
|
||||
$this->SetXMLRechnung($id);
|
||||
}
|
||||
}
|
||||
|
||||
function CreateWiedervorlage($adresse,$bezeichnung,$beschreibung,$intagen=30,$adresse_mitarbeiter=0,$bearbeiter=0,$typ="",$typid=0)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2558,6 +2558,32 @@ class Rechnung extends GenRechnung
|
||||
|
||||
$this->app->Tpl->Parse('PAGE','rechnunguebersicht.tpl');
|
||||
}
|
||||
|
||||
// Decide if XML Smarty invoice according to address
|
||||
public function SetXMLRechnung($id) {
|
||||
$adresse = $this->app->DB->Select("SELECT adresse FROM rechnung WHERE id = '".$id."' LIMIT 1");
|
||||
if (!empty($adresse)) {
|
||||
// Check XML Smarty template
|
||||
$erechnung = false;
|
||||
$sql = "SELECT rechnung_smarty_template FROM adresse WHERE id = '".$adresse."'";
|
||||
$rechnung_smarty_template = $this->app->DB->Select($sql);
|
||||
|
||||
if (!empty($rechnung_smarty_template)) {
|
||||
$erechnung = true;
|
||||
} else {
|
||||
$sql = "SELECT id FROM gruppen WHERE rechnung_smarty_template <> '' and aktiv";
|
||||
$gruppen = $this->app->DB->SelectArr($sql);
|
||||
foreach ($gruppen as $gruppe) {
|
||||
if ($this->app->erp->IsAdresseInGruppe($adresse,$gruppe['id'])) {
|
||||
$erechnung = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($erechnung) {
|
||||
$this->app->DB->Update("UPDATE rechnung SET erechnung = 1 WHERE id = '".$id."' AND schreibschutz <> 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int $adresse
|
||||
@ -2575,27 +2601,6 @@ class Rechnung extends GenRechnung
|
||||
$usereditid = 0;
|
||||
if(isset($this->app->User) && $this->app->User && method_exists($this->app->User,'GetID')){
|
||||
$usereditid = $this->app->User->GetID();
|
||||
}
|
||||
|
||||
if (!empty($adresse)) {
|
||||
// Check XML Smarty template
|
||||
$erechnung = false;
|
||||
|
||||
|
||||
$sql = "SELECT rechnung_smarty_template FROM adresse WHERE id = '".$adresse."'";
|
||||
$rechnung_smarty_template = $this->app->DB->Select($sql);
|
||||
|
||||
if (!empty($rechnung_smarty_template)) {
|
||||
$erechnung = true;
|
||||
} else {
|
||||
$sql = "SELECT id FROM gruppen WHERE rechnung_smarty_template <> '' and aktiv";
|
||||
$gruppen = $this->app->DB->SelectArr($sql);
|
||||
foreach ($gruppen as $gruppe) {
|
||||
if ($this->app->erp->IsAdresseInGruppe($adresse,$gruppe['id'])) {
|
||||
$erechnung = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($this->app->erp->StandardZahlungsweise($projekt)==='rechnung')
|
||||
@ -2606,7 +2611,7 @@ class Rechnung extends GenRechnung
|
||||
} else {
|
||||
$zahlungszieltage = 0;
|
||||
$zahlungszieltageskonto = 0;
|
||||
$zahlungszielskonto = 0;
|
||||
$zahlungszielskonto = 0;
|
||||
}
|
||||
|
||||
$this->app->DB->Insert("INSERT INTO rechnung (
|
||||
|
@ -112,6 +112,9 @@ class WidgetGenrechnung
|
||||
$field = new HTMLCheckbox("abweichendebezeichnung","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("erechnung","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("mahnwesenfestsetzen","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
|
@ -99,6 +99,10 @@
|
||||
<td>[ABWEICHENDEBEZEICHNUNGBESCHRIFTUNG]:</td>
|
||||
<td>[ABWEICHENDEBEZEICHNUNG][MSGABWEICHENDEBEZEICHNUNG] </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|XML-Rechnung|}:</td>
|
||||
<td>[ERECHNUNG][MSGERECHNUNG] </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user