public function getAdresse($Beleg) { $Auftrag = new Auftrag($Beleg->A("AuftragID")); $Adresse = new Adresse($Auftrag->A("AdresseID")); $BCheckK = ""; if (Session::isPluginLoaded("mklickTel")) { $BCheckK = new Button("Adresse mit klickTel prüfen", "compass", "iconic"); $BCheckK->style("float:right;font-size:30px;margin-right:15px;"); $BCheckK->onclick("CustomerPage.popup('Adressprüfung', 'checkAddressKlickTel', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); $BCheckK->id("BCheckKT"); Aspect::joinPoint("modButtonKlickTel", $this, __METHOD__, array($BCheckK, $Auftrag)); } $BUpdate = new Button("Adresse ändern", "pen_alt2", "iconic"); $BUpdate->style("float:right;font-size:30px;margin-right:15px;"); $BUpdate->onclick("CustomerPage.popup('Adresse ändern', 'alterAddress', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); if (!$this->showButtonEditAddress) { $BUpdate = ""; } $BCheckG = new Button("Adresse mit Google prüfen", "compass", "iconic"); $BCheckG->style("float:right;font-size:30px;"); $BCheckG->onclick("CustomerPage.popup('Adressprüfung', 'checkAddressGoogle', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); $BCheckG->id("BCheckG"); if (!$this->showButtonCheckWithGoogle) { $BCheckG = ""; } Aspect::joinPoint("modButtonGoogle", $this, __METHOD__, array($BCheckG, $Auftrag)); $TAdresse = new HTMLTable(2, "Kundenadresse"); $TAdresse->setColWidth(1, 26); $TAdresse->setTableStyle("width:100%;"); $TAdresse->addRow(array(new Button("Adresse", "home", "iconic"), $BCheckG . $BCheckK . $BUpdate . $Adresse->getHTMLFormattedAddress())); $TAdresse->setColStyle(1, "vertical-align:top;"); return $TAdresse; }
public function getAuftrag($data) { $Beleg = new GRLBM($data["GRLBMID"]); #$this->createAuftrag(new Adresse(1), "W"); $Auftrag = new Auftrag($Beleg->A("AuftragID")); $Adresse = new Adresse($Auftrag->A("AdresseID")); $BCheckK = ""; if (Session::isPluginLoaded("mklickTel")) { $BCheckK = new Button("Adresse mit klickTel prüfen", "compass", "iconic"); $BCheckK->style("float:right;font-size:30px;margin-right:15px;"); $BCheckK->onclick("CustomerPage.popup('Adressprüfung', 'checkAddressKlickTel', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); $BCheckK->id("BCheckKT"); Aspect::joinPoint("modButtonKlickTel", $this, __METHOD__, array($BCheckK, $Auftrag)); } $BUpdate = new Button("Adresse ändern", "pen_alt2", "iconic"); $BUpdate->style("float:right;font-size:30px;margin-right:15px;"); $BUpdate->onclick("CustomerPage.popup('Adresse ändern', 'alterAddress', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); $BCheckG = new Button("Adresse mit Google prüfen", "compass", "iconic"); $BCheckG->style("float:right;font-size:30px;"); $BCheckG->onclick("CustomerPage.popup('Adressprüfung', 'checkAddressGoogle', {AdresseID: {$Adresse->getID()}, GRLBMID: {$data['GRLBMID']}}, {modal: true, width: 500, resizable: false, position: ['center', 40]});"); $BCheckG->id("BCheckG"); Aspect::joinPoint("modButtonGoogle", $this, __METHOD__, array($BCheckG, $Auftrag)); $TAdresse = new HTMLTable(2, "Kundenadresse"); $TAdresse->setColWidth(1, 26); $TAdresse->setTableStyle("width:100%;"); $TAdresse->addRow(array(new Button("Adresse", "home", "iconic"), $BCheckG . $BCheckK . $BUpdate . $Adresse->getHTMLFormattedAddress())); $TAdresse->setColStyle(1, "vertical-align:top;"); $TPosten = new HTMLTable(7, "Auftragspositionen"); $TPosten->setTableStyle("width:100%;"); #$TPosten->addColStyle(3, "text-align:right;"); $TPosten->addColStyle(4, "text-align:right;"); $TPosten->addColStyle(5, "text-align:right;"); $TPosten->addColStyle(6, "text-align:right;color:grey;"); $TPosten->setColWidth(1, 26); $TPosten->setColWidth(2, 80); $TPosten->setColWidth(4, 80); $TPosten->setColWidth(5, 80); $TPosten->setColWidth(6, 80); $TPosten->setColWidth(7, 20); $AC = anyC::get("Posten", "GRLBMID", $Beleg->getID()); $AC->addOrderV3("PostenID"); $i = 0; $O = new Button("Positionen", "list", "iconic"); while ($P = $AC->getNextEntry()) { $B = new Button("Position löschen", "trash_stroke", "iconic"); $B->onclick("CustomerPage.rme('delPosten', {PostenID: '" . $P->getID() . "'}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); });"); $I = new HTMLInput("mwst", "text", Util::CLNumberParserZ($P->A("menge"))); $I->style("text-align:right;width:80px;"); $I->onEnter("\$j(this).trigger('blur');"); $I->onblur("CustomerPage.rme('setMenge', {PostenID: '" . $P->getID() . "', menge: this.value}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); });"); $TPosten->addRow(array($i == 0 ? $O : "", $I, $P->A("name"), Util::CLNumberParserZ($P->A("preis")), Util::CLNumberParserZ($P->A("menge") * $P->A("preis")), Util::CLNumberParserZ($P->A("mwst")) . "%", $B)); $i++; } if ($AC->numLoaded() == 0) { $TPosten->addRow(array($O, "Bitte fügen Sie einen Artikel hinzu.")); $TPosten->addRowColspan(2, 6); $TPosten->setColWidth(2, "100%"); $TPosten->setColStyle(2, "text-align:left;"); } $TSumme = new HTMLTable(3); $TSumme->setTableStyle("width:100%;border-top:1px solid #AAA;margin-top:30px;"); $TSumme->setColWidth(1, 26); $TSumme->addColStyle(3, "text-align:right;"); $TSumme->addRow(array("", "Netto: <b>" . Util::CLFormatCurrency($Beleg->A("nettobetrag") * 1, true) . "</b>", "Brutto: <b>" . Util::CLFormatCurrency($Beleg->A("bruttobetrag") * 1, true) . "</b>")); $IZahlungsart = new HTMLInput("zahlungsart", "select", $Beleg->A("GRLBMpayedVia"), GRLBM::getPaymentVia(null, array("transfer", "debit"))); $IZahlungsart->onchange("if(this.value == 'debit') \$('#rowZahlungsart').show(); else \$('#rowZahlungsart').hide(); CustomerPage.timeout = window.setTimeout(CustomerPage.saveKontodaten, 300);"); $IBankleitzahl = new HTMLInput("bankleitzahl", "text", $Beleg->A("GRLBMBankleitzahl")); $IBankleitzahl->placeholder("Bankleitzahl"); $IBankleitzahl->style("margin-top:10px;text-align:right;width:130px;"); $IBankleitzahl->onkeyup("if(CustomerPage.timeout != null) window.clearTimeout(CustomerPage.timeout); CustomerPage.timeout = window.setTimeout(CustomerPage.saveKontodaten, 300);"); $IKontonummer = new HTMLInput("kontonummer", "text", $Beleg->A("GRLBMKontonummer")); $IKontonummer->placeholder("Kontonummer"); $IKontonummer->style("margin-top:10px;text-align:right;margin-left:10px;width:130px;"); $IKontonummer->onkeyup("if(CustomerPage.timeout != null) window.clearTimeout(CustomerPage.timeout); CustomerPage.timeout = window.setTimeout(CustomerPage.saveKontodaten, 300);"); #$IBIC = new HTMLInput("bic"); #$IIBAN = new HTMLInput("iban"); $BCheck = new Button("Prüfung", "question_mark", "iconic"); $BCheck->id("ktoCheck"); $BCheck->style("margin-left:8px;"); $TZahlungsart = new HTMLTable(2, "Zahlungsart"); $TZahlungsart->setTableStyle("width:100%;"); $TZahlungsart->setColWidth(1, 26); $TZahlungsart->addRow(array(new Button("Zahlungsart", "pin", "iconic"), $IZahlungsart)); $TZahlungsart->addRowColspan(2, 2); $TZahlungsart->addCellStyle(1, "vertical-align:top;"); $TZahlungsart->addRow(array("", $IBankleitzahl . " " . $IKontonummer . "{$BCheck} <div id=\"bankMessage\" style=\"margin-top:6px;\"> </div>")); $TZahlungsart->setRowID("rowZahlungsart"); if ($Beleg->A("GRLBMpayedVia") != "debit") { $TZahlungsart->addRowStyle("display:none;"); } else { echo OnEvent::script("CustomerPage.saveKontodaten();"); } $IBemerkung = new HTMLInput("bemerkung", "textarea", $Beleg->A("textbausteinUnten")); $IBemerkung->style("width:100%;height:100px;margin-top:40px;"); $IBemerkung->placeholder("Bemerkungen"); #$IBemerkung->onblur(""); $IBemerkung->onkeyup("if(CustomerPage.timeout != null) window.clearTimeout(CustomerPage.timeout); CustomerPage.timeout = window.setTimeout(CustomerPage.saveBemerkung, 300);"); $TZahlungsart->addRow(array(new Button("Bemerkung", "document_alt_stroke", "iconic"), $IBemerkung)); #$TSumme->addRowColspan(2, 2); $TZahlungsart->addCellStyle(1, "vertical-align:top;padding-top:40px;"); $IOK = new Button("Abschließen"); $IOK->className("submitFormButton"); $IOK->onclick("\$(window).unbind('beforeunload'); document.location.href='?CC=Auftrag&page=1';"); $IC = new Button("Abbrechen"); $IC->className("submitFormButton"); $IC->style("background-color:#DDD;color:grey;float:none;"); $IC->onclick("\$(window).unbind('beforeunload'); CustomerPage.rme('cancelAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(){ document.location.href='?CC=Auftrag&page=2'; });"); $TZahlungsart->addRow(array("", $IC . $IOK)); $TZahlungsart->addCellStyle(2, "padding-top:50px;"); #$TZahlungsart->addCellStyle(3, "padding-top:50px;"); $html = "<h1>Auftrag</h1>\n\t\t\t\t{$TAdresse}\n\t\t\t\t{$TPosten}\n\t\t\t\t{$TSumme}\n\t\t\t\t{$TZahlungsart}"; return $html . OnEvent::script("\n\t\t\tCustomerPage.timeout = null;\n\t\t\tCustomerPage.saveBemerkung = function(){ CustomerPage.rme('setBemerkung', {GRLBMID: {$data['GRLBMID']}, bemerkung: \$('textarea[name=bemerkung]').val() }); };\n\t\t\tCustomerPage.saveKontodaten = function(){ CustomerPage.rme('setKontodaten', {\n\t\t\t\tGRLBMID: {$data['GRLBMID']},\n\t\t\t\tzahlungsart: \$('select[name=zahlungsart]').val(),\n\t\t\t\tkontonummer: \$('input[name=kontonummer]').val(),\n\t\t\t\tbankleitzahl: \$('input[name=bankleitzahl]').val()\n\t\t\t}, function(t){ \$('#bankMessage').html(t); }); };"); }