20251109
This commit is contained in:
1 parent
ac73cd8540
commit
03de3b1663
1 file changed
+168
-242
+168
-242
@@ -16,7 +16,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.12\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
"cursor = db.cursor()\n",
|
"cursor = db.cursor()\n",
|
||||||
"sql = 'select account_name,account_number,parent_account from tabAccount where company= %s'\n",
|
"sql = 'select account_name,account_number,parent_account from tabAccount where company= %s'\n",
|
||||||
"cursor.execute(sql, {'北京运动一百体育文化发展有限公司'})\n",
|
"cursor.execute(sql, {'北京运动一百体育文化发展有限公司'})\n",
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.12\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
"cursor = db.cursor()\n",
|
"cursor = db.cursor()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"dict1 = {}\n",
|
"dict1 = {}\n",
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.12\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
"cursor = db.cursor()\n",
|
"cursor = db.cursor()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"dict1 = {}\n",
|
"dict1 = {}\n",
|
||||||
@@ -117,6 +117,39 @@
|
|||||||
" print(item)"
|
" print(item)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "b04ee7f2-bbdf-4749-9d38-a83eb479fa6b",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 获取关账凭证信息"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "bf427632-091e-4f9c-b711-c9a9a1930e54",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import pymysql\n",
|
||||||
|
"from pymysql import converters, FIELD_TYPE\n",
|
||||||
|
"\n",
|
||||||
|
"conv = converters.conversions\n",
|
||||||
|
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
||||||
|
"conv[FIELD_TYPE.DATE] = str\n",
|
||||||
|
"db = pymysql.connect(host = \"172.19.0.12\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
|
"cursor = db.cursor()\n",
|
||||||
|
"\n",
|
||||||
|
"dict1 = {}\n",
|
||||||
|
"\n",
|
||||||
|
"sql = 'select name,transaction_date,remarks from `tabPeriod Closing Voucher` where company= %s and docstatus = %s'\n",
|
||||||
|
"cursor.execute(sql, ('北京运动一百体育文化发展有限公司',1))\n",
|
||||||
|
"data = cursor.fetchall()\n",
|
||||||
|
"for item in data:\n",
|
||||||
|
" print(item)"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "cfcca083-582e-430c-a2d8-bacffbe028de",
|
"id": "cfcca083-582e-430c-a2d8-bacffbe028de",
|
||||||
@@ -127,128 +160,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 73,
|
"execution_count": null,
|
||||||
"id": "8e62fbda-69b2-47f1-8bdd-e0a594b27d59",
|
"id": "8e62fbda-69b2-47f1-8bdd-e0a594b27d59",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"execution": {
|
"outputs": [],
|
||||||
"iopub.execute_input": "2025-08-24T10:56:13.901078Z",
|
|
||||||
"iopub.status.busy": "2025-08-24T10:56:13.900708Z",
|
|
||||||
"iopub.status.idle": "2025-08-24T10:56:13.923083Z",
|
|
||||||
"shell.execute_reply": "2025-08-24T10:56:13.920738Z",
|
|
||||||
"shell.execute_reply.started": "2025-08-24T10:56:13.901045Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"('ACC-JV-2025-00001-1', '2023年开账', 534627.6, 534627.6)\n",
|
|
||||||
"('ACC-JV-2025-00002-1', '计提:1月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00003', '收:1季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00004', '付:网银服务费', 100.0, 100.0)\n",
|
|
||||||
"('ACC-JV-2025-00005', '付:残联招标服务费及手续费', 204.5, 204.5)\n",
|
|
||||||
"('ACC-JV-2025-00006-1', '计提:6月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00007', '付:发放6月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00008', '付:网银服务费', 5.0, 5.0)\n",
|
|
||||||
"('ACC-JV-2025-00009', '收:2季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00010-1', '计提:7月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00011', '付:发放7月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00012-1', '计提:8月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00013', '付:发放8月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00014', '付:办公通讯服务费', 3268.0, 3268.0)\n",
|
|
||||||
"('ACC-JV-2025-00015-1', '计提:9月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00016', '付:发放9月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00017', '收入:北京海友健康档案管理费', 30000.0, 30000.0)\n",
|
|
||||||
"('ACC-JV-2025-00018', '收入:北京坤铭教育科技档案管理费', 30000.0, 30000.0)\n",
|
|
||||||
"('ACC-JV-2025-00019', '收:3季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00020-2', '计提:10月份工资', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00021', '计提:应交个人所得税', 450.0, 450.0)\n",
|
|
||||||
"('ACC-JV-2025-00022', '扣划:个人所得税', 450.0, 450.0)\n",
|
|
||||||
"('ACC-JV-2025-00023', '付:发放10月份工资', 19550.0, 19550.0)\n",
|
|
||||||
"('ACC-JV-2025-00024', '收入:服务费收入', 5500.0, 5500.0)\n",
|
|
||||||
"('ACC-JV-2025-00025', '计提:11月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00026', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00027', '付:发放11月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00028', '付:办公用房服务费', 15300.0, 15300.0)\n",
|
|
||||||
"('ACC-JV-2025-00029', '计提:12月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00030', '付:发放12月工资、扣划个人所得税', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00031', '收:4季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00032', '付:网银手续费', 5.0, 5.0)\n",
|
|
||||||
"('ACC-JV-2025-00033', '结转:2023年本年利润', 43921.48, 43921.48)\n",
|
|
||||||
"('ACC-JV-2025-00034', '计提:1月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00035', '收:个人所得税代理电子退库', 15.0, 15.0)\n",
|
|
||||||
"('ACC-JV-2025-00036', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00037', '付:发放1月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00038', '计提:2月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00039', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00040', '计提:3月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00041', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00042', '收入:北京海友健康管理档案管理费', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00043', '收入:北京海友健康管理体质检测服务费', 53830.0, 53830.0)\n",
|
|
||||||
"('ACC-JV-2025-00044', '付:发放计提未发放工资', 29700.0, 29700.0)\n",
|
|
||||||
"('ACC-JV-2025-00045', '收:2季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00046', '计提:4月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00047', '付:网银服务费', 100.0, 100.0)\n",
|
|
||||||
"('ACC-JV-2025-00048', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00049', '付:发放4月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00050', '收入:北京海友健康管理体质检测服务费', 77270.0, 77270.0)\n",
|
|
||||||
"('ACC-JV-2025-00051', '付:归还法人其他应付款', 40000.0, 40000.0)\n",
|
|
||||||
"('ACC-JV-2025-00052', '计提:5月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00053', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00054', '付:发放5月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00055', '计提:6月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00056', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00057', '付:发放6月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00058', '收:2季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00059', '付:网银服务费', 5.0, 5.0)\n",
|
|
||||||
"('ACC-JV-2025-00060', '计提:7月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00061', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00062', '付:发放7月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00063', '计提:8月份工资', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00064', '付:发放8月份工资,扣划个人所得税', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00065', '收:3季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00066', '计提:10月份工资', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00067-1', '付:发放10月工资(部分),扣划个人所得税', 11000.0, 11000.0)\n",
|
|
||||||
"('ACC-JV-2025-00068', '计提:11月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00069', '收入:北体武术运营管理公司专家服务费', 60000.0, 60000.0)\n",
|
|
||||||
"('ACC-JV-2025-00070', '扣划:应交个人所得税', 500.0, 500.0)\n",
|
|
||||||
"('ACC-JV-2025-00071', '付:发放10、11月工资', 18500.0, 18500.0)\n",
|
|
||||||
"('ACC-JV-2025-00072', '计提:12月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00073', '扣划:应交个人所得税', 500.0, 500.0)\n",
|
|
||||||
"('ACC-JV-2025-00074', '付:发放12月工资', 9500.0, 9500.0)\n",
|
|
||||||
"('ACC-JV-2025-00075-1', '收:4季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00076', '付:网银手续费', 5.0, 5.0)\n",
|
|
||||||
"('ACC-JV-2025-00077-2', '收入:中国石油国际勘探开发公司培训费', 35000.0, 35000.0)\n",
|
|
||||||
"('ACC-JV-2025-00078', '转:增值税减免转营业外收入', 3085.15, 3085.15)\n",
|
|
||||||
"('ACC-JV-2025-00079-1', '转:结转2024年度本年利润', 116723.63, 116723.63)\n",
|
|
||||||
"('ACC-JV-2025-00080', '计提:1月份工资', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00081', '付:发放1月份工资,扣划个人所得税', 20000.0, 20000.0)\n",
|
|
||||||
"('ACC-JV-2025-00082', '计提:2月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00083', '付:发放2月份工资,扣划个人所得税', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00084', '计提:3月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00085', '扣划:应交个人所得税', 150.0, 150.0)\n",
|
|
||||||
"('ACC-JV-2025-00086', '付:发放3月份工资', 9850.0, 9850.0)\n",
|
|
||||||
"('ACC-JV-2025-00087', '应收:北京新越公益基金会培训费', 2000.0, 2000.0)\n",
|
|
||||||
"('ACC-JV-2025-00088', '收:1季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00089', '收:北京新越公益基金会应收款', 2000.0, 2000.0)\n",
|
|
||||||
"('ACC-JV-2025-00090', '付:网银手续费', 100.0, 100.0)\n",
|
|
||||||
"('ACC-JV-2025-00091', '计提:4月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00092', '付:发放4月份工资,扣划个人所得税', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00093', '计提:5月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00094', '付:发放5月份工资,扣划个人所得税', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00095', '收入:中国石油国际勘探开发公司培训费', 34000.0, 34000.0)\n",
|
|
||||||
"('ACC-JV-2025-00096', '收入:北京海友健康管理公司服务费', 81610.0, 81610.0)\n",
|
|
||||||
"('ACC-JV-2025-00097', '计提:6月份工资', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00098', '付:发放6月份工资,扣划个人所得税', 10000.0, 10000.0)\n",
|
|
||||||
"('ACC-JV-2025-00099', '收:2季度银行存款利息', 0.0, 0.0)\n",
|
|
||||||
"('ACC-JV-2025-00100', '付:网银手续费', 5.0, 5.0)\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.12\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
"cursor = db.cursor()\n",
|
"cursor = db.cursor()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -269,33 +187,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 76,
|
"execution_count": null,
|
||||||
"id": "489a83ab-4f5e-402a-abe2-4458acb414f4",
|
"id": "489a83ab-4f5e-402a-abe2-4458acb414f4",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"execution": {
|
"outputs": [],
|
||||||
"iopub.execute_input": "2025-08-24T11:05:01.364050Z",
|
|
||||||
"iopub.status.busy": "2025-08-24T11:05:01.363771Z",
|
|
||||||
"iopub.status.idle": "2025-08-24T11:05:01.370341Z",
|
|
||||||
"shell.execute_reply": "2025-08-24T11:05:01.369803Z",
|
|
||||||
"shell.execute_reply.started": "2025-08-24T11:05:01.364026Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"('ACC-JV-2025-00099', '100201 - 银行存款 - 运动一百', 11.56, 0.0, '')\n",
|
|
||||||
"('ACC-JV-2025-00099', '560301 - 利息费用 - 运动一百', -11.56, 0.0, None)\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"from pymysql import converters, FIELD_TYPE\n",
|
"from pymysql import converters, FIELD_TYPE\n",
|
||||||
"\n",
|
"\n",
|
||||||
"conv = converters.conversions\n",
|
"conv = converters.conversions\n",
|
||||||
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
||||||
|
"conv[FIELD_TYPE.DATE] = str\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
"cursor = db.cursor()\n",
|
"cursor = db.cursor()\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -317,95 +219,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 74,
|
"execution_count": null,
|
||||||
"id": "02129d62-ea3e-4492-89d0-bb023f746ff4",
|
"id": "02129d62-ea3e-4492-89d0-bb023f746ff4",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"execution": {
|
"outputs": [],
|
||||||
"iopub.execute_input": "2025-08-24T10:58:22.279830Z",
|
|
||||||
"iopub.status.busy": "2025-08-24T10:58:22.279052Z",
|
|
||||||
"iopub.status.idle": "2025-08-24T10:58:22.306848Z",
|
|
||||||
"shell.execute_reply": "2025-08-24T10:58:22.304482Z",
|
|
||||||
"shell.execute_reply.started": "2025-08-24T10:58:22.279762Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"('ACC-GLE-2025-00338', '100201 - 银行存款 - 运动一百', '', 'ACC-JV-2025-00075', 10.99, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00339', '560301 - 利息费用 - 运动一百', None, 'ACC-JV-2025-00075', 0.0, 10.99)\n",
|
|
||||||
"('ACC-GLE-2025-00345', '100201 - 银行存款 - 运动一百', '', 'ACC-JV-2025-00075', 0.0, 10.99)\n",
|
|
||||||
"('ACC-GLE-2025-00346', '560301 - 利息费用 - 运动一百', None, 'ACC-JV-2025-00075', 0.0, -10.99)\n",
|
|
||||||
"('ACC-GLE-2025-00424', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00080', 20000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00425', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00080', 0.0, 18500.0)\n",
|
|
||||||
"('ACC-GLE-2025-00426', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00080', 0.0, 1500.0)\n",
|
|
||||||
"('ACC-GLE-2025-00427', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00081', 18500.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00428', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00081', 1500.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00429', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00081', 0.0, 20000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00430', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00082', 10000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00431', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00082', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00432', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00082', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00433', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00083', 9850.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00434', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00083', 150.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00435', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00083', 0.0, 10000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00436', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00084', 10000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00437', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00084', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00438', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00084', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00439', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00086', 9850.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00440', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百', 'ACC-JV-2025-00086', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00441', '600102 - 培训费 - 运动一百', '112210 - 北京新越公益基金会 - 运动一百', 'ACC-JV-2025-00087', 0.0, 1980.2)\n",
|
|
||||||
"('ACC-GLE-2025-00442', '222101 - 应交增值税 - 运动一百', '112210 - 北京新越公益基金会 - 运动一百', 'ACC-JV-2025-00087', 0.0, 19.8)\n",
|
|
||||||
"('ACC-GLE-2025-00443', '112210 - 北京新越公益基金会 - 运动一百', '222101 - 应交增值税 - 运动一百, 600102 - 培训费 - 运动一百', 'ACC-JV-2025-00087', 2000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00444', '100201 - 银行存款 - 运动一百', '', 'ACC-JV-2025-00088', 15.19, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00445', '560301 - 利息费用 - 运动一百', None, 'ACC-JV-2025-00088', 0.0, 15.19)\n",
|
|
||||||
"('ACC-GLE-2025-00446', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00085', 150.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00447', '100201 - 银行存款 - 运动一百', '222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00085', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00448', '560101 - 工资 - 运动一百', None, 'ACC-PCV-2025-00009', 0.0, 40000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00449', '560301 - 利息费用 - 运动一百', None, 'ACC-PCV-2025-00009', 15.19, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00450', '600102 - 培训费 - 运动一百', None, 'ACC-PCV-2025-00009', 1980.2, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00451', '4103 - 本年利润 - 运动一百', None, 'ACC-PCV-2025-00009', 38004.61, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00452', '100201 - 银行存款 - 运动一百', '112210 - 北京新越公益基金会 - 运动一百', 'ACC-JV-2025-00089', 2000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00453', '112210 - 北京新越公益基金会 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00089', 0.0, 2000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00454', '560302 - 手续费 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00090', 100.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00455', '100201 - 银行存款 - 运动一百', '560302 - 手续费 - 运动一百', 'ACC-JV-2025-00090', 0.0, 100.0)\n",
|
|
||||||
"('ACC-GLE-2025-00456', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00091', 10000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00457', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00091', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00458', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00091', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00459', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00092', 9850.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00460', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00092', 150.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00461', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00092', 0.0, 10000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00462', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00093', 10000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00463', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00093', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00464', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00093', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00465', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00094', 9850.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00466', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00094', 150.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00467', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00094', 0.0, 10000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00468', '600102 - 培训费 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00095', 0.0, 33663.37)\n",
|
|
||||||
"('ACC-GLE-2025-00469', '222101 - 应交增值税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00095', 0.0, 336.63)\n",
|
|
||||||
"('ACC-GLE-2025-00470', '100201 - 银行存款 - 运动一百', '222101 - 应交增值税 - 运动一百, 600102 - 培训费 - 运动一百', 'ACC-JV-2025-00095', 34000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00471', '600101 - 服务费 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00096', 0.0, 80801.98)\n",
|
|
||||||
"('ACC-GLE-2025-00472', '222101 - 应交增值税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00096', 0.0, 808.02)\n",
|
|
||||||
"('ACC-GLE-2025-00473', '100201 - 银行存款 - 运动一百', '222101 - 应交增值税 - 运动一百, 600101 - 服务费 - 运动一百', 'ACC-JV-2025-00096', 81610.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00474', '560101 - 工资 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00097', 10000.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00475', '221101 - 工资 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00097', 0.0, 9850.0)\n",
|
|
||||||
"('ACC-GLE-2025-00476', '222112 - 应交个人所得税 - 运动一百', '560101 - 工资 - 运动一百', 'ACC-JV-2025-00097', 0.0, 150.0)\n",
|
|
||||||
"('ACC-GLE-2025-00477', '221101 - 工资 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00098', 9850.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00478', '222112 - 应交个人所得税 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00098', 150.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00479', '100201 - 银行存款 - 运动一百', '221101 - 工资 - 运动一百, 222112 - 应交个人所得税 - 运动一百', 'ACC-JV-2025-00098', 0.0, 10000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00480', '560302 - 手续费 - 运动一百', '100201 - 银行存款 - 运动一百', 'ACC-JV-2025-00100', 5.0, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00481', '100201 - 银行存款 - 运动一百', '560302 - 手续费 - 运动一百', 'ACC-JV-2025-00100', 0.0, 5.0)\n",
|
|
||||||
"('ACC-GLE-2025-00482', '100201 - 银行存款 - 运动一百', '', 'ACC-JV-2025-00099', 11.56, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00483', '560301 - 利息费用 - 运动一百', None, 'ACC-JV-2025-00099', 0.0, 11.56)\n",
|
|
||||||
"('ACC-GLE-2025-00484', '560302 - 手续费 - 运动一百', None, 'ACC-PCV-2025-00010', 0.0, 105.0)\n",
|
|
||||||
"('ACC-GLE-2025-00485', '560101 - 工资 - 运动一百', None, 'ACC-PCV-2025-00010', 0.0, 30000.0)\n",
|
|
||||||
"('ACC-GLE-2025-00486', '600102 - 培训费 - 运动一百', None, 'ACC-PCV-2025-00010', 33663.37, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00487', '600101 - 服务费 - 运动一百', None, 'ACC-PCV-2025-00010', 80801.98, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00488', '560301 - 利息费用 - 运动一百', None, 'ACC-PCV-2025-00010', 11.56, 0.0)\n",
|
|
||||||
"('ACC-GLE-2025-00489', '4103 - 本年利润 - 运动一百', None, 'ACC-PCV-2025-00010', 0.0, 84371.91)\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
"from pymysql import converters, FIELD_TYPE\n",
|
"from pymysql import converters, FIELD_TYPE\n",
|
||||||
@@ -426,26 +243,39 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "9607f40c-e393-4e04-81b4-4cf309a8cee2",
|
"id": "638cd779-7234-4445-b45e-cd6a2308f082",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import pymysql\n",
|
||||||
|
"from pymysql import converters, FIELD_TYPE\n",
|
||||||
|
"\n",
|
||||||
|
"conv = converters.conversions\n",
|
||||||
|
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
||||||
|
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
|
"cursor = db.cursor()\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"sql = 'select name,account,against,voucher_no,debit,credit from `tabGL Entry` where fiscal_year = %s and voucher_no = %s'\n",
|
||||||
|
"cursor.execute(sql, ('2025','ACC-PCV-2025-00010'))\n",
|
||||||
|
"data = cursor.fetchall()\n",
|
||||||
|
"for item in data:\n",
|
||||||
|
" print(item)\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "b349b31d-6dd3-489a-a3b0-c06f5100eb87",
|
||||||
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## 使用模板生成凭证"
|
"## 使用模板生成凭证"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 72,
|
"execution_count": null,
|
||||||
"id": "5a5828c7-9679-4694-9f4e-357ea71a5618",
|
"id": "5a5828c7-9679-4694-9f4e-357ea71a5618",
|
||||||
"metadata": {
|
"metadata": {},
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2025-08-24T10:30:09.127710Z",
|
|
||||||
"iopub.status.busy": "2025-08-24T10:30:09.127415Z",
|
|
||||||
"iopub.status.idle": "2025-08-24T10:30:09.172276Z",
|
|
||||||
"shell.execute_reply": "2025-08-24T10:30:09.171346Z",
|
|
||||||
"shell.execute_reply.started": "2025-08-24T10:30:09.127685Z"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pymysql\n",
|
"import pymysql\n",
|
||||||
@@ -453,6 +283,54 @@
|
|||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"from docxtpl import DocxTemplate,InlineImage\n",
|
"from docxtpl import DocxTemplate,InlineImage\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"def num_to_rmb(num):\n",
|
||||||
|
" # 定义中文数字和单位\n",
|
||||||
|
" digits = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']\n",
|
||||||
|
" units = ['', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿', '拾', '佰', '仟']\n",
|
||||||
|
" dec_units = ['角', '分']\n",
|
||||||
|
" # 分离整数和小数部分\n",
|
||||||
|
" integer_part = int(num)\n",
|
||||||
|
" decimal_part = round((num - integer_part) * 100) # 保留两位小数\n",
|
||||||
|
" # 处理整数部分\n",
|
||||||
|
" if integer_part == 0:\n",
|
||||||
|
" result = '零元'\n",
|
||||||
|
" else:\n",
|
||||||
|
" integer_str = str(integer_part)\n",
|
||||||
|
" result = ''\n",
|
||||||
|
" zero_flag = False # 标记是否需要添加零\n",
|
||||||
|
" \n",
|
||||||
|
" for i in range(len(integer_str)):\n",
|
||||||
|
" digit = int(integer_str[i])\n",
|
||||||
|
" pos = len(integer_str) - i - 1 # 当前位置的权值\n",
|
||||||
|
" \n",
|
||||||
|
" if digit == 0:\n",
|
||||||
|
" zero_flag = True\n",
|
||||||
|
" else:\n",
|
||||||
|
" if zero_flag:\n",
|
||||||
|
" result += '零'\n",
|
||||||
|
" zero_flag = False\n",
|
||||||
|
" result += digits[digit] + units[pos]\n",
|
||||||
|
" \n",
|
||||||
|
" result += '元' \n",
|
||||||
|
" # 处理小数部分\n",
|
||||||
|
" if decimal_part == 0:\n",
|
||||||
|
" result += '整'\n",
|
||||||
|
" else:\n",
|
||||||
|
" jiao = decimal_part // 10\n",
|
||||||
|
" fen = decimal_part % 10\n",
|
||||||
|
" \n",
|
||||||
|
" if jiao > 0:\n",
|
||||||
|
" result += digits[jiao] + dec_units[0]\n",
|
||||||
|
" elif integer_part > 0:\n",
|
||||||
|
" result += '零'\n",
|
||||||
|
" \n",
|
||||||
|
" if fen > 0:\n",
|
||||||
|
" result += digits[fen] + dec_units[1] \n",
|
||||||
|
" # 特殊情况:\"壹拾\"开头的处理\n",
|
||||||
|
" if result.startswith('壹拾'):\n",
|
||||||
|
" result = result[1:] \n",
|
||||||
|
" return '人民币' + result\n",
|
||||||
|
"\n",
|
||||||
"conv = converters.conversions\n",
|
"conv = converters.conversions\n",
|
||||||
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
"conv[FIELD_TYPE.NEWDECIMAL] = float\n",
|
||||||
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
"db = pymysql.connect(host = \"172.19.0.10\",user = \"songyi\",password = \"yylzs\",database = \"_5e5899d8398b5f7b\" )\n",
|
||||||
@@ -490,10 +368,58 @@
|
|||||||
"tpl.save('data/test1.docx')"
|
"tpl.save('data/test1.docx')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6f64acab-3580-4a4e-87c2-013df2c36d35",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 连接postgresql"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 11,
|
||||||
|
"id": "d2b44be1-f5a3-4a88-8a43-c99e2aea9924",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2025-11-08T12:16:08.709098Z",
|
||||||
|
"iopub.status.busy": "2025-11-08T12:16:08.708834Z",
|
||||||
|
"iopub.status.idle": "2025-11-08T12:16:08.734946Z",
|
||||||
|
"shell.execute_reply": "2025-11-08T12:16:08.734287Z",
|
||||||
|
"shell.execute_reply.started": "2025-11-08T12:16:08.709077Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"[(None,)]\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import psycopg2\n",
|
||||||
|
"\n",
|
||||||
|
"# 建立数据库连接\n",
|
||||||
|
"conn = psycopg2.connect(\n",
|
||||||
|
"database=\"directus\",\n",
|
||||||
|
"user=\"mydata\",\n",
|
||||||
|
"password=\"songyi\",\n",
|
||||||
|
"host=\"127.0.0.1\",\n",
|
||||||
|
"port=\"5432\"\n",
|
||||||
|
")\n",
|
||||||
|
"cur = conn.cursor()\n",
|
||||||
|
"cur.execute(\"SELECT person ->'name' as name FROM tice_event\")\n",
|
||||||
|
"rows = cur.fetchall()\n",
|
||||||
|
"print(rows)\n",
|
||||||
|
"conn.close()"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "1a8d4bd0-8242-48c4-947c-fd0ec872207c",
|
"id": "a370a1aa-3f2c-48dc-b482-936bfd6b29ac",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
|||||||
Reference in new issue
Block a user