fiuai-sdk-python 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/PKG-INFO +1 -1
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/pyproject.toml +1 -1
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/bank.py +6 -6
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/client.py +1 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/company.py +3 -3
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/setup.py +4 -4
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/test_all.py +9 -7
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/.gitignore +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/CHANGELOG.md +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/LICENSE +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/README.md +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/__init__.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/auth/__init__.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/auth/header.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/auth/helper.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/auth/test_auth.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/auth/type.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/const.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/error.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/item.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/perm.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/profile.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/type.py +0 -0
- {fiuai_sdk_python-0.3.1 → fiuai_sdk_python-0.3.2}/src/fiuai_sdk_python/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiuai_sdk_python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: FiuAI Python SDK - 企业级AI服务集成开发工具包
|
|
5
5
|
Project-URL: Homepage, https://github.com/fiuai/fiuai-sdk-python
|
|
6
6
|
Project-URL: Documentation, https://github.com/fiuai/fiuai-sdk-python#readme
|
|
@@ -46,7 +46,7 @@ def get_bank_account(client: FiuaiSDK, bank_account_no: str) -> Optional[Company
|
|
|
46
46
|
logger.error(f"bank_account_no is empty, return None")
|
|
47
47
|
return None
|
|
48
48
|
|
|
49
|
-
_bank_account = client.
|
|
49
|
+
_bank_account = client.internal_get(
|
|
50
50
|
doctype="Bank Account",
|
|
51
51
|
name=bank_account_no,
|
|
52
52
|
fields=["name","bank_account_no", "account_name", "bank", "opening_bank_branch"]
|
|
@@ -58,7 +58,7 @@ def get_bank_account(client: FiuaiSDK, bank_account_no: str) -> Optional[Company
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
# 获取银行信息
|
|
61
|
-
_bank_detail = client.
|
|
61
|
+
_bank_detail = client.internal_get(
|
|
62
62
|
doctype="Bank",
|
|
63
63
|
name=_bank_account["bank"],
|
|
64
64
|
fields=["name", "bank_name"]
|
|
@@ -68,7 +68,7 @@ def get_bank_account(client: FiuaiSDK, bank_account_no: str) -> Optional[Company
|
|
|
68
68
|
return CompanyBankAccountSearchResult(exists=False)
|
|
69
69
|
|
|
70
70
|
# 获取支行信息
|
|
71
|
-
_bank_branch = client.
|
|
71
|
+
_bank_branch = client.internal_get(
|
|
72
72
|
doctype="Bank Branch",
|
|
73
73
|
name=_bank_account["opening_bank_branch"],
|
|
74
74
|
fields=["name", "bank_branch_name"]
|
|
@@ -93,7 +93,7 @@ def get_bank_account_by_bank_id(client: FiuaiSDK, bank_id: str) -> BankAccount|N
|
|
|
93
93
|
"""
|
|
94
94
|
根据银行账号id获取银行账号信息
|
|
95
95
|
"""
|
|
96
|
-
resp = client.
|
|
96
|
+
resp = client.internal_get(
|
|
97
97
|
doctype="Bank Account",
|
|
98
98
|
filters=[["name", "=", bank_id]],
|
|
99
99
|
fields=[
|
|
@@ -111,7 +111,7 @@ def get_bank_account_by_bank_id(client: FiuaiSDK, bank_id: str) -> BankAccount|N
|
|
|
111
111
|
# 获取支行信息
|
|
112
112
|
bank_branch = ""
|
|
113
113
|
if resp["opening_bank_branch"] != "":
|
|
114
|
-
_bank_branch = client.
|
|
114
|
+
_bank_branch = client.internal_get(
|
|
115
115
|
doctype="Bank Branch",
|
|
116
116
|
name=resp["opening_bank_branch"],
|
|
117
117
|
fields=["name", "bank_branch_name"]
|
|
@@ -123,7 +123,7 @@ def get_bank_account_by_bank_id(client: FiuaiSDK, bank_id: str) -> BankAccount|N
|
|
|
123
123
|
bank_branch = _bank_branch["bank_branch_name"]
|
|
124
124
|
|
|
125
125
|
# 获取银行信息
|
|
126
|
-
_bank_detail = client.
|
|
126
|
+
_bank_detail = client.internal_get(
|
|
127
127
|
doctype="Bank",
|
|
128
128
|
name=resp["bank"],
|
|
129
129
|
fields=["name", "bank_name"]
|
|
@@ -102,6 +102,7 @@ class FiuaiSDK(object):
|
|
|
102
102
|
|
|
103
103
|
def get_avaliable_company(self, page: int=1, page_size: int=20) -> str:
|
|
104
104
|
r = self.client.get(self.url + "/api/method/fiuai.network.doctype.company.company.get_available_companies", params={"page": page, "page_size": page_size})
|
|
105
|
+
|
|
105
106
|
return self.post_process(r)
|
|
106
107
|
|
|
107
108
|
def swith_company(self, tenant: str = "", company: str = "") -> bool:
|
|
@@ -36,7 +36,7 @@ def get_target_company_by_name(client: FiuaiSDK, full_name: str, target_side: Li
|
|
|
36
36
|
"""
|
|
37
37
|
connection_type = "Customer" if target_side == "buyer" else "Supplier"
|
|
38
38
|
|
|
39
|
-
_lookup = client.
|
|
39
|
+
_lookup = client.internal_get(
|
|
40
40
|
doctype="Company Lookup",
|
|
41
41
|
fields=["target_company_id", "unique_no"],
|
|
42
42
|
filters=[["company_name", "=", full_name]])
|
|
@@ -45,7 +45,7 @@ def get_target_company_by_name(client: FiuaiSDK, full_name: str, target_side: Li
|
|
|
45
45
|
return TargetCompanySearchResult(name="", full_name="", unique_no="", exists=False, in_network=False, comment="该公司不存在")
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
_network = client.
|
|
48
|
+
_network = client.internal_get(
|
|
49
49
|
doctype="Company Network",
|
|
50
50
|
fields=["name", "target_company_id", "target_company"],
|
|
51
51
|
filters=[["target_company_id", "=", _lookup["target_company_id"]], ["connection_type", "=", connection_type]])
|
|
@@ -70,7 +70,7 @@ def get_company_profile(client: FiuaiSDK, auth_company_id: str)-> CompanyProfile
|
|
|
70
70
|
"""
|
|
71
71
|
获取公司信息
|
|
72
72
|
"""
|
|
73
|
-
resp = client.
|
|
73
|
+
resp = client.internal_get(
|
|
74
74
|
doctype="Company",
|
|
75
75
|
filters=[["name", "=", auth_company_id]],
|
|
76
76
|
fields=[
|
|
@@ -37,14 +37,14 @@ def load_uom_data(client: FiuaiSDK)-> List[UOM]:
|
|
|
37
37
|
"""
|
|
38
38
|
从frappe获取uom数据
|
|
39
39
|
"""
|
|
40
|
-
uom_list = client.
|
|
40
|
+
uom_list = client.internal_get_list(doctype="UOM", fields=["name", "uom_name", "common_code"])
|
|
41
41
|
return [UOM(name=uom["name"], uom_name=uom["uom_name"], common_code=uom["common_code"]) for uom in uom_list]
|
|
42
42
|
|
|
43
43
|
def load_currency_data(client: FiuaiSDK)-> List[Currency]:
|
|
44
44
|
"""
|
|
45
45
|
从frappe获取currency数据
|
|
46
46
|
"""
|
|
47
|
-
currency_list = client.
|
|
47
|
+
currency_list = client.internal_get_list(
|
|
48
48
|
doctype="Currency",
|
|
49
49
|
filters={"enabled": 1},
|
|
50
50
|
fields=["name", "currency_name", "fraction_units", "smallest_currency_fraction_value"]
|
|
@@ -55,7 +55,7 @@ def load_country_data(client: FiuaiSDK)-> List[Country]:
|
|
|
55
55
|
"""
|
|
56
56
|
从frappe获取country数据
|
|
57
57
|
"""
|
|
58
|
-
country_list = client.
|
|
58
|
+
country_list = client.internal_get_list(
|
|
59
59
|
doctype="Country",
|
|
60
60
|
filters={"name": ["in", USED_COUNTRY_LIST]},
|
|
61
61
|
fields=["name", "code"]
|
|
@@ -66,7 +66,7 @@ def load_language_data(client: FiuaiSDK)-> List[Language]:
|
|
|
66
66
|
"""
|
|
67
67
|
从frappe获取language数据
|
|
68
68
|
"""
|
|
69
|
-
language_list = client.
|
|
69
|
+
language_list = client.internal_get_list(
|
|
70
70
|
doctype="Language",
|
|
71
71
|
filters={"name": ["in", USED_LANGUAGE_LIST]},
|
|
72
72
|
fields=["name", "language_name"]
|
|
@@ -43,19 +43,21 @@ def test_normal_client():
|
|
|
43
43
|
|
|
44
44
|
all = client.internal_get_list(
|
|
45
45
|
doctype="Contract",
|
|
46
|
-
limit_page_length=
|
|
46
|
+
limit_page_length=20,
|
|
47
|
+
fields=["name", "contract_no", "grand_total"],
|
|
48
|
+
filters=[["contract_no", "=", "FXT20250520"]]
|
|
47
49
|
)
|
|
48
50
|
print(all)
|
|
49
51
|
|
|
50
|
-
assert len(all) == 2
|
|
52
|
+
# assert len(all) == 2
|
|
51
53
|
|
|
52
54
|
|
|
53
|
-
name = all[0]["name"]
|
|
55
|
+
# name = all[0]["name"]
|
|
54
56
|
|
|
55
|
-
c = client.internal_get(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
57
|
+
# c = client.internal_get(
|
|
58
|
+
# doctype="Contract",
|
|
59
|
+
# name=name
|
|
60
|
+
# )
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
# c["contract_no"] = "taest112"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|