Skip to content

Commit

Permalink
feat: implemented get registered imported items to get information re…
Browse files Browse the repository at this point in the history
…gistered for all branches.
  • Loading branch information
GichanaMayaka committed Jun 6, 2024
1 parent 4064b57 commit d6a090a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions kenya_compliance/kenya_compliance/apis/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,22 @@ def perform_import_item_search(request_data: str) -> None:
endpoints_builder.make_remote_call()


@frappe.whitelist()
def perform_import_item_search_all_branches() -> None:
all_credentials = frappe.get_all(
SETTINGS_DOCTYPE_NAME,
["name", "bhfid", "communication_key", "tin", "company"],
)

for credential in all_credentials:
request_data = json.dumps(
{"company_name": credential.company, "branch_code": credential.bhfid}
)

print("+1\n")
perform_import_item_search(request_data)


@frappe.whitelist()
def perform_purchases_search(request_data: str) -> None:
data: dict = json.loads(request_data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ frappe.listview_settings[doctypeName] = {
function (listview) {
frappe.call({
method:
"kenya_compliance.kenya_compliance.apis.apis.perform_import_item_search",
"kenya_compliance.kenya_compliance.apis.apis.perform_import_item_search_all_branches",
args: {
request_data: {
company_name: companyName,
Expand Down

0 comments on commit d6a090a

Please sign in to comment.