print => save

This commit is contained in:
2025-11-02 23:24:50 +07:00
parent f47700ad2b
commit 2a6ec8f6b8

View File

@@ -787,6 +787,9 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
return;
}
// Print before saving to API
await _printQuantities(stage);
// Show loading dialog
showDialog(
context: context,
@@ -865,16 +868,6 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
widget.productId,
);
// Get updated stage data
final updatedStages = ref.read(productDetailProvider(_providerKey)).stages;
final updatedStage = updatedStages.firstWhere(
(s) => s.productStageId == stage.productStageId,
orElse: () => stage,
);
// Automatically print after successful save
await _printQuantities(updatedStage);
// Do NOT clear quantity/weight fields - keep them for reference
// User can manually clear them if needed using the 'C' button
}