117117from ..api .robo_ledger_fiscal_close .set_close_target import (
118118 sync_detailed as op_set_close_target ,
119119)
120+ from ..api .robo_ledger_setup .change_calendar_start import (
121+ sync_detailed as op_change_calendar_start ,
122+ )
120123from ..api .robo_ledger_taxonomy_mapping .create_taxonomy_block import (
121124 sync_detailed as op_create_taxonomy_block ,
122125)
579582from ..models .update_publish_list_operation import UpdatePublishListOperation
580583from ..models .reopen_period_operation import ReopenPeriodOperation
581584from ..models .set_close_target_operation import SetCloseTargetOperation
585+ from ..models .change_calendar_start_request import ChangeCalendarStartRequest
586+ from ..models .change_calendar_start_response import ChangeCalendarStartResponse
582587from ..models .bind_text_block_request import BindTextBlockRequest
583588from ..models .bind_text_block_response import BindTextBlockResponse
584589from ..models .create_taxonomy_block_request import CreateTaxonomyBlockRequest
@@ -2345,6 +2350,30 @@ def set_close_target(
23452350 envelope = self ._call_op ("Set close target" , response )
23462351 return self ._typed_result ("Set close target" , envelope , FiscalCalendarResponse )
23472352
2353+ def change_calendar_start (
2354+ self ,
2355+ graph_id : str ,
2356+ first_open_period : str ,
2357+ note : str | None = None ,
2358+ * ,
2359+ entity_id : str | None = None ,
2360+ ) -> ChangeCalendarStartResponse :
2361+ """Move the calendar's first open month (YYYY-MM), allowed only until the
2362+ entity's first close. Earlier opens months back to it; later removes the
2363+ leading months, refused while they hold any entry."""
2364+ body = ChangeCalendarStartRequest (
2365+ first_open_period = first_open_period ,
2366+ note = note if note is not None else UNSET ,
2367+ entity_id = entity_id if entity_id is not None else UNSET ,
2368+ )
2369+ response = op_change_calendar_start (
2370+ graph_id = graph_id , body = body , client = self ._get_client ()
2371+ )
2372+ envelope = self ._call_op ("Change calendar start" , response )
2373+ return self ._typed_result (
2374+ "Change calendar start" , envelope , ChangeCalendarStartResponse
2375+ )
2376+
23482377 def close_period (
23492378 self ,
23502379 graph_id : str ,
@@ -2530,19 +2559,22 @@ def preview_reconciliations(
25302559 * ,
25312560 method : PreviewReconciliationsRequestMethod | str | None = None ,
25322561 include_tied : bool | None = None ,
2562+ entity_id : str | None = None ,
25332563 ) -> ReconciliationPreviewResponse :
25342564 """Compare the ledger with something outside it. Records nothing.
25352565
25362566 ``method`` picks the check: ``source_ledger`` (the default, which needs a
25372567 connected QuickBooks ledger), ``schedule_register`` or ``statement``.
2538- ``include_tied`` also returns the accounts that tie.
2568+ ``include_tied`` also returns the accounts that tie. ``entity_id`` checks
2569+ a subsidiary's books; omitted, the group parent's.
25392570 """
25402571 body = PreviewReconciliationsRequest (
25412572 period = period ,
25422573 method = (
25432574 PreviewReconciliationsRequestMethod (method ) if method is not None else UNSET
25442575 ),
25452576 include_tied = include_tied if include_tied is not None else UNSET ,
2577+ entity_id = entity_id if entity_id is not None else UNSET ,
25462578 )
25472579 response = op_preview_reconciliations (
25482580 graph_id = graph_id , body = body , client = self ._get_client ()
@@ -2553,11 +2585,14 @@ def preview_reconciliations(
25532585 )
25542586
25552587 def refresh_reconciliations (
2556- self , graph_id : str , period : str
2588+ self , graph_id : str , period : str , * , entity_id : str | None = None
25572589 ) -> ReconciliationListResponse :
25582590 """Run every reconciliation that applies at a period end and record each
2559- result on its block. ``notes`` names any check that could not run."""
2560- body = RefreshReconciliationsRequest (period = period )
2591+ result on its block. ``notes`` names any check that could not run.
2592+ ``entity_id`` runs a subsidiary's; omitted, the group parent's."""
2593+ body = RefreshReconciliationsRequest (
2594+ period = period , entity_id = entity_id if entity_id is not None else UNSET
2595+ )
25612596 response = op_refresh_reconciliations (
25622597 graph_id = graph_id , body = body , client = self ._get_client ()
25632598 )
@@ -2575,6 +2610,7 @@ def record_statement_balance(
25752610 balance : float ,
25762611 document_id : str | None = None ,
25772612 note : str | None = None ,
2613+ entity_id : str | None = None ,
25782614 ) -> ReconciliationSummary :
25792615 """Record a statement's ending balance for a balance-sheet account and
25802616 reconcile the account to it for the period the statement ends in.
@@ -2583,10 +2619,12 @@ def record_statement_balance(
25832619 account's normal direction (money in a bank account, or the amount owed
25842620 on a loan or a card). ``as_of`` is the statement's ending date.
25852621 ``document_id`` names the statement itself, as a document already on
2586- the graph. Writes no books.
2622+ the graph. ``entity_id`` names the subsidiary whose account it is;
2623+ omitted, the group parent. Writes no books.
25872624 """
25882625 body = RecordStatementBalanceRequest (
25892626 element_id = element_id ,
2627+ entity_id = entity_id if entity_id is not None else UNSET ,
25902628 as_of = datetime .date .fromisoformat (as_of ) if isinstance (as_of , str ) else as_of ,
25912629 balance = balance ,
25922630 document_id = document_id if document_id is not None else UNSET ,
0 commit comments