update
This commit is contained in:
parent
59d8f06d75
commit
4481d24375
@ -21,6 +21,8 @@ class ListOrder with _$ListOrder {
|
||||
|
||||
@freezed
|
||||
class Order with _$Order {
|
||||
const Order._();
|
||||
|
||||
const factory Order({
|
||||
required String id,
|
||||
required String orderNumber,
|
||||
@ -177,6 +179,9 @@ class Order with _$Order {
|
||||
.map((e) => e.product.price.toInt() * e.quantity)
|
||||
.reduce((value, element) => value + element),
|
||||
);
|
||||
|
||||
List<OrderItem> get orderItemNotCancelled =>
|
||||
orderItems.where((item) => item.status != 'cancelled').toList();
|
||||
}
|
||||
|
||||
@freezed
|
||||
|
||||
@ -681,7 +681,7 @@ class __$$OrderImplCopyWithImpl<$Res>
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$OrderImpl implements _Order {
|
||||
class _$OrderImpl extends _Order {
|
||||
const _$OrderImpl({
|
||||
required this.id,
|
||||
required this.orderNumber,
|
||||
@ -712,7 +712,8 @@ class _$OrderImpl implements _Order {
|
||||
required this.splitType,
|
||||
}) : _metadata = metadata,
|
||||
_orderItems = orderItems,
|
||||
_payments = payments;
|
||||
_payments = payments,
|
||||
super._();
|
||||
|
||||
@override
|
||||
final String id;
|
||||
@ -889,7 +890,7 @@ class _$OrderImpl implements _Order {
|
||||
__$$OrderImplCopyWithImpl<_$OrderImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _Order implements Order {
|
||||
abstract class _Order extends Order {
|
||||
const factory _Order({
|
||||
required final String id,
|
||||
required final String orderNumber,
|
||||
@ -919,6 +920,7 @@ abstract class _Order implements Order {
|
||||
required final int paymentCount,
|
||||
required final String splitType,
|
||||
}) = _$OrderImpl;
|
||||
const _Order._() : super._();
|
||||
|
||||
@override
|
||||
String get id;
|
||||
|
||||
@ -164,21 +164,21 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
final gh = _i526.GetItHelper(this, environment, environmentFilter);
|
||||
final sharedPreferencesDi = _$SharedPreferencesDi();
|
||||
final databaseDi = _$DatabaseDi();
|
||||
final dioDi = _$DioDi();
|
||||
final autoRouteDi = _$AutoRouteDi();
|
||||
final connectivityDi = _$ConnectivityDi();
|
||||
final dioDi = _$DioDi();
|
||||
gh.factory<_i13.CheckoutFormBloc>(() => _i13.CheckoutFormBloc());
|
||||
gh.factory<_i96.PrinterBloc>(() => _i96.PrinterBloc());
|
||||
gh.factory<_i257.ReportBloc>(() => _i257.ReportBloc());
|
||||
gh.factory<_i334.SplitBillFormBloc>(() => _i334.SplitBillFormBloc());
|
||||
await gh.factoryAsync<_i460.SharedPreferences>(
|
||||
() => sharedPreferencesDi.prefs,
|
||||
preResolve: true,
|
||||
);
|
||||
gh.factory<_i334.SplitBillFormBloc>(() => _i334.SplitBillFormBloc());
|
||||
gh.factory<_i96.PrinterBloc>(() => _i96.PrinterBloc());
|
||||
gh.factory<_i13.CheckoutFormBloc>(() => _i13.CheckoutFormBloc());
|
||||
gh.factory<_i257.ReportBloc>(() => _i257.ReportBloc());
|
||||
gh.singleton<_i487.DatabaseHelper>(() => databaseDi.databaseHelper);
|
||||
gh.lazySingleton<_i361.Dio>(() => dioDi.dio);
|
||||
gh.lazySingleton<_i800.AppRouter>(() => autoRouteDi.appRouter);
|
||||
gh.lazySingleton<_i895.Connectivity>(() => connectivityDi.connectivity);
|
||||
gh.lazySingleton<_i361.Dio>(() => dioDi.dio);
|
||||
gh.lazySingleton<_i171.NetworkClient>(
|
||||
() => _i171.NetworkClient(gh<_i895.Connectivity>()),
|
||||
);
|
||||
@ -209,26 +209,35 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh<_i204.AuthLocalDataProvider>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i903.BluetoothLoaderBloc>(
|
||||
() => _i903.BluetoothLoaderBloc(gh<_i104.IPrinterRepository>()),
|
||||
);
|
||||
gh.factory<_i489.BluetoothConnectBloc>(
|
||||
() => _i489.BluetoothConnectBloc(gh<_i104.IPrinterRepository>()),
|
||||
);
|
||||
gh.factory<_i903.BluetoothLoaderBloc>(
|
||||
() => _i903.BluetoothLoaderBloc(gh<_i104.IPrinterRepository>()),
|
||||
);
|
||||
gh.factory<_i1028.PrinterLoaderBloc>(
|
||||
() => _i1028.PrinterLoaderBloc(gh<_i104.IPrinterRepository>()),
|
||||
);
|
||||
gh.factory<_i21.PrintStruckBloc>(
|
||||
() => _i21.PrintStruckBloc(gh<_i104.IPrinterRepository>()),
|
||||
);
|
||||
gh.factory<_i360.OrderRemoteDataProvider>(
|
||||
() => _i360.OrderRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
gh.factory<_i708.AnalyticRemoteDataProvider>(
|
||||
() => _i708.AnalyticRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i370.AuthRemoteDataProvider>(
|
||||
() => _i370.AuthRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i856.CategoryRemoteDataProvider>(
|
||||
() => _i856.CategoryRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i370.AuthRemoteDataProvider>(
|
||||
() => _i370.AuthRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
gh.factory<_i841.CustomerRemoteDataProvider>(
|
||||
() => _i841.CustomerRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i360.OrderRemoteDataProvider>(
|
||||
() => _i360.OrderRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i132.OutletRemoteDataProvider>(
|
||||
() => _i132.OutletRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i833.PaymentMethodRemoteDataProvider>(
|
||||
() => _i833.PaymentMethodRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
@ -236,18 +245,9 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh.factory<_i707.ProductRemoteDataProvider>(
|
||||
() => _i707.ProductRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i132.OutletRemoteDataProvider>(
|
||||
() => _i132.OutletRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i95.TableRemoteDataProvider>(
|
||||
() => _i95.TableRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i708.AnalyticRemoteDataProvider>(
|
||||
() => _i708.AnalyticRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i841.CustomerRemoteDataProvider>(
|
||||
() => _i841.CustomerRemoteDataProvider(gh<_i457.ApiClient>()),
|
||||
);
|
||||
gh.factory<_i776.IAuthRepository>(
|
||||
() => _i941.AuthRepository(
|
||||
gh<_i370.AuthRemoteDataProvider>(),
|
||||
@ -322,12 +322,12 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh.factory<_i194.PaymentFormBloc>(
|
||||
() => _i194.PaymentFormBloc(gh<_i299.IOrderRepository>()),
|
||||
);
|
||||
gh.factory<_i822.VoidFormBloc>(
|
||||
() => _i822.VoidFormBloc(gh<_i299.IOrderRepository>()),
|
||||
);
|
||||
gh.factory<_i837.RefundFormBloc>(
|
||||
() => _i837.RefundFormBloc(gh<_i299.IOrderRepository>()),
|
||||
);
|
||||
gh.factory<_i822.VoidFormBloc>(
|
||||
() => _i822.VoidFormBloc(gh<_i299.IOrderRepository>()),
|
||||
);
|
||||
gh.factory<_i683.CustomerLoaderBloc>(
|
||||
() => _i683.CustomerLoaderBloc(gh<_i143.ICustomerRepository>()),
|
||||
);
|
||||
@ -361,28 +361,28 @@ extension GetItInjectableX on _i174.GetIt {
|
||||
gh<_i502.ICategoryRepository>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i268.ProductAnalyticLoaderBloc>(
|
||||
() => _i268.ProductAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
gh.factory<_i911.CategoryAnalyticLoaderBloc>(
|
||||
() => _i911.CategoryAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i80.DashboardAnalyticLoaderBloc>(
|
||||
() => _i80.DashboardAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i651.InventoryAnalyticLoaderBloc>(
|
||||
() => _i651.InventoryAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i741.ProfitLossAnalyticLoaderBloc>(
|
||||
() => _i741.ProfitLossAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i413.SalesAnalyticLoaderBloc>(
|
||||
() => _i413.SalesAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i733.PaymentMethodAnalyticLoaderBloc>(
|
||||
() => _i733.PaymentMethodAnalyticLoaderBloc(
|
||||
gh<_i346.IAnalyticRepository>(),
|
||||
),
|
||||
);
|
||||
gh.factory<_i911.CategoryAnalyticLoaderBloc>(
|
||||
() => _i911.CategoryAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
gh.factory<_i268.ProductAnalyticLoaderBloc>(
|
||||
() => _i268.ProductAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i80.DashboardAnalyticLoaderBloc>(
|
||||
() => _i80.DashboardAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
gh.factory<_i741.ProfitLossAnalyticLoaderBloc>(
|
||||
() => _i741.ProfitLossAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
gh.factory<_i413.SalesAnalyticLoaderBloc>(
|
||||
() => _i413.SalesAnalyticLoaderBloc(gh<_i346.IAnalyticRepository>()),
|
||||
);
|
||||
return this;
|
||||
}
|
||||
@ -392,8 +392,8 @@ class _$SharedPreferencesDi extends _i135.SharedPreferencesDi {}
|
||||
|
||||
class _$DatabaseDi extends _i209.DatabaseDi {}
|
||||
|
||||
class _$DioDi extends _i86.DioDi {}
|
||||
|
||||
class _$AutoRouteDi extends _i729.AutoRouteDi {}
|
||||
|
||||
class _$ConnectivityDi extends _i807.ConnectivityDi {}
|
||||
|
||||
class _$DioDi extends _i86.DioDi {}
|
||||
|
||||
@ -46,7 +46,7 @@ class PrintUi {
|
||||
|
||||
bytes += builder.emptyLines(1);
|
||||
|
||||
for (final item in order.orderItems) {
|
||||
for (final item in order.orderItemNotCancelled) {
|
||||
bytes += builder.orderItem(
|
||||
productName: item.productName,
|
||||
quantity: item.quantity,
|
||||
@ -316,7 +316,7 @@ class PrintUi {
|
||||
|
||||
bytes += builder.emptyLines(1);
|
||||
|
||||
for (final item in order.orderItems) {
|
||||
for (final item in order.orderItemNotCancelled) {
|
||||
bytes += builder.orderItem(
|
||||
productName: item.productName,
|
||||
quantity: item.quantity,
|
||||
@ -392,7 +392,6 @@ class PrintUi {
|
||||
notes: item.notes,
|
||||
);
|
||||
}
|
||||
|
||||
bytes += builder.summary(
|
||||
totalItems: order.orderItems.length,
|
||||
subtotal: order.subtotal.currencyFormatRpV2,
|
||||
|
||||
@ -576,7 +576,7 @@ class TableRoute extends _i22.PageRouteInfo<void> {
|
||||
static _i22.PageInfo page = _i22.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i19.TablePage();
|
||||
return _i22.WrappedRoute(child: const _i19.TablePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user