@ -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 ( ",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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -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 ( ",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) " ) ;
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 ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
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" ) ;
@ -1317,7 +1317,7 @@ namespace DSWeb.MvcShipping.Controllers
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 ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
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" ) ;
@ -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 ( ",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 VW_user U ON (U.SHOWNAME=B.SALE) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
@ -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 ( ",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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -1825,11 +1825,11 @@ namespace DSWeb.MvcShipping.Controllers
}
if ( OPRPTONLYOP . PARAMVALUE = = "1" )
{
strSql . Append ( " Group by B.OP ") ;
strSql . Append ( " Group by B.OP ,OP_SEAE.ORDEROP ") ;
}
else
{
strSql . Append ( " Group by B.OP, B.BSTYPE ") ;
strSql . Append ( " Group by B.OP, B.BSTYPE ,OP_SEAE.ORDEROP ") ;
}
@ -1965,9 +1965,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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 V_OP_BILL A ON (A.PARENTID=B.BSNO) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
@ -2034,10 +2032,7 @@ namespace DSWeb.MvcShipping.Controllers
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -2193,9 +2188,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -2260,9 +2253,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 ( ",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 ) )
{
strSql . Append ( "LEFT JOIN (SELECT BSNO, sum(RMBDR) RMBDR,SUM(RMBCR) RMBCR,SUM(STLRMBDR) STLRMBDR,SUM(STLRMBCR) STLRMBCR,SUM(USDDR) USDDR" ) ;
@ -2417,9 +2408,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -2482,10 +2471,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
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" ) ;
@ -2638,9 +2624,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -2706,10 +2690,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
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" ) ;
@ -2864,9 +2845,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -2929,10 +2908,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
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" ) ;
@ -3085,9 +3061,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -3150,10 +3124,7 @@ namespace DSWeb.MvcShipping.Controllers
}
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 ( ",OP_SEAE.ORDEROP" ) ;
strSql . Append ( " FROM V_OP_BS B " ) ;
strSql . Append ( " LEFT JOIN OP_SEAE ON (OP_SEAE.BSNO=B.BSNO) " ) ;
strSql . Append ( " FROM V_OP_BILL B " ) ;
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" ) ;
@ -3374,7 +3345,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 ( ",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) " ) ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -3591,7 +3562,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 ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -3819,7 +3790,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 ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -4037,7 +4008,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 ( " FROM V_OP_B S B ") ;
strSql . Append ( " FROM V_OP_B ILL B ") ;
if ( ! string . IsNullOrEmpty ( feecondition ) )
{
@ -4449,7 +4420,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 ( ",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 v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
@ -4532,7 +4503,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 ( ",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 v_op_gain_sum G ON (G.BSNO=B.BSNO) " ) ;
strSql . Append ( " WHERE 1=1 " ) ;