1387 |
1387 |
// ----- ?H????????
|
1388 |
1388 |
if (!LedgerDB.ExecuteReader(strSQL, ref arData)) return;
|
1389 |
1389 |
|
|
1390 |
// ???????????????E?????f?[?^???????\??????
|
|
1391 |
if (DispType== (int)DispDataTypeCode.Department)
|
|
1392 |
{
|
|
1393 |
GetType2DeleteData(LedgerDB, ref arData);
|
|
1394 |
}
|
|
1395 |
|
1390 |
1396 |
// ??????f?[?^?J?E???g??
|
1391 |
1397 |
m_initDataCount = arData.Count;
|
1392 |
1398 |
if (arData.Count == 0) return;
|
... | ... | |
1548 |
1554 |
strSQL += " DEPARTMENTMASTER D";
|
1549 |
1555 |
strSQL += " WHERE B.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
|
1550 |
1556 |
strSQL += " AND C.DEPARTMENTCODE = D.DEPARTMENTCODE";
|
1551 |
|
strSQL += " AND C.DELETEFLG = 0";
|
|
1557 |
//strSQL += " AND C.DELETEFLG = 0";
|
1552 |
1558 |
|
1553 |
1559 |
strSQL += " GROUP BY C.DEPARTMENTCODE, D.DEPARTMENTSTRING, D.DISPLAYORDER";
|
1554 |
1560 |
strSQL += " ORDER BY 3 ASC";
|
... | ... | |
1598 |
1604 |
strSQL += " LEFT JOIN CONSTRUCTIONLEDGER A ON A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
1599 |
1605 |
strSQL += string.Format(" WHERE C.DEPARTMENTCODE = {0}", DepCode);
|
1600 |
1606 |
strSQL += " AND C.DELETEFLG = 0";
|
1601 |
|
strSQL += string.Format(" AND C.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
|
|
1607 |
//strSQL += string.Format(" AND C.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
|
1602 |
1608 |
strSQL += " GROUP BY C.DISPLAYORDER, C.PERSONCODE, C.PERSONNAME, C.EMPLOYEECLASSFLG";
|
1603 |
1609 |
strSQL += " ORDER BY 11, 3 ASC";
|
1604 |
1610 |
|
... | ... | |
1610 |
1616 |
}
|
1611 |
1617 |
#endregion
|
1612 |
1618 |
|
|
1619 |
#region ???????????f?[?^??S?????f?[?^???????????
|
|
1620 |
/// <summary>
|
|
1621 |
/// ???????????f?[?^??S?????f?[?^???????????
|
|
1622 |
/// </summary>
|
|
1623 |
private void GetType2DeleteData(IOConstructionLedger LedgerDB, ref ArrayList arData)
|
|
1624 |
{
|
|
1625 |
string strSQL = string.Empty;
|
|
1626 |
try
|
|
1627 |
{
|
|
1628 |
// SQL??A?N?Z?X????????????
|
|
1629 |
string strSecurity = string.Empty;
|
|
1630 |
CreateSecuritySQL(ref strSecurity);
|
|
1631 |
|
|
1632 |
int NotOrder = CommonDefine.ProjectsStatus.First(x => x.Value.Equals("?? ?? ??")).Key;
|
|
1633 |
int DepCode = CommonMotions.cnvInt(cmbDepartment.SelectedValue);
|
|
1634 |
// ----- ?r?p?k??
|
|
1635 |
// ????????f?[?^????
|
|
1636 |
strSQL = "SELECT";
|
|
1637 |
|
|
1638 |
strSQL += " C.PERSONCODE";
|
|
1639 |
strSQL += " ,C.PERSONNAME";
|
|
1640 |
strSQL += " ,C.DISPLAYORDER";
|
|
1641 |
strSQL += " ,SUM(A.ORDERSDECISIONPRICE)";
|
|
1642 |
strSQL += " ,SUM(A.COMPANYEXPENSES)";
|
|
1643 |
strSQL += " ,SUM(A.DEPARTMENTEXPENSES)";
|
|
1644 |
strSQL += " ,SUM(A.SALESEXPENSES)";
|
|
1645 |
strSQL += " ,SUM(A.TOTALPAYMENT)";
|
|
1646 |
strSQL += " ,SUM(A.GROSSPROFIT)";
|
|
1647 |
strSQL += " ,SUM(A.NETPROFIT)";
|
|
1648 |
strSQL += " ,C.EMPLOYEECLASSFLG";
|
|
1649 |
|
|
1650 |
strSQL += " FROM PERSONINCHARGEMASTER C";
|
|
1651 |
strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO B ON B.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
|
|
1652 |
strSQL += string.Format(" AND B.CONSTRUCTIONPERIOD = {0}", numUDConstPro.Value);
|
|
1653 |
strSQL += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", NotOrder);
|
|
1654 |
strSQL += string.Format(" AND B.TyingFlg != {0}", (int)CommonDefine.BaseInfoTyingFlg.Tying);
|
|
1655 |
|
|
1656 |
strSQL += ", CONSTRUCTIONLEDGER A";
|
|
1657 |
//strSQL += " LEFT JOIN CONSTRUCTIONLEDGER A ON A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
|
1658 |
|
|
1659 |
strSQL += string.Format(" WHERE C.DEPARTMENTCODE = {0}", DepCode);
|
|
1660 |
strSQL += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
|
1661 |
|
|
1662 |
strSQL += " AND C.DELETEFLG != 0";
|
|
1663 |
//strSQL += string.Format(" AND C.EMPLOYEECLASSFLG = {0}", (int)CommonDefine.EmployeeClassFlg.Regular);
|
|
1664 |
|
|
1665 |
strSQL += " GROUP BY C.DISPLAYORDER, C.PERSONCODE, C.PERSONNAME, C.EMPLOYEECLASSFLG";
|
|
1666 |
strSQL += " ORDER BY 11, 3 ASC";
|
|
1667 |
|
|
1668 |
if (!LedgerDB.ExecuteReader(strSQL, ref arData)) return;
|
|
1669 |
}
|
|
1670 |
catch (Exception ex)
|
|
1671 |
{
|
|
1672 |
logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", ex.Message, strSQL);
|
|
1673 |
}
|
|
1674 |
}
|
|
1675 |
#endregion
|
|
1676 |
|
1613 |
1677 |
#region ??????o????^??\??????
|
1614 |
1678 |
/// <summary>
|
1615 |
1679 |
/// ??????o????^??\??????
|
... | ... | |
1694 |
1758 |
int workSalary = CalcElapsedSalary(dtStart, dtMax, PersonCDArray[i], SalaryArray[i]);
|
1695 |
1759 |
// ??v???Z
|
1696 |
1760 |
if (workSalary > 0) TotalSalary += workSalary;
|
1697 |
|
Debug.WriteLine(string.Format("Code={0} Val={1} Start={2} End={3}", PersonCDArray[i], workSalary.ToString("0,0"), dtStart, dtMax));
|
|
1761 |
// Debug.WriteLine(string.Format("Code={0} Val={1} Start={2} End={3}", PersonCDArray[i], workSalary.ToString("0,0"), dtStart, dtMax));
|
1698 |
1762 |
|
1699 |
1763 |
// ?v?Z?J?n?I????????????
|
1700 |
1764 |
if (dtStart < dtDispStart) dtDispStart = dtStart;
|