git.schokokeks.org
Repositories
Help
Report an Issue
webinterface.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
fd58bd7
Branches
Tags
master
ticket
webinterface.git
modules
invoice
sepamandat.js
change checkbox when date selected
Bernd Wurst
commited
fd58bd7
at 2023-04-28 13:55:45
sepamandat.js
Blame
History
Raw
function populate_bankinfo(result) { bank = result[0]; if (bank.iban_ok == 1) { $("#iban_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" alt="" title="" />'); if ($('#bankname').val() == "") $('#bankname').val(bank.bankname); if ($('#bic').val() == "") $('#bic').val(bank.bic); } else { $("#iban_feedback").html('<img src="../../images/error.png" style="height: 16px; width: 16px;" alt="IBAN scheint nicht gültig zu sein" title="IBAN scheint nicht gültig zu sein" />'); $('#bankname').val(""); $('#bic').val(""); } } function searchbank() { var iban = $('#iban').val().toUpperCase().replace(/\s/g, ''); if (iban.substr(0,2) == "DE" && iban.length == 22) { $("#iban").val(iban); $("#bankname").prop("disabled", true); $("#bic").prop("disabled", true); $.getJSON("sepamandat_banksearch?iban="+iban, populate_bankinfo) .always( function() { $("#bankname").prop("disabled", false); $("#bic").prop("disabled", false); }); } else { $("#iban_feedback").html(""); } } function copydata_worker( result ) { $("#kontoinhaber").val(result.kundenname); $("#adresse").val(result.adresse); } function copydata( event ) { event.preventDefault(); var kunde = $.getJSON("sepamandat_copydata", copydata_worker); } function populate_iban(result) { info = result[0]; $("#iban").val(info.iban); populate_bankinfo(result) } function ktoblz( event ) { event.preventDefault(); var kto = $("#kto").val(); var blz = $("#blz").val(); $.getJSON("sepamandat_banksearch?kto="+kto+"&blz="+blz, populate_iban) } function showktoblz( event ) { event.preventDefault(); $("#ktoblz_button").hide(); $("#ktoblz_input").show(); } // Define a convenience method and use it var ready = (callback) => { if (document.readyState != "loading") callback(); else document.addEventListener("DOMContentLoaded", callback); } ready(() => { /* Do things after DOM has fully loaded */ document.querySelector("#gueltig_ab_datum").addEventListener("change", (e) => { document.querySelector("#gueltig_ab_auswahl").checked = true; }) }); $(function() { $('#iban').on("change keyup paste", searchbank ); $("#copydata").click(copydata); $("#showktoblz").click(showktoblz); $("#ktoblz").click(ktoblz); });