class LossProfitModel { final List? incomeSummary; final List? expenseSummary; final num? grossSalProfit; final num? grossIncomeProfit; final num? totalExpenses; final num? netProfit; final num? cartGrossProfit; final num? totalCardExpense; final num? cardNetProfit; LossProfitModel({ this.incomeSummary, this.expenseSummary, this.grossSalProfit, this.grossIncomeProfit, this.totalExpenses, this.netProfit, this.cartGrossProfit, this.totalCardExpense, this.cardNetProfit, }); factory LossProfitModel.fromJson(Map json) { return LossProfitModel( incomeSummary: json["mergedIncomeSaleData"] == null ? [] : List.from(json["mergedIncomeSaleData"]!.map((x) => IncomeSummaryModel.fromJson(x))), expenseSummary: json["mergedExpenseData"] == null ? [] : List.from(json["mergedExpenseData"]!.map((x) => ExpenseSummaryModel.fromJson(x))), grossSalProfit: json["grossSaleProfit"], grossIncomeProfit: json['grossIncomeProfit'], totalExpenses: json['totalExpenses'], netProfit: json['netProfit'], cartGrossProfit: json['cardGrossProfit'], totalCardExpense: json['totalCardExpenses'], cardNetProfit: json['cardNetProfit'], ); } } class IncomeSummaryModel { final String? type; final String? date; final num? totalIncome; IncomeSummaryModel({this.type, this.date, this.totalIncome}); factory IncomeSummaryModel.fromJson(Map json) { return IncomeSummaryModel( type: json["type"], date: json["date"], totalIncome: json["total_incomes"], ); } } class ExpenseSummaryModel { final String? type; final String? date; final num? totalExpense; ExpenseSummaryModel({this.type, this.date, this.totalExpense}); factory ExpenseSummaryModel.fromJson(Map json) { return ExpenseSummaryModel( type: json["type"], date: json["date"], totalExpense: json["total_expenses"], ); } }