JSFiddle - React, Tailwind, and code Playground

by musicreader

HTML

<select id="templateSelect">

</select>

<br/>&nbsp;<br/>

<button id="bankDownload">
DOWNLOAD BANK TRANSACTIONS
</button>


<button id="memorialDownload">
DOWNLOAD MEMORIAL TRANSACTIONS
</button>

<div id="queue">

</div>

CSS

#queue { white-space: pre; font-family: monospace; }

JavaScript

var type_bank="bank";
var type_memoriaal="memoriaal";

var templates=[
{
	name: "Duitse BTW",
  type: type_memoriaal,
  lines: [
  {
  		EntryDate: askDate.bind(this,"datum","Datum"),
			GLAccountCodeDescriptionCode: "1540",
      Description: askText.bind(this,"Description DE BTW","Maandnummer (01-13)","116/5938/4796 Umsatzsteuer 2023-"),
      AccountCodeNameCode: 10409/* Finanzamt Kleve */,
      AmountDC: askValue.bind(this,"BTW Duitsland (Te betalen)","BTW Duitsland (Te betalen)", "D"),
      Journal: 90, /*memoriaal*/
      VATCode: "",
			Currency: "EUR",
  },
  {
  		EntryDate: getPreviousVariable.bind(this,"datum"),
			GLAccountCodeDescriptionCode: "1550",
      Description: getPreviousVariable.bind(this,"Description DE BTW"),
      AccountCodeNameCode: 10409/* Finanzamt Kleve */,
      AmountDC: askValue.bind(this,"BTW Duitsland (Te vorderen)","BTW Duitsland (Te vorderen)", "C"),
      Journal: 90, /*memoriaal*/
      VATCode: "",
			Currency: "EUR",
  },
  {
  		EntryDate: getPreviousVariable.bind(this,"datum"),
			GLAccountCodeDescriptionCode: "1600",
      Description: getPreviousVariable.bind(this,"Description DE BTW"),
      AccountCodeNameCode: 10409/* Finanzamt Kleve */,
      AmountDC: askValue.bind(this,"Ingediend Saldo","Ingediend Saldo", "C"),
      Journal: 90, /*memoriaal*/
      VATCode: "",
			Currency: "EUR",
  }, {
  		EntryDate: getPreviousVariable.bind(this,"datum"),
			GLAccountCodeDescriptionCode: "9200",
      Description: getPreviousVariable.bind(this,"Description DE BTW"),
      AccountCodeNameCode: 10409/* Finanzamt Kleve */,
      AmountDC: function(){ 
      	var value = parseFloat(getPreviousVariable("BTW Duitsland (Te betalen)").replace(",","."))-parseFloat(getPreviousVariable("BTW Duitsland (Te vorderen)").replace(",","."))-parseFloat(getPreviousVariable("Ingediend Saldo").replace(",","."));
        console.log("Float Value:"+value);
        value=-1*precisionRound(value,2);
        return (""+value).replace(".",",");
     ...