Я создаю счет-фактуру с номерами приращений, начинающимися с # 1 # 2 # 3 ...., но я не знаю, с чего начать. Вот структура, которую я хочу иметь:
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
, и это является частью модели счета-фактуры, которую я имею
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;
}
Как я могу добавить приращения внутри модели?