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); }); };"); }
public function getPosten(GRLBM $Beleg) { $TPosten = new HTMLTable(8, "Auftragspositionen"); $TPosten->setTableStyle("width:100%;"); #$TPosten->addColStyle(3, "text-align:right;"); $TPosten->addColStyle(5, "text-align:right;"); $TPosten->addColStyle(6, "text-align:right;"); $TPosten->addColStyle(7, "text-align:right;color:grey;"); $TPosten->addColStyle(8, "text-align:right;"); $TPosten->setColWidth(1, 26); $TPosten->setColWidth(2, 80); $TPosten->setColWidth(5, 80); $TPosten->setColWidth(6, 80); $TPosten->setColWidth(7, 80); $TPosten->setColWidth(8, 20); Aspect::joinPoint("alterTable", $this, __METHOD__, array($TPosten)); $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: " . $Beleg->getID() . "}, 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->onfocus("CCAuftrag.lastValue = this.value; CCAuftrag.allowSave = true;"); $I->onblur("if(CCAuftrag.lastValue != this.value && CCAuftrag.allowSave) CustomerPage.rme('setMenge', {PostenID: '" . $P->getID() . "', menge: this.value}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: " . $Beleg->getID() . "}, function(transport){ \$('#contentLeft').html(transport); }); }); CCAuftrag.allowSave = false;"); $name = Aspect::joinPoint("alterName", $this, __METHOD__, array($P, $P->A("name")), $P->A("name")); $buttons = Aspect::joinPoint("alterButtons", $this, __METHOD__, array($P, $B), $B); $TPosten->addRow(array($i == 0 ? $O : "", $I, $P->A("gebinde"), $name, $this->showPrices ? Util::CLNumberParserZ($P->A("preis")) : "", $this->showPrices ? Util::CLNumberParserZ($P->A("menge") * $P->A("preis")) : "", $this->showPrices ? Util::CLNumberParserZ($P->A("mwst")) . "%" : "", $buttons)); $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;"); } return $TPosten; }
public function getAuftrag($data) { if (!$this->loggedIn) { return "TIMEOUT"; } $html = ""; if ($data["GRLBMID"] == 0) { $html .= "<p class=\"highlight\" style=\"margin-top:10px;\">Bitte wählen Sie rechts einen Lieferschein.</p>"; return $html; } $Beleg = new GRLBM($data["GRLBMID"]); #$this->createAuftrag(new Adresse(1), "W"); $Auftrag = new Auftrag($Beleg->A("AuftragID")); $Adresse = new Adresse($Auftrag->A("AdresseID")); #$TAdresse = new HTMLTable(2, "Kundenadresse"); #$TAdresse->setColWidth(1, 26); #$TAdresse->setTableStyle("width:100%;"); #$TAdresse->addRow(array(new Button("Adresse", "home", "iconic"), $Adresse->getHTMLFormattedAddress())); #$TAdresse->setColStyle(1, "vertical-align:top;"); $TPosten = new HTMLTable(3, "Lieferung"); $TPosten->setTableStyle("width:100%;"); $TPosten->setColWidth(1, 26); $TPosten->setColWidth(2, 80); $TPosten->setColWidth(3, "100%"); $ACP = anyC::get("Posten", "GRLBMID", $Beleg->getID()); $ACP->addOrderV3("PostenID"); $ACP->addAssocV3("useForLieferung", "=", "1"); $i = 0; $O = new Button("Positionen", "list", "iconic"); /*while($P = $AC->getNextEntry()){ $I = new HTMLInput("mwst", "text", Util::CLNumberParser($P->A("menge"))); $I->style("text-align:right;width:80px;font-size:15px;padding:7px;padding-right:20px;"); #$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){ if(transport == 'TIMEOUT') { document.location.href='?CC=Lieferschein&page=login'; return; } $('#contentLeft .content').html(transport); noty({text: 'Menge gespeichert', type: 'success'}); }); });"); $I->onfocus("this.select();"); $TPosten->addRow(array( $i == 0 ? $O : "", $I, "<span style=\"font-size:15px;\">".$P->A("name")."</span>")); $i++; }*/ $AC = anyC::get("Artikel"); $AC->addOrderV3("name"); $AC->addAssocV3("useForLieferung", "=", "1"); while ($A = $AC->getNextEntry()) { $menge = 0; while ($P = $ACP->n()) { if ($P->A("oldArtikelID") == $A->getID()) { $menge = abs($P->A("menge")); } } $ACP->resetPointer(); $I = new HTMLInput("Artikel_" . $A->getID(), "text", Util::CLNumberParser($menge)); $I->style("text-align:right;width:80px;font-size:15px;padding:7px;padding-right:20px;"); #$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){ if(transport == 'TIMEOUT') { document.location.href='?CC=Lieferschein&page=login'; return; } $('#contentLeft .content').html(transport); noty({text: 'Menge gespeichert', type: 'success'}); }); });"); $I->onfocus("this.select();"); $TPosten->addRow(array($i == 0 ? $O : "", $I, "<span style=\"font-size:15px;\">" . $A->A("name") . "</span>")); $i++; } if ($AC->numLoaded() == 0) { $TPosten->addRow(array($O, "Keine Artikel")); $TPosten->addRowColspan(2, 6); $TPosten->setColWidth(2, "100%"); $TPosten->setColStyle(2, "text-align:left;"); } $IOK = new Button("Speichern"); $IOK->className("submitFormButton"); $IOK->onclick("CustomerPage.rme('handleLieferung', \$('#posten').serialize(), function(transport){ \$('#contentLeft h1').html('Auftrag'); \$('.selected').removeClass('selected'); \$('#contentLeft .content').html(transport); })"); #$IOK->onclick("$('#contentLeft h1').html('Auftrag'); $('.selected').removeClass('selected'); CustomerPage.rme('getAuftrag', {GRLBMID: 0}, function(transport){ $('#contentLeft .content').html(transport); }, function(){}, 'POST');"); $IC = new Button("Abbrechen"); $IC->className("submitFormButton"); $IC->style("background-color:#DDD;color:grey;float:none;"); $IC->onclick("\$('#contentLeft h1').html('Auftrag'); \$('.selected').removeClass('selected'); CustomerPage.rme('getAuftrag', {GRLBMID: 0}, function(transport){ \$('#contentLeft .content').html(transport); }, function(){}, 'POST');"); #$TZahlungsart = new HTMLTable(2); #$TZahlungsart->setTableStyle("width:100%;margin-top:50px;"); #$TZahlungsart->setColWidth(1, 26); #$TZahlungsart->addRow(array("", $IOK)); $IA = new HTMLInput("action", "hidden", "handleLieferung"); $IA = new HTMLInput("GRLBMID", "hidden", $Beleg->getID()); $html .= "\n\t\t\t<form id=\"posten\" style=\"border:0px;padding:0px;width:100%;\" >\n\t\t\t\t{$TPosten}\n\t\t\t\t{$IOK}{$IC}\n\t\t\t\t{$IA}\n\t\t\t</form>"; return $html . OnEvent::script("\$('#contentLeft h1').html('Auftrag " . $Beleg->A("prefix") . $Beleg->A("nummer") . "');"); }