From 2464be8c844ad413d786e25b8ee8d4e2eb759f3c Mon Sep 17 00:00:00 2001 From: CRM8000 Date: Thu, 7 Nov 2024 14:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E8=B4=A6=E5=87=AD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SLN0002/DAO/VoucherDAO.class.php | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/web/Application/SLN0002/DAO/VoucherDAO.class.php b/web/Application/SLN0002/DAO/VoucherDAO.class.php index 21c36161..5e5dfaf2 100644 --- a/web/Application/SLN0002/DAO/VoucherDAO.class.php +++ b/web/Application/SLN0002/DAO/VoucherDAO.class.php @@ -71,8 +71,42 @@ class VoucherDAO extends PSIBaseExDAO */ function queryFmtEx($params) { - // TODO + $db = $this->db; - return []; + $companyId = $params["companyId"]; + $subjectCode = $params["subjectCode"]; + + $result = []; + + $sql = "select id + from t_acc_fmt + where company_id = '%s' and subject = '%s' "; + $data = $db->query($sql, $companyId, $subjectCode); + if (!$data) { + return $result; + } + + $fmtId = $data[0]["id"]; + + $sql = "select db_field_name, caption, voucher_input, + code_table_name, code_table_field_name, code_table_field_name_fk, + lookup_field_name + from t_acc_fmt_cols + where fmt_id = '%s' and sys_col = 0 + order by voucher_input_show_order "; + $data = $db->query($sql, $fmtId); + foreach ($data as $v) { + $result[] = [ + "dbFieldName" => $v["db_field_name"], + "caption" => $v["caption"], + "voucherInput" => $v["voucher_input"], + "codeTableName" => $v["code_table_name"], + "codeTableFieldName" => $v["code_table_field_name"], + "codeTableFieldNameFK" => $v["code_table_field_name_fk"], + "lookupFieldName" => $v["lookup_field_name"], + ]; + } + + return $result; } }