I am creating an invoice with increment numbers start from #1 #2 #3 ...., but I have no idea how to start with. Here is the structure I want to have:
Invoice#1
|- info...
Invoice#2
|- info...
Invoice#3
|- info...
DatabaseReference ref
= FirebaseDatabase.getInstance().getReference().child("Invoice#" {increment}); //how to put increment here? if I declare i=1 in myActivity.java, it only runs in one
and this is part of the Invoice model I have
public class Invoice {
String buyer, seller, typeOfPymt;
int total;
String billdate;
int invoice_num;
int discount;
int tax;
int grand_total;
public Invoice(String buyer, String seller, int grand_total, String billdate, int invoice_num, int discount) {
this.buyer = buyer;
this.seller = seller;
this.billdate = billdate;
this.invoice_num = invoice_num;
this.discount = discount;
this.grand_total = grand_total;
}
How can I add increments inside the Model?