@ -63,7 +63,7 @@ namespace DSWeb.MvcShipping.Controllers
if ( ! string . IsNullOrEmpty ( strDa ) )
if ( ! string . IsNullOrEmpty ( strDa ) )
{
{
strDa = strDa . Replace ( "B." , "" ) ;
strDa = strDa . Replace ( "B." , "" ) ;
if ( ! string . IsNullOrEmpty ( condition ) )
if ( ! string . IsNullOrEmpty ( condition ) )
{
{
condition = condition + " and " + strDa ;
condition = condition + " and " + strDa ;
@ -270,7 +270,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ",SUM(G.NOACCTAXRMBDR) NOACCTAXRMBDR,SUM(G.NOACCTAXRMBCR) NOACCTAXRMBCR,SUM(G.NOACCTAXUSDDR) NOACCTAXUSDDR,SUM(G.NOACCTAXUSDCR) NOACCTAXUSDCR,SUM(G.NOACCTAXOTDR) NOACCTAXOTDR" ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR) NOACCTAXRMBDR,SUM(G.NOACCTAXRMBCR) NOACCTAXRMBCR,SUM(G.NOACCTAXUSDDR) NOACCTAXUSDDR,SUM(G.NOACCTAXUSDCR) NOACCTAXUSDCR,SUM(G.NOACCTAXOTDR) NOACCTAXOTDR" ) ;
strSql . Append ( ",SUM(G.NOACCTAXOTCR) NOACCTAXOTCR,SUM(G.NOACCTAXTTLDR) NOACCTAXTTLDR,SUM(G.NOACCTAXTTLCR) NOACCTAXTTLCR,SUM(G.NOACCTAXUSDDR-G.NOACCTAXUSDCR) AS NOACCTAXUSDPROFIT" ) ;
strSql . Append ( ",SUM(G.NOACCTAXOTCR) NOACCTAXOTCR,SUM(G.NOACCTAXTTLDR) NOACCTAXTTLDR,SUM(G.NOACCTAXTTLCR) NOACCTAXTTLCR,SUM(G.NOACCTAXUSDDR-G.NOACCTAXUSDCR) AS NOACCTAXUSDPROFIT" ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR-G.NOACCTAXRMBCR) AS NOACCTAXRMBPROFIT,SUM(G.NOACCTAXOTDR-G.NOACCTAXOTCR) AS NOACCTAXOTPROFIT,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT " ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR-G.NOACCTAXRMBCR) AS NOACCTAXRMBPROFIT,SUM(G.NOACCTAXOTDR-G.NOACCTAXOTCR) AS NOACCTAXOTPROFIT,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT " ) ;
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=A.BSNO) " ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=A.BSNO) " ) ;
@ -283,7 +283,7 @@ namespace DSWeb.MvcShipping.Controllers
else
else
{
{
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=A.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=A.BSNO) " ) ;
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=A.BSNO) ");
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=A.BSNO) ");
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
@ -355,11 +355,11 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ",SUM(G.NOACCTAXRMBDR) NOACCTAXRMBDR,SUM(G.NOACCTAXRMBCR) NOACCTAXRMBCR,SUM(G.NOACCTAXUSDDR) NOACCTAXUSDDR,SUM(G.NOACCTAXUSDCR) NOACCTAXUSDCR,SUM(G.NOACCTAXOTDR) NOACCTAXOTDR" ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR) NOACCTAXRMBDR,SUM(G.NOACCTAXRMBCR) NOACCTAXRMBCR,SUM(G.NOACCTAXUSDDR) NOACCTAXUSDDR,SUM(G.NOACCTAXUSDCR) NOACCTAXUSDCR,SUM(G.NOACCTAXOTDR) NOACCTAXOTDR" ) ;
strSql . Append ( ",SUM(G.NOACCTAXOTCR) NOACCTAXOTCR,SUM(G.NOACCTAXTTLDR) NOACCTAXTTLDR,SUM(G.NOACCTAXTTLCR) NOACCTAXTTLCR,SUM(G.NOACCTAXUSDDR-G.NOACCTAXUSDCR) AS NOACCTAXUSDPROFIT" ) ;
strSql . Append ( ",SUM(G.NOACCTAXOTCR) NOACCTAXOTCR,SUM(G.NOACCTAXTTLDR) NOACCTAXTTLDR,SUM(G.NOACCTAXTTLCR) NOACCTAXTTLCR,SUM(G.NOACCTAXUSDDR-G.NOACCTAXUSDCR) AS NOACCTAXUSDPROFIT" ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR-G.NOACCTAXRMBCR) AS NOACCTAXRMBPROFIT,SUM(G.NOACCTAXOTDR-G.NOACCTAXOTCR) AS NOACCTAXOTPROFIT,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT " ) ;
strSql . Append ( ",SUM(G.NOACCTAXRMBDR-G.NOACCTAXRMBCR) AS NOACCTAXRMBPROFIT,SUM(G.NOACCTAXOTDR-G.NOACCTAXOTCR) AS NOACCTAXOTPROFIT,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT " ) ;
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=B.BSNO) " ) ;
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " WHERE ISNULL(G.BSNO,'')<>'' " ) ;
strSql . Append ( " WHERE ISNULL(G.BSNO,'')<>'' " ) ;
@ -367,7 +367,7 @@ namespace DSWeb.MvcShipping.Controllers
else
else
{
{
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
@ -603,7 +603,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -620,7 +620,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " FROM v_op_gain_sum_INV G" ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( " Where " + feecondition ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "GROUP BY BSNO) G ON (G.BSNO=B.BSNO) " ) ;
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " WHERE ISNULL(G.BSNO,'')<>'' " ) ;
strSql . Append ( " WHERE ISNULL(G.BSNO,'')<>'' " ) ;
@ -628,7 +628,7 @@ namespace DSWeb.MvcShipping.Controllers
else
else
{
{
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
// strSql.Append("LEFT JOIN OP_CLOSE CL ON (CL.BSNO=B.BSNO) ");
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " LEFT JOIN info_client C ON (C.SHORTNAME=B.CUSTOMERNAME) " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
@ -847,7 +847,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
@ -1083,7 +1083,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT");
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -1317,7 +1317,7 @@ namespace DSWeb.MvcShipping.Controllers
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -1553,7 +1553,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.SALE) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.SALE) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
@ -1619,7 +1619,7 @@ namespace DSWeb.MvcShipping.Controllers
var sortstring = DatasetSort . Getsortstring ( sort ) ;
var sortstring = DatasetSort . Getsortstring ( sort ) ;
if ( ! string . IsNullOrEmpty ( sortstring ) )
if ( ! string . IsNullOrEmpty ( sortstring ) )
{
{
// sortstring = sortstring.Replace("SALEDEPT", "U.DEPTNAME");
// sortstring = sortstring.Replace("SALEDEPT", "U.DEPTNAME");
strSql . Append ( " order by " + sortstring ) ;
strSql . Append ( " order by " + sortstring ) ;
}
}
else
else
@ -1791,7 +1791,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -1825,11 +1825,11 @@ namespace DSWeb.MvcShipping.Controllers
}
}
if ( OPRPTONLYOP . PARAMVALUE = = "1" )
if ( OPRPTONLYOP . PARAMVALUE = = "1" )
{
{
strSql . Append ( " Group by B.OP ") ;
strSql . Append ( " Group by B.OP ,OP_SEAE.ORDEROP ") ;
}
}
else
else
{
{
strSql . Append ( " Group by B.OP, B.BSTYPE ") ;
strSql . Append ( " Group by B.OP, B.BSTYPE ,OP_SEAE.ORDEROP ") ;
}
}
@ -1847,7 +1847,8 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( " order by B.OP" ) ;
strSql . Append ( " order by B.OP" ) ;
}
}
else {
else
{
strSql . Append ( " order by B.OP, B.BSTYPE" ) ;
strSql . Append ( " order by B.OP, B.BSTYPE" ) ;
@ -1965,9 +1966,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
@ -2034,10 +2033,7 @@ namespace DSWeb.MvcShipping.Controllers
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) " ) ;
strSql . Append ( " LEFT JOIN VW_user U ON (U.SHOWNAME=B.OP) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -2193,9 +2189,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -2260,9 +2254,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -2417,9 +2409,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -2482,10 +2472,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -2638,9 +2625,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -2706,10 +2691,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -2864,9 +2846,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -2929,10 +2909,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -3085,9 +3062,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -3150,10 +3125,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
else
else
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -3374,7 +3346,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -3591,7 +3563,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -3819,7 +3791,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS NOACCTAXTTLPROFIT");
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -4037,7 +4009,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( ", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -4320,7 +4292,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
{
@ -4449,7 +4421,7 @@ namespace DSWeb.MvcShipping.Controllers
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
// strSql.Append(",SUM(G.NOACCTAXTTLDR) AS TTLACCTAXDR,SUM(G.NOACCTAXTTLCR) AS TTLACCTAXCR,SUM(G.NOACCTAXTTLDR-G.NOACCTAXTTLCR) AS TTLACCTAXPROFIT");
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
@ -4524,7 +4496,7 @@ namespace DSWeb.MvcShipping.Controllers
}
}
}
}
public ContentResult BsParentListData ( string condition , string sort )
public ContentResult BsParentListData ( string condition , string sort )
{
{
var strSql = new StringBuilder ( ) ;
var strSql = new StringBuilder ( ) ;
@ -4532,7 +4504,7 @@ namespace DSWeb.MvcShipping.Controllers
strSql . Append ( "SELECT B.BSNO,B.MBLNO,B.OPTYPE, B.CUSTNO,B.ACCDATE,G.TTLDR-G.TTLCR TTLPROFIT" ) ;
strSql . Append ( "SELECT B.BSNO,B.MBLNO,B.OPTYPE, B.CUSTNO,B.ACCDATE,G.TTLDR-G.TTLCR TTLPROFIT" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( "LEFT JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( " WHERE 1=1 " ) ;
strSql . Append ( " WHERE 1=1 " ) ;