Browse Source

全员收入统计表sql调整

yaoyu 2 months ago
parent
commit
b4346eeba5

+ 7 - 4
hr/hr/src/client/nc/ui/hr/baod_orders/view/IncomeStatisticalUI.java

@@ -425,7 +425,6 @@ public class IncomeStatisticalUI extends ToftPanel {
 		Vector<Object> vTitle = convertovector(m_sTitle);
 		Vector<Vector<Object>> vresult = new Vector<Vector<Object>>();
 		ArrayList<Object> list = QueryData(codein, startPeriod, endPeriod, map,psncode,psnname,codeTypein);
-
 		UFDouble totalsrzj = new UFDouble(UFDouble.ZERO_DBL);
 		UFDouble totalgdbf = new UFDouble(UFDouble.ZERO_DBL);
 		UFDouble totalfdbf = new UFDouble(UFDouble.ZERO_DBL);
@@ -495,10 +494,13 @@ public class IncomeStatisticalUI extends ToftPanel {
 					UFDouble manage_jsbonus = new UFDouble(objects[24] == null ? "0.00" : String.valueOf(objects[24]));
 					UFDouble manage_bdamount = new UFDouble(objects[25] == null ? "0.00" : String.valueOf(objects[25]));
 					UFDouble share_bonus = new UFDouble(objects[26] == null ? "0.00" : String.valueOf(objects[26]));
+					//固定部分 = 部门承担+预发代扣+公司补贴+资质补贴及审图资格补贴
 					gdbf = bmcd.add(yfdk).add(gsbt).add(zzbt);
+					//浮动部分 =设计奖金——分红相加
 					fdbf = designbonus.add(marketbonus).add(awardsbonus).add(managementbonus).add(servicebonus).add(guaranteebonus1)
 							.add(guaranteebonus2).add(specialbonus).add(allowancebonus).add(function_bonus).add(manage_jsbonus)
 							.add(manage_bdamount).add(share_bonus);
+					//收入总计=固定部分+浮动部分
 					srzj = gdbf.add(fdbf);
 					if(!MathTool.isZero(fdbf) && !MathTool.isZero(gdbf)) {
 						gfb = fdbf.div(gdbf);
@@ -739,7 +741,8 @@ public class IncomeStatisticalUI extends ToftPanel {
 		sql.append(" sum( designbonus ) AS designbonus,");
 		sql.append(" sum( marketbonus ) AS marketbonus,");
 		sql.append(" sum( awardsbonus ) AS awardsbonus,");
-		sql.append(" sum( managementbonus ) AS managementbonus,");
+		//sql.append(" sum( managementbonus ) AS managementbonus,");
+		sql.append(" COALESCE( sum( managementbonus ), 0 ) - COALESCE( sum( yfdk ), 0 ) AS managementbonus,");
 		sql.append(" sum( servicebonus ) AS servicebonus,");
 		sql.append(" sum( guaranteebonus1 ) AS guaranteebonus1,");
 		sql.append(" sum( guaranteebonus2 ) AS guaranteebonus2,");
@@ -851,7 +854,7 @@ public class IncomeStatisticalUI extends ToftPanel {
 		sql.append(" 		FROM");
 		sql.append(" 				hr_laborcost");
 		sql.append("        WHERE");
-		sql.append("        		wa_period "+ map.get("wa_periodin"));
+		sql.append("        		dr = 0 AND wa_period "+ map.get("wa_periodin"));
 		sql.append(" 		GROUP BY");
 		sql.append(" 				workercode,cost_org,cost_dept,post");
 		sql.append(" ) laborcost_table ON hi_psnjob.clerkcode = laborcost_table.workercode");
@@ -879,7 +882,7 @@ public class IncomeStatisticalUI extends ToftPanel {
 		sql.append("	AND COALESCE( org_dept.code, 'N' ) = COALESCE( PRIM2023_table.deptcode, 'N' )");
 		sql.append("	AND COALESCE( om_post.postname, 'N' ) = COALESCE( PRIM2023_table.position, 'N' )");
 		sql.append(" WHERE");
-		sql.append(" 		bd_psndoc.enablestate = '2' AND hi_psnjob.dr = 0");
+		sql.append(" 		bd_psndoc.dr = 0 AND hi_psnjob.dr = 0");
 		sql.append("        AND om_posts.postname <> '发薪人员'");
 		sql.append("        AND org_hrorg.code " + codein);
 		if(psncode != null && !"".equals(psncode)) {