スナック見えない
This commit is contained in:
parent
50aa460064
commit
27fb3d7286
2 changed files with 23 additions and 6 deletions
15
main.py
15
main.py
|
|
@ -723,7 +723,9 @@ class FlutterStyleDashboard:
|
||||||
self.open_invoice_edit(slip)
|
self.open_invoice_edit(slip)
|
||||||
|
|
||||||
def on_long_press(_):
|
def on_long_press(_):
|
||||||
self.show_context_menu(slip)
|
# 長押しは直接編集画面へ(ビューワではなく編集)
|
||||||
|
logging.info(f"long_press -> open_invoice_edit: {getattr(slip, 'invoice_number', 'unknown')}")
|
||||||
|
self.open_invoice_edit(slip)
|
||||||
|
|
||||||
show_offset_button = isinstance(slip, Invoice) and self.can_create_offset_invoice(slip)
|
show_offset_button = isinstance(slip, Invoice) and self.can_create_offset_invoice(slip)
|
||||||
|
|
||||||
|
|
@ -972,7 +974,9 @@ class FlutterStyleDashboard:
|
||||||
self.selected_customer = invoice.customer
|
self.selected_customer = invoice.customer
|
||||||
self.selected_document_type = invoice.document_type
|
self.selected_document_type = invoice.document_type
|
||||||
self.amount_value = str(invoice.items[0].unit_price if invoice.items else "0")
|
self.amount_value = str(invoice.items[0].unit_price if invoice.items else "0")
|
||||||
self.is_detail_edit_mode = False # 初期はビューモード
|
self.is_detail_edit_mode = True # 編集モードで開く
|
||||||
|
self.is_customer_picker_open = False
|
||||||
|
self.is_new_customer_form_open = False
|
||||||
self.current_tab = 1 # 詳細編集タブに切り替え
|
self.current_tab = 1 # 詳細編集タブに切り替え
|
||||||
self.update_main_content()
|
self.update_main_content()
|
||||||
|
|
||||||
|
|
@ -1623,7 +1627,12 @@ class FlutterStyleDashboard:
|
||||||
|
|
||||||
def _show_snack(self, message: str, color=ft.Colors.BLUE_GREY_800):
|
def _show_snack(self, message: str, color=ft.Colors.BLUE_GREY_800):
|
||||||
try:
|
try:
|
||||||
self.page.snack_bar = ft.SnackBar(content=ft.Text(message), bgcolor=color)
|
snack = ft.SnackBar(content=ft.Text(message), bgcolor=color)
|
||||||
|
# prefer show_snack_bar API if available (more reliable on web)
|
||||||
|
if hasattr(self.page, "show_snack_bar"):
|
||||||
|
self.page.show_snack_bar(snack)
|
||||||
|
else:
|
||||||
|
self.page.snack_bar = snack
|
||||||
self.page.snack_bar.open = True
|
self.page.snack_bar.open = True
|
||||||
self.page.update()
|
self.page.update()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
|
|
@ -403,6 +403,14 @@ class CustomerService:
|
||||||
logging.error(f"新規顧客登録失敗: {formal_name}")
|
logging.error(f"新規顧客登録失敗: {formal_name}")
|
||||||
return 0 # 失敗時は0を返す
|
return 0 # 失敗時は0を返す
|
||||||
|
|
||||||
|
def update_customer(self, customer: Customer) -> bool:
|
||||||
|
"""顧客を更新し、キャッシュをリフレッシュ"""
|
||||||
|
success = self.customer_repo.update_customer(customer)
|
||||||
|
if success:
|
||||||
|
# キャッシュを再読み込み
|
||||||
|
self._load_customers()
|
||||||
|
return success
|
||||||
|
|
||||||
def _load_customers(self):
|
def _load_customers(self):
|
||||||
"""顧客データを読み込み"""
|
"""顧客データを読み込み"""
|
||||||
self._customer_cache = self.customer_repo.get_all_customers()
|
self._customer_cache = self.customer_repo.get_all_customers()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue