add method
Operation
add({
- dynamic date,
- dynamic cplus,
- dynamic cminus,
- dynamic desc,
- dynamic cur,
- dynamic valuta,
- dynamic mod,
batch setterr Adds a batch of attributes to the operation (e.g., date, account, description, etc.).
This allows adding multiple journal lines in one go.
Implementation
Operation add({date, cplus, cminus, desc, cur, valuta, mod}) {
if (date != null) {
if (date is String)
this.datum.add(DateTime.parse(date));
else if (date is DateTime)
this.datum.add(date);
else
this.datum.add(DateTime.now());
}
this.cplus.add((cplus != null) ? "$cplus".trim() : "none");
this.cminus.add((cminus != null) ? "$cminus".trim() : "none");
this.desc.add((desc != null) ? desc.trim() : "none");
this.cur.add((cur != null) ? cur : "EUR");
this.valuta.add((valuta != null) ? valuta : "");
this.mod.add((mod != null) ? mod : "");
//print("incoming : $date,$cplus,$cminus,$desc,$cur,$valuta. $mod gives "+toString());
return this;
}