Das Rechnungsprogramm für kleine und mittlere Unternehmen.

Änderungen an open3A pushen

Das Sync-Plugin kann neue XML-Daten auch per POST erhalten und direkt verarbeiten.

Dazu legen Sie im Sync-Plugin zunächst einen neuen Sync-Benutzer an, um ein Token zu erhalten. Außerdem ist es hilfreich, der Anfrage eine SyncGetID aus einer existierenden Sync-Quelle mitzugeben, damit die Protokollierung funktioniert.

Wenn ein Beleg mit der Anfrage erstellt wird, dann kann der neue Beleg auch gleich mit abgefragt werden. Hier sind die Angaben "answerXML" und "returnFile" entscheidend.

Dieses Token und SyncGetID werden dann im POST-Request mitgeschickt:

$ch = curl_init("http://localhost/ubiquitous/Sync/index.php");
$time = microtime();
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<phynx>
<option name="answerXML">1</option>
<entry class="Auftrag">
<attribute name="guid">'.time().'</attribute>
<attribute name="auftragsnummer">113</attribute>
<attribute name="sendviaemail">0</attribute>
<attribute name="returnFile">0</attribute>
<attribute name="belegtyp">R</attribute>
<attribute name="zahlungsart">Lastschrift - 2% - 14 Tage</attribute>
<attribute name="lieferDatum"><![CDATA[1763131099]]></attribute>
<attribute name="lieferDatumEnde"><![CDATA[1763131099]]></attribute>
</entry>
<entry class="Adresse">
<attribute name="guid">9000006</attribute>
<attribute name="kundennummer">9000006</attribute>
<attribute name="auftragsnummer">113</attribute>
<attribute name="firma">open3A GmbH 3</attribute>
<attribute name="anrede">3</attribute>
<attribute name="vorname"> </attribute>
<attribute name="nachname"> </attribute>
<attribute name="strasse">Bieberer Straße 137</attribute>
<attribute name="ort">Obertshausen</attribute>
<attribute name="plz">63179</attribute>
<attribute name="land">Deutschland</attribute>
<attribute name="email">support@open3a.de</attribute>
<attribute name="tel"/>
<attribute name="fax"/>
<attribute name="UStIdNr"> </attribute>
<attribute name="1xadresse">0</attribute>
<attribute name="einzug">1</attribute>
<attribute name="einzugTextbaustein"> </attribute>
<attribute name="mandatsdatum">1741265578</attribute>
<attribute name="kontoinhaber">Rhein Main Verlags GmbH</attribute>
<attribute name="IBAN">DE94 5054 0028 0424 5775 00</attribute>
<attribute name="BIC">COBADEFFXXX</attribute>
<attribute name="erlöskonto">46903</attribute>
</entry>
<entry class="Posten">
<attribute name="auftragsnummer">113</attribute>
<attribute name="name">005195
Penny 15A 05 002 FFM-Niederrad TEST
6.440 Auflage
10,00 €/Tsd.
0g
KW 30/26.07.2025</attribute>
<attribute name="preis">64.40</attribute>
<attribute name="gebinde">Verteilauftrag</attribute>
<attribute name="menge">1</attribute>
<attribute name="mwst">0</attribute>
<attribute name="keinLagerbestand">1</attribute>
<attribute name="PostenAddLine">-</attribute>
</entry>
</phynx> ';
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "token=E0fdpgm…i0gl&action=set&SyncGetID=5&plugin=open3A/Auftraege&format=xml&data=".$xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$server_output = curl_exec($ch);
var_dump($server_output);
$xml = new SimpleXMLElement($server_output);
file_put_contents(__DIR__."/invoice.pdf", base64_decode($xml->entry->attribute[3].""));
if(!curl_errno($ch)) {
$info = curl_getinfo($ch);
print_r($info);
}