Beispiel #1
0
 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;
 }
Beispiel #2
0
 public static function getCalendarDetails($className, $classID, $T = null)
 {
     $K = new Kalender();
     if ($T == null) {
         $T = new Todo($classID);
     }
     $name = "";
     if ($T->A("TodoClass") == "Projekt" or $T->A("TodoClass") == "GRLBM") {
         $O = $T->getOwnerObject();
         $name = $O->getCalendarTitle();
     } else {
         $name = $T->A("TodoName");
     }
     $day = $T->A("TodoTillDay");
     if ($T->A("TodoFromDay") != "0") {
         $day = $T->A("TodoFromDay");
     }
     $time = $T->A("TodoTillTime");
     if ($T->A("TodoFromTime") != "0") {
         $time = $T->A("TodoFromTime");
     }
     $KE = new KalenderEvent($className, $classID, $K->formatDay($day), $K->formatTime($time), $name);
     #echo $T->A("TodoOrt");
     if ($T->A("TodoClass") == "WAdresse") {
         $O = $T->getOwnerObject();
         $KE->value("Kunde", $O->getHTMLFormattedAddress());
     }
     $KE->value("Typ", TodoGUI::types($T->A("TodoType")));
     $KE->value("Ort", $T->A("TodoLocation"));
     #$KE->value("Status", TodoGUI::getStatus($T->A("TodoStatus")));
     $KE->owner($T->A("TodoUserID"));
     if ($T->A("TodoClass") == "WAdresse") {
         $KE->value("Telefon", $O->A("tel"));
         $KE->value("Notiz", nl2br($O->A("bemerkung")));
         $KE->canNotify(true, $T->A("TodoNotified") == "1");
         if ($T->A("TodoType") == "1" and Session::isPluginLoaded("mAkquise")) {
             $B = new Button("Akquise", "./lightCRM/Akquise/callTel.png");
             #$B->doBefore(OnEvent::rme($T, "setStatus", array("'2'"), OnEvent::closePopup("mKalender").OnEvent::reload("Screen"))." %AFTER");
             $B->doBefore(OnEvent::closePopup("mKalender") . "contentManager.emptyFrame('contentScreen'); %AFTER");
             $B->loadFrame("contentLeft", "WAdresse", $T->A("TodoClassID"), 0, "mWAdresseGUI;Akquise:1;from:mKalender");
             #$B->popup("", "Akquise", "mAkquise", "-1", "showTelPopup", array($T->A("TodoClassID")), "", "{width: 950, top:20, hPosition:'center'}");
             $KE->addTopButton($B);
         }
     }
     $KE->allDay($T->A("TodoAllDay") == "1");
     if ($T->A("TodoClass") == "Projekt" and $O->A("ProjektKunde") != "0") {
         $Adresse = new Adresse($O->A("ProjektKunde"));
         $KE->value("Telefon", $Adresse->A("tel"));
     }
     if ($T->A("TodoClass") == "GRLBM") {
         $Auftrag = new Auftrag($O->A("AuftragID"));
         $Adresse = new Adresse($Auftrag->A("AdresseID"));
         $KE->value("Telefon", $Adresse->A("tel"));
     }
     $KE->status($T->A("TodoStatus"));
     $KE->endDay($K->formatDay($T->A("TodoTillDay")));
     $KE->endTime($K->formatTime($T->A("TodoTillTime")));
     $KE->icon(TodoGUI::typesImage($T->A("TodoType"), true));
     $KE->summary(nl2br($T->A("TodoDescription")));
     if ($T->A("TodoExceptionForID") != "0") {
         $KE->exception($T->A("TodoExceptionStarttime"), $T->A("TodoIsDeleted") == "1", $T->A("TodoExceptionForID"));
     }
     if ($T->A("TodoRemind") != "-1") {
         $KE->remind($T->A("TodoRemind") / 60, $T->A("TodoReminded"));
     }
     $editMethod = "editInPopup";
     if ($T->A("TodoOrganizer") != "") {
         $editMethod = null;
         $KE->organizer($T->A("TodoOrganizer"));
     }
     if (!$T->A("TodoDoneTime")) {
         $KE->editable($editMethod, "deleteFromCalendar");
     }
     if ($T->A("TodoOrganizer") == "" and !$T->A("TodoDoneTime")) {
         $KE->repeatable("editRepeatable");
     }
     $KE->location($T->A("TodoLocation"));
     $KE->repeat($T->A("TodoRepeat") != "", $T->A("TodoRepeat"), $T->A("TodoRepeatWeekOfMonth") * 1, $T->A("TodoRepeatDayOfWeek"), $T->A("TodoRepeatInterval"), $T->A("TodoRepeatUntil"));
     $KE->UID("TodoID" . $T->getID() . "@" . substr(Util::eK(), 0, 20));
     $KE->closeable($T->A("TodoDoneTime"), $T->A("TodoReport"));
     if (!$T->A("TodoDoneTime")) {
         $KE->canInvite();
     }
     return $KE;
 }
Beispiel #3
0
 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;\">&nbsp;</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); }); };");
 }
Beispiel #4
0
 function handleLieferung($data)
 {
     if (!$this->loggedIn) {
         return "TIMEOUT";
     }
     $GRLBMID = $data["GRLBMID"];
     unset($data["GRLBMID"]);
     $ACP = anyC::get("Posten", "GRLBMID", $GRLBMID);
     $ACP->addOrderV3("PostenID");
     $ACP->addAssocV3("useForLieferung", "=", "1");
     while ($P = $ACP->n()) {
         $P->deleteMe();
     }
     $G = new GRLBM($GRLBMID, false);
     $A = new Auftrag($G->A("AuftragID"));
     foreach ($data as $Artikel => $menge) {
         if ($menge == "0") {
             continue;
         }
         if (strpos($Artikel, "Artikel_") === false) {
             continue;
         }
         $ex = explode("_", $Artikel);
         $G->addArtikel($ex[1], $menge, null, $A->A("kundennummer"));
     }
     die("<p class=\"confirm\" style=\"margin-top:10px;\">Lieferung gespeichert!</p>");
 }