From: newton-cn Date: Thu, 24 Apr 2025 05:52:50 +0000 (+0900) Subject: t X-Git-Url: https://git.insang.kr/gitweb/?a=commitdiff_plain;h=6e1cd9c770356fcc15e0d781e9987f7554cbe4c1;p=wevape-lu1_pos.git t --- diff --git a/.vs/newton-cn/v16/.suo b/.vs/newton-cn/v16/.suo index 6740bf6..71801c8 100644 Binary files a/.vs/newton-cn/v16/.suo and b/.vs/newton-cn/v16/.suo differ diff --git a/newton-cn/DBConnector.cs b/newton-cn/DBConnector.cs index 031ed1c..6f321e6 100644 --- a/newton-cn/DBConnector.cs +++ b/newton-cn/DBConnector.cs @@ -86,60 +86,62 @@ namespace newton_cn string sql = ""; sql += @" select - CONVERT(CHAR(19), a1.ps_date, 20) as ps_date, a2.ct_code, a2.ct_name+'('+a5.ct_phone+')' as ct_name, a1.ps_prname, cast(a1.ps_qty as int) ps_qty, - cast( - a1.ps_up - + - case when ( - isnull( - ( - isnull((select sum(ps_up * ps_qty) from ps where pe_id= a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code= '1100') and ps_prcode not in (select pr_code from pr where kind_code= '1099')), 0) - + - ( - select - sum(ps_up * ps_qty)/(select count(pe_id) from ps where pe_id= a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code= '1100') and ps_prcode in (select pr_code from pr where kind_code= '1099')) - from - ps - where - ps_prcode in (select pr_code from pr where kind_code= '1100') and pe_id= a1.pe_id - ) - ) - , 0) - ) < 0 then - isnull( - ( - isnull((select sum(ps_up * ps_qty) from ps where pe_id= a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code= '1100') and ps_prcode not in (select pr_code from pr where kind_code= '1099')), 0) - + - ( - select - sum(ps_up * ps_qty)/(select count(pe_id) from ps where pe_id= a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code= '1100') and ps_prcode in (select pr_code from pr where kind_code= '1099')) - from - ps - where - ps_prcode in (select pr_code from pr where kind_code= '1100') and pe_id= a1.pe_id - ) - ) - , 0) else - 0 end - as int) as pe_bamt, - a1.pe_id, a1.ps_no, isnull(a3.is_earn, 0) as is_earn + CONVERT(CHAR(19), a1.ps_date, 20) as ps_date, + a2.ct_code, + a2.ct_name + '(' + a5.ct_phone + ')' as ct_name, + a1.ps_prname, + cast(a1.ps_qty as int) ps_qty, + cast( + a1.ps_up + + + case when ( + isnull( + ( + isnull((select sum(ps_up * ps_qty) from ps where pe_id = a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code = '1100') and ps_prcode not in (select pr_code from pr where kind_code in ('1099', '1105', '1106', '1107', '1108'))), 0) + + + ( + select + sum(ps_up * ps_qty) / (select count(pe_id) from ps where pe_id = a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code = '1100') and ps_prcode in (select pr_code from pr where kind_code in ('1099', '1105', '1106', '1107', '1108'))) + from + ps + where + ps_prcode in (select pr_code from pr where kind_code = '1100') and pe_id = a1.pe_id + ) + ) + , 0) + ) < 0 then + isnull( + ( + isnull((select sum(ps_up * ps_qty) from ps where pe_id = a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code = '1100') and ps_prcode not in (select pr_code from pr where kind_code in ('1099', '1105', '1106', '1107', '1108'))), 0) + + + ( + select + sum(ps_up * ps_qty) / (select count(pe_id) from ps where pe_id = a1.pe_id and ps_prcode not in (select pr_code from pr where kind_code = '1100') and ps_prcode in (select pr_code from pr where kind_code in ('1099', '1105', '1106', '1107', '1108'))) + from + ps + where + ps_prcode in (select pr_code from pr where kind_code = '1100') and pe_id = a1.pe_id + ) + ) + , 0) else + 0 end + as int) as pe_bamt, + a1.pe_id, + a1.ps_no, + isnull(a3.is_earn, 0) as is_earn from - ps a1 - join pe a2 - on a1.pe_id= a2.pe_id and a2.ct_code != '' - left join disposable_earn_point_status a3 - on a3.pe_id= a1.pe_id and a3.ps_no= a1.ps_no - join ac a4 - on a4.pe_id= a1.pe_id and a4.ac_fncd2 not in ('01', '00') - join ct a5 - on a5.ct_code= a2.ct_code + ps a1 + join pe a2 on a1.pe_id = a2.pe_id and a2.ct_code != '' + left join disposable_earn_point_status a3 on a3.pe_id = a1.pe_id and a3.ps_no = a1.ps_no + join ac a4 on a4.pe_id = a1.pe_id and a4.ac_fncd2 not in ('01', '00') + join ct a5 on a5.ct_code = a2.ct_code where - a1.ps_prcode in ( - select pr_code from pr where kind_code= '1099' - ) - and a1.ps_date between '" + selected + @"' and dateadd(day, 1, '" + selected + @"') + a1.ps_prcode in ( + select pr_code from pr where kind_code in ('1099', '1105', '1106', '1107', '1108') + ) + and a1.ps_date between '" + selected + @"' and dateadd(day, 1, '" + selected + @"') order by - a1.pe_id desc + a1.pe_id desc "; SqlCommand cmd_select = new SqlCommand(sql, conn); diff --git a/newton-cn/bin/Release/newton-cn.exe b/newton-cn/bin/Release/newton-cn.exe index 1c46f40..7de6975 100644 Binary files a/newton-cn/bin/Release/newton-cn.exe and b/newton-cn/bin/Release/newton-cn.exe differ diff --git a/newton-cn/bin/Release/newton-cn.pdb b/newton-cn/bin/Release/newton-cn.pdb index 2b9c7d8..e671505 100644 Binary files a/newton-cn/bin/Release/newton-cn.pdb and b/newton-cn/bin/Release/newton-cn.pdb differ diff --git a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 2057510..0d1b7db 100644 Binary files a/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/newton-cn/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/newton-cn/obj/Release/newton-cn.exe b/newton-cn/obj/Release/newton-cn.exe index 1c46f40..7de6975 100644 Binary files a/newton-cn/obj/Release/newton-cn.exe and b/newton-cn/obj/Release/newton-cn.exe differ diff --git a/newton-cn/obj/Release/newton-cn.pdb b/newton-cn/obj/Release/newton-cn.pdb index 2b9c7d8..e671505 100644 Binary files a/newton-cn/obj/Release/newton-cn.pdb and b/newton-cn/obj/Release/newton-cn.pdb differ