feat: update profit loss ui
Build & Deploy iOS to TestFlight / build-and-deploy (push) Waiting to run
Build & Deploy iOS to TestFlight / build-and-deploy (push) Waiting to run
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4,22 +4,34 @@ part of '../analytic.dart';
|
||||
class ProfitLossAnalytic with _$ProfitLossAnalytic {
|
||||
const factory ProfitLossAnalytic({
|
||||
required String organizationId,
|
||||
required String outletId,
|
||||
required String outletName,
|
||||
required String dateFrom,
|
||||
required String dateTo,
|
||||
required String groupBy,
|
||||
required ProfitLossSummary summary,
|
||||
required List<ProfitLossDailyData> data,
|
||||
required List<ProfitLossProductData> productData,
|
||||
required List<ProfitLossMainSummaryItem> mainSummary,
|
||||
required ProfitLossPurchasing purchasing,
|
||||
required List<ProfitLossOperationalExpense> operationalExpenses,
|
||||
required int operationalExpensesTotal,
|
||||
}) = _ProfitLossAnalytic;
|
||||
|
||||
factory ProfitLossAnalytic.empty() => ProfitLossAnalytic(
|
||||
organizationId: '',
|
||||
outletId: '',
|
||||
outletName: '',
|
||||
dateFrom: '',
|
||||
dateTo: '',
|
||||
groupBy: '',
|
||||
summary: ProfitLossSummary.empty(),
|
||||
data: [],
|
||||
productData: [],
|
||||
mainSummary: [],
|
||||
purchasing: ProfitLossPurchasing.empty(),
|
||||
operationalExpenses: [],
|
||||
operationalExpensesTotal: 0,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,3 +127,79 @@ class ProfitLossProductData with _$ProfitLossProductData {
|
||||
profitPerUnit: 0,
|
||||
);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class ProfitLossMainSummaryItem with _$ProfitLossMainSummaryItem {
|
||||
const factory ProfitLossMainSummaryItem({
|
||||
required String id,
|
||||
required String label,
|
||||
required bool isBold,
|
||||
required int todayNominal,
|
||||
required double todayPct,
|
||||
required int mtdNominal,
|
||||
required double mtdPct,
|
||||
@Default([]) List<ProfitLossMainSummaryItem> subItems,
|
||||
}) = _ProfitLossMainSummaryItem;
|
||||
|
||||
factory ProfitLossMainSummaryItem.empty() => const ProfitLossMainSummaryItem(
|
||||
id: '',
|
||||
label: '',
|
||||
isBold: false,
|
||||
todayNominal: 0,
|
||||
todayPct: 0,
|
||||
mtdNominal: 0,
|
||||
mtdPct: 0,
|
||||
subItems: [],
|
||||
);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class ProfitLossPurchasing with _$ProfitLossPurchasing {
|
||||
const factory ProfitLossPurchasing({
|
||||
required int todayTotal,
|
||||
required int mtdTotal,
|
||||
required int todayRawMaterial,
|
||||
required int mtdRawMaterial,
|
||||
required int todayExpense,
|
||||
required int mtdExpense,
|
||||
@Default([]) List<ProfitLossPurchasingItem> items,
|
||||
}) = _ProfitLossPurchasing;
|
||||
|
||||
factory ProfitLossPurchasing.empty() => const ProfitLossPurchasing(
|
||||
todayTotal: 0,
|
||||
mtdTotal: 0,
|
||||
todayRawMaterial: 0,
|
||||
mtdRawMaterial: 0,
|
||||
todayExpense: 0,
|
||||
mtdExpense: 0,
|
||||
items: [],
|
||||
);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class ProfitLossPurchasingItem with _$ProfitLossPurchasingItem {
|
||||
const factory ProfitLossPurchasingItem({
|
||||
required String date,
|
||||
required String item,
|
||||
required int quantity,
|
||||
required int nominal,
|
||||
}) = _ProfitLossPurchasingItem;
|
||||
|
||||
factory ProfitLossPurchasingItem.empty() => const ProfitLossPurchasingItem(
|
||||
date: '',
|
||||
item: '',
|
||||
quantity: 0,
|
||||
nominal: 0,
|
||||
);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class ProfitLossOperationalExpense with _$ProfitLossOperationalExpense {
|
||||
const factory ProfitLossOperationalExpense({
|
||||
required String item,
|
||||
required int nominal,
|
||||
}) = _ProfitLossOperationalExpense;
|
||||
|
||||
factory ProfitLossOperationalExpense.empty() =>
|
||||
const ProfitLossOperationalExpense(item: '', nominal: 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user