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; } }