|
|
@@ -329,11 +329,13 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
Map<String, UFDouble> voucheramount = getVoucherAmount(getTablePanel());
|
|
|
VoucherVO voucher = getVoucherVO(voucheramount);
|
|
|
for (DetailVO detail : voucher.getDetails()) {
|
|
|
+ NcLog.info("摘要"+detail.getExplanation()+",科目"+detail.getPk_accasoa()+",借方"+detail.getDebitamount()+",贷方"+detail.getCreditamount());
|
|
|
if (detail.getAss() != null && detail.getAss().length > 0) {
|
|
|
- String smd5 = new BigAssMD5Util().getMD5ByAssvos(detail.getAss(), InvocationInfoProxy.getInstance().getGroupId());
|
|
|
- String assIDs = GLPubProxy.getRemoteFreevaluePub().getAssID_RequiresNew(detail.getAss(), false,
|
|
|
- smd5, InvocationInfoProxy.getInstance().getGroupId(), Module.GL);
|
|
|
+ String assIDs = GLPubProxy.getRemoteFreevaluePub().getAssID(detail.getAss(), true, InvocationInfoProxy.getInstance().getGroupId(), Module.GL);
|
|
|
detail.setAssid(assIDs);
|
|
|
+ for(AssVO assVO : detail.getAss()) {
|
|
|
+ NcLog.info("辅助核算"+assVO.getChecktypename()+"值"+assVO.getCheckvaluecode()+"assIDs"+assIDs);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
OperationResultVO[] rs = GLPubProxy.getRemoteVoucher().save((VoucherVO) voucher, new Boolean(true));
|
|
|
@@ -647,7 +649,7 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
// 输出行数据
|
|
|
dataList.add(new Object[] { i + 1, clerkcode, clerkname, basicsMoney, staffMoney, orgMoney, mark, str + orgName });
|
|
|
if ("表一:由个人承担".equals(title)) {
|
|
|
- tableOneOrgMap.put(clerkcode + "," + clerkname, orgMoney);
|
|
|
+ tableOneOrgMap.put(clerkcode + "," + clerkname, orgMoney.add(staffMoney));
|
|
|
}
|
|
|
if ("表六:实际已缴当月工资个人部分未扣".equals(title)) {
|
|
|
tableSixSelfMap.put(clerkcode + "," + clerkname, staffMoney);
|
|
|
@@ -686,7 +688,7 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
// 输出行数据
|
|
|
dataList.add(new Object[] { i + 1, clerkcode, clerkname, basicsMoney, staffMoney, orgMoney, mark, str });
|
|
|
if ("表一:由个人承担".equals(title)) {
|
|
|
- tableOneOrgMap.put(clerkcode + "," + clerkname, orgMoney);
|
|
|
+ tableOneOrgMap.put(clerkcode + "," + clerkname, orgMoney.add(staffMoney));
|
|
|
}
|
|
|
if ("表六:实际已缴当月工资个人部分未扣".equals(title)) {
|
|
|
tableSixSelfMap.put(clerkcode + "," + clerkname, staffMoney);
|
|
|
@@ -824,7 +826,7 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
sql.append("SELECT orgname,clerkcode,clerkname,sum(basicssum) as basicssum,sum(staffsum) as staffsum,sum(orgsum) as orgsum,max(mark) as mark");
|
|
|
sql.append(" FROM");
|
|
|
sql.append(" (SELECT");
|
|
|
- sql.append(" salocation AS orgname,");
|
|
|
+ sql.append(" costorgname AS orgname,");
|
|
|
sql.append(" clerkcode,");
|
|
|
sql.append(" clerkname,");
|
|
|
sql.append(" CAST(endowment_base AS VARCHAR2 ( 50 ) ) AS basicssum,");
|
|
|
@@ -834,14 +836,28 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
sql.append(" FROM");
|
|
|
sql.append(" (SELECT");
|
|
|
sql.append(" t.CLERKCODE,T1.CLERKNAME,t.ym,decode( t.c_23, '青岛天华易境建筑设计有限公司', 0, sum( nvl( t.VALUE, 0 ) ) ) AS sum_per_cost,");
|
|
|
- sql.append(" t.c_23 AS salocation,decode( t.c_23, '青岛天华易境建筑设计有限公司', t1.so_org_sum + t1.so_staff_sum, t1.so_org_sum ) AS so_org_sum,");
|
|
|
- sql.append(" t1.so_staff_sum,t1.ENDOWMENT_BASE,T1.MARK");
|
|
|
+ sql.append(" t.c_23 AS salocation,T13.Name AS costorgname,decode(t.c_23,'青岛天华易境建筑设计有限公司',t1.so_org_sum + t1.so_staff_sum - nvl( t15.sum_per_cost, 0 ) - nvl( t16.SO_ORG_SUM, 0 ),");
|
|
|
+ sql.append(" t1.so_org_sum - nvl( t15.sum_per_cost, 0 ) - nvl( t16.SO_ORG_SUM, 0 ) ) AS so_org_sum,t1.so_staff_sum,t1.ENDOWMENT_BASE,T1.MARK ");
|
|
|
sql.append(" FROM");
|
|
|
sql.append(" NC6337.v_data_xz_gjjshare t");
|
|
|
sql.append(" LEFT JOIN NC6337.V_SUM_TB_HR_SOCIAL_SECURITY t1 ON t1.CLERKCODE = t.CLERKCODE AND t1.PAY_MONTH || '-01' = t.ym");
|
|
|
- sql.append(" WHERE t.key = '社保个人合计' AND t.VALUE <> 0 AND t.ym = '" + period + "' || '-01' AND t1.ORGCODE = '" + orgCode + "' AND t1.PAY_SOS_ORG <> t.c_23");
|
|
|
- sql.append(" GROUP BY ROWNUM,t.CLERKCODE,T1.CLERKNAME,t.ym,t1.ENDOWMENT_BASE,t1.so_org_sum,t1.so_staff_sum,t.c_23,T1.MARK");
|
|
|
- sql.append(" ORDER BY t.c_23");
|
|
|
+ sql.append(" LEFT JOIN (SELECT t12.CLERK_CODE,t12.NC_PK_POST");
|
|
|
+ sql.append(" FROM");
|
|
|
+ sql.append(" nc6337.monthly_position_gjj t12");
|
|
|
+ sql.append(" WHERE");
|
|
|
+ sql.append(" t12.month = to_char( last_day( to_date( '"+period+"', 'yyyy-mm' ) ), 'yyyy-mm-dd' )");
|
|
|
+ sql.append(" ) T12 ON t12.CLERK_CODE = t.CLERKCODE");
|
|
|
+ sql.append(" LEFT JOIN nc6337.om_post t14 ON t14.pk_post = t12.NC_PK_POST");
|
|
|
+ sql.append(" LEFT JOIN nc6337.org_corp T13 ON T13.Pk_Corp = t14.pk_org");
|
|
|
+ sql.append(" LEFT JOIN nc6337.person_afford_sbgjj t15 ON t15.CLERKCODE = t.CLERKCODE AND t.YM = t15.ym");
|
|
|
+ sql.append(" LEFT JOIN nc6337.DEPT_AFFORD_SBGJJ t16 ON t16.CLERKCODE = t.CLERKCODE AND t.YM = t16.PAY_MONTH");
|
|
|
+ sql.append(" WHERE");
|
|
|
+ sql.append(" t.key IN ( '社保个人合计', '费用调整社保', '社保个人扣款', '费用调整社保T' ) AND t.VALUE <> 0 AND t.ym = '"+period+"' || '-01'");
|
|
|
+ sql.append(" AND t1.ORGCODE = '"+orgCode+"' AND t1.PAY_SOS_ORG <> t.c_23");
|
|
|
+ sql.append(" GROUP BY ROWNUM,t.CLERKCODE,T1.CLERKNAME,t.ym,t1.ENDOWMENT_BASE,t1.so_org_sum,t15.sum_per_cost,t16.SO_ORG_SUM,");
|
|
|
+ sql.append(" t1.so_staff_sum,t.c_23,T13.Name,T1.MARK ");
|
|
|
+ sql.append(" ORDER BY");
|
|
|
+ sql.append(" t.c_23");
|
|
|
sql.append(" ) t11");
|
|
|
sql.append(jointSql(title, orgCode, period));
|
|
|
sql.append(" )GROUP BY orgname,clerkcode,clerkname ORDER BY orgname,clerkcode");
|
|
|
@@ -893,12 +909,16 @@ public class SocialInsuranceAllocationUI extends ToftPanel {
|
|
|
sql.append(" GROUP BY t.CLERKCODE,T1.CLERKNAME,t.ym,t1.ENDOWMENT_BASE,t1.so_org_sum - nvl( t15.sum_per_cost, 0 ) - nvl( t16.SO_ORG_SUM, 0 ),");
|
|
|
sql.append(" t1.so_staff_sum,T13.Name,t.c_23,t1.mark");
|
|
|
sql.append(" UNION ALL");
|
|
|
- sql.append(" SELECT t.WORKERCODE AS CLERKCODE,t1.CLERKNAME,t.WA_PERIOD AS ym,0 AS sum_per_cost,T6.NAME AS costorgname,'上海天华' AS salocation,");
|
|
|
- sql.append(" round( nvl( t1.so_org_sum, 0 ) * nvl( t.perc, 0 ), 3 ) AS so_org_sum,round( nvl( t1.so_staff_sum, 0 ) * nvl( t.perc, 0 ), 3 ) AS so_staff_sum,");
|
|
|
- sql.append(" t1.Endowment_Base,t1.mark");
|
|
|
+ sql.append(" SELECT");
|
|
|
+ sql.append(" t.WORKERCODE AS CLERKCODE,t1.CLERKNAME,t.WA_PERIOD AS ym,0 AS sum_per_cost,T6.NAME AS costorgname,'上海天华' AS salocation,");
|
|
|
+ sql.append(" round(( nvl( t1.so_org_sum, 0 ) - nvl( t15.sum_per_cost, 0 ) - nvl( t16.SO_ORG_SUM, 0 ) ) * nvl( t.perc, 0 ),3 ) AS so_org_sum,");
|
|
|
+ sql.append(" round( nvl( t1.so_staff_sum, 0 ) * nvl( t.perc, 0 ), 3 ) AS so_staff_sum,");
|
|
|
+ sql.append(" t1.Endowment_Base,t1.mark ");
|
|
|
sql.append(" FROM");
|
|
|
sql.append(" nc6337.v_hr_allocationratio_gjjshareF t");
|
|
|
sql.append(" LEFT JOIN nc6337.V_SUM_TB_HR_SOCIAL_SECURITY t1 ON t1.CLERKCODE = t.WORKERCODE AND t1.PAY_MONTH || '-01' = t.WA_PERIOD");
|
|
|
+ sql.append(" LEFT JOIN nc6337.person_afford_sbgjj t15 ON t15.CLERKCODE = t.WORKERCODE AND t.WA_PERIOD = t15.ym");
|
|
|
+ sql.append(" LEFT JOIN nc6337.DEPT_AFFORD_SBGJJ t16 ON t16.CLERKCODE = t.WORKERCODE AND t.WA_PERIOD = t16.PAY_MONTH");
|
|
|
sql.append(" LEFT JOIN ( SELECT DISTINCT T5.CODE, T5.NAME, t5.pk_corp FROM nc6337.ORG_CORP T5 ) T6 ON T6.pk_corp = T.COST_ORG");
|
|
|
sql.append(" WHERE");
|
|
|
sql.append(" t.WA_PERIOD = '" + period + "' || '-01' AND t1.CLERKNAME IS NOT NULL AND t1.ORGCODE = '" + orgCode + "'");
|