@@ -31,7 +31,9 @@ def get_accounts(
3131 order_by = order_by ,
3232 )
3333 accounts_json = accounts .json ()
34- viewer = ViewerDispatcher (data = accounts_json , json_flag = json )
34+ viewer = ViewerDispatcher (
35+ data = accounts_json , json_flag = json , data_type = "Chart of Accounts"
36+ )
3537 viewer ()
3638
3739
@@ -43,7 +45,9 @@ def get_account(ctx: click.Context, company_id: str, account: str, json: bool =
4345 client = ctx .obj
4446 account_result = client .get_account (company_id , account )
4547 account_result_json = account_result .json ()
46- viewer = ViewerDispatcher (data = account_result_json , json_flag = json )
48+ viewer = ViewerDispatcher (
49+ data = account_result_json , json_flag = json , data_type = "Accounts"
50+ )
4751 viewer ()
4852
4953
@@ -70,7 +74,11 @@ def get_account_transactions(
7074 order_by = order_by ,
7175 )
7276 account_transactions_json = account_transactions .json ()
73- viewer = ViewerDispatcher (data = account_transactions_json , json_flag = json )
77+ viewer = ViewerDispatcher (
78+ data = account_transactions_json ,
79+ json_flag = json ,
80+ data_type = "List of Account Transactions" ,
81+ )
7482 viewer ()
7583
7684
@@ -90,7 +98,11 @@ def get_account_transaction(
9098 company_id , connection , account_transaction
9199 )
92100 account_transaction_result_json = account_transaction_result .json ()
93- viewer = ViewerDispatcher (data = account_transaction_result_json , json_flag = json )
101+ viewer = ViewerDispatcher (
102+ data = account_transaction_result_json ,
103+ json_flag = json ,
104+ data_type = "Account Transaction" ,
105+ )
94106 viewer ()
95107
96108
@@ -115,7 +127,9 @@ def get_bills(
115127 order_by = order_by ,
116128 )
117129 bills_json = bills .json ()
118- viewer = ViewerDispatcher (data = bills_json , json_flag = json )
130+ viewer = ViewerDispatcher (
131+ data = bills_json , json_flag = json , data_type = "List of Bills"
132+ )
119133 viewer ()
120134
121135
@@ -127,7 +141,7 @@ def get_bill(ctx: click.Context, company_id: str, bill: str, json: bool = False)
127141 client = ctx .obj
128142 bill_result = client .get_bill (company_id , bill )
129143 bill_result_json = bill_result .json ()
130- viewer = ViewerDispatcher (data = bill_result_json , json_flag = json )
144+ viewer = ViewerDispatcher (data = bill_result_json , json_flag = json , data_type = "Bills" )
131145 viewer ()
132146
133147
@@ -152,7 +166,9 @@ def get_suppliers(
152166 order_by = order_by ,
153167 )
154168 suppliers_json = suppliers .json ()
155- viewer = ViewerDispatcher (data = suppliers_json , json_flag = json )
169+ viewer = ViewerDispatcher (
170+ data = suppliers_json , json_flag = json , data_type = "List of Suppliers"
171+ )
156172 viewer ()
157173
158174
@@ -166,7 +182,9 @@ def get_supplier(
166182 client = ctx .obj
167183 supplier_result = client .get_supplier (company_id , supplier )
168184 supplier_result_json = supplier_result .json ()
169- viewer = ViewerDispatcher (data = supplier_result_json , json_flag = json )
185+ viewer = ViewerDispatcher (
186+ data = supplier_result_json , json_flag = json , data_type = "Supplier"
187+ )
170188 viewer ()
171189
172190
@@ -191,7 +209,9 @@ def get_invoices(
191209 order_by = order_by ,
192210 )
193211 invoices_json = invoices .json ()
194- viewer = ViewerDispatcher (data = invoices_json , json_flag = json )
212+ viewer = ViewerDispatcher (
213+ data = invoices_json , json_flag = json , data_type = "List of Invoices"
214+ )
195215 viewer ()
196216
197217
@@ -203,7 +223,9 @@ def get_invoice(ctx: click.Context, company_id: str, invoice: str, json: bool =
203223 client = ctx .obj
204224 invoice_result = client .get_invoice (company_id , invoice )
205225 invoice_result_json = invoice_result .json ()
206- viewer = ViewerDispatcher (data = invoice_result_json , json_flag = json )
226+ viewer = ViewerDispatcher (
227+ data = invoice_result_json , json_flag = json , data_type = "Invoice"
228+ )
207229 viewer ()
208230
209231
@@ -228,7 +250,9 @@ def get_payments(
228250 order_by = order_by ,
229251 )
230252 payments_json = payments .json ()
231- viewer = ViewerDispatcher (data = payments_json , json_flag = json )
253+ viewer = ViewerDispatcher (
254+ data = payments_json , json_flag = json , data_type = "List of Payments"
255+ )
232256 viewer ()
233257
234258
@@ -240,5 +264,7 @@ def get_payment(ctx: click.Context, company_id: str, payment: str, json: bool =
240264 client = ctx .obj
241265 payment_result = client .get_payment (company_id , payment )
242266 payment_result_json = payment_result .json ()
243- viewer = ViewerDispatcher (data = payment_result_json , json_flag = json )
267+ viewer = ViewerDispatcher (
268+ data = payment_result_json , json_flag = json , data_type = "Payment"
269+ )
244270 viewer ()
0 commit comments