リビジョン 409
工事予算書:管理費取得処理修正
工事詳細台帳:純利益表示酒精
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs | ||
---|---|---|
1235 | 1235 |
strSQL.Append("Select"); |
1236 | 1236 |
strSQL.Append(" A.ConstructionCode"); |
1237 | 1237 |
strSQL.Append(", A.ComponentCode"); |
1238 |
strSQL.Append(", ifnull(SUM(B.NegotiationPrice), SUM(A.PriceValue))");
|
|
1238 |
strSQL.Append(", SUM(ifnull(B.EstimatePrice, A.PriceValue))");
|
|
1239 | 1239 |
strSQL.Append(" From estimatedata As A"); |
1240 | 1240 |
strSQL.Append(" Left Join (Select"); |
1241 | 1241 |
strSQL.Append(" BB.ConstructionCode"); |
1242 | 1242 |
strSQL.Append(" , BB.ComponentCode"); |
1243 |
strSQL.Append(" , BB.NegotiationPrice");
|
|
1243 |
strSQL.Append(" , BB.EstimatePrice");
|
|
1244 | 1244 |
strSQL.Append(" From estimatebudgetdetail As BB"); |
1245 | 1245 |
strSQL.AppendFormat(" Where BB.ConstructionCode = {0}", m_ConstructionCode); |
1246 | 1246 |
strSQL.AppendFormat(" And BB.ComponentCode in ({0}, {1})" |
1247 | 1247 |
, m_CommonCosts.NormalManagementPublic |
1248 | 1248 |
, m_CommonCosts.NormalManagementPrivate); |
1249 |
strSQL.Append(" And BB.NegotiationPrice <> 0) As B");
|
|
1249 |
strSQL.Append(" And BB.EstimatePrice <> 0) As B");
|
|
1250 | 1250 |
strSQL.Append(" On B.ConstructionCode = A.ConstructionCode"); |
1251 | 1251 |
strSQL.Append(" And B.ComponentCode = A.ComponentCode"); |
1252 | 1252 |
strSQL.Append(" Where"); |
... | ... | |
1307 | 1307 |
strSQL.Append("Select"); |
1308 | 1308 |
strSQL.Append(" A.ConstructionCode"); |
1309 | 1309 |
strSQL.Append(", A.ComponentCode"); |
1310 |
strSQL.Append(", ifnull(SUM(B.NegotiationPrice), SUM(A.PriceValue))");
|
|
1310 |
strSQL.Append(", SUM(ifnull(B.EstimatePrice, A.PriceValue))");
|
|
1311 | 1311 |
strSQL.Append(" From estimatedata As A"); |
1312 | 1312 |
strSQL.Append(" Left Join (Select"); |
1313 | 1313 |
strSQL.Append(" BB.ConstructionCode"); |
1314 | 1314 |
strSQL.Append(" , BB.ComponentCode"); |
1315 |
strSQL.Append(" , BB.NegotiationPrice");
|
|
1315 |
strSQL.Append(" , BB.EstimatePrice");
|
|
1316 | 1316 |
strSQL.Append(" From estimatebudgetdetail As BB"); |
1317 | 1317 |
strSQL.AppendFormat(" Where BB.ConstructionCode = {0}", m_ConstructionCode); |
1318 | 1318 |
strSQL.AppendFormat(" And BB.ComponentCode in ({0}, {1})" |
1319 | 1319 |
, m_CommonCosts.FieldManagementPublic |
1320 | 1320 |
, m_CommonCosts.FieldManagementPrivate); |
1321 |
strSQL.Append(" And BB.NegotiationPrice <> 0) As B");
|
|
1321 |
strSQL.Append(" And BB.EstimatePrice <> 0) As B");
|
|
1322 | 1322 |
strSQL.Append(" On B.ConstructionCode = A.ConstructionCode"); |
1323 | 1323 |
strSQL.Append(" And B.ComponentCode = A.ComponentCode"); |
1324 | 1324 |
strSQL.Append(" Where"); |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs | ||
---|---|---|
2782 | 2782 |
int SaveLineCnt = -1; |
2783 | 2783 |
int nRowCnt = 0; |
2784 | 2784 |
long[] DispVal = new long[3]; |
2785 |
int DataCnt = 0; |
|
2785 | 2786 |
List<long> OrderVal = new List<long>(); |
2786 | 2787 |
List<long> EstVal = new List<long>(); |
2787 | 2788 |
List<long> ExecVal = new List<long>(); |
... | ... | |
2791 | 2792 |
int nCnt = RowCountPoint(CurCode, DetailList); |
2792 | 2793 |
object[] DetialObj = (object[])DetailList[nCnt]; |
2793 | 2794 |
// 受注金額 |
2794 |
OrderVal.Add(CommonMotions.cnvLong(DetialObj[DetailCnt + (int)DetailReadOrder.OrdersPrice])); |
|
2795 |
long wrkOrderVal = CommonMotions.cnvLong(DetialObj[DetailCnt + (int)DetailReadOrder.OrdersPrice]); |
|
2796 |
OrderVal.Add(wrkOrderVal); |
|
2795 | 2797 |
// 予算金額 |
2796 | 2798 |
long wrkEstVal = CommonMotions.cnvLong(DetialObj[DetailCnt + (int)DetailReadOrder.Budget1_SumOdrVal]) |
2797 | 2799 |
+ CommonMotions.cnvLong(DetialObj[DetailCnt + (int)DetailReadOrder.Budget2_SumOdrVal]) |
... | ... | |
2810 | 2812 |
long wrkPayVal = CommonMotions.cnvLong(DetialObj[DetailCnt + (int)DetailReadOrder.Budget4_SumExecVal]); |
2811 | 2813 |
long wrkPurchase = GetPurchaseValue(CurCode); |
2812 | 2814 |
|
2813 |
PurVal.Add((wrkPurchase + wrkExpenses + wrkPayVal)); |
|
2815 |
long wrkPurVal = (wrkPurchase + wrkExpenses + wrkPayVal); |
|
2816 |
PurVal.Add(wrkPurVal); |
|
2814 | 2817 |
|
2818 |
Array.Clear(DispVal, 0, DispVal.Length); |
|
2815 | 2819 |
// 予算書金額 |
2816 |
DispVal[0] = OrderVal.Sum() - EstVal.Sum(); |
|
2820 |
//DispVal[0] = OrderVal.Sum() - EstVal.Sum(); |
|
2821 |
DispVal[0] = wrkOrderVal - wrkEstVal; |
|
2817 | 2822 |
// 実行金額 |
2818 |
DispVal[1] = OrderVal.Sum() - ExecVal.Sum(); |
|
2823 |
//DispVal[1] = OrderVal.Sum() - ExecVal.Sum(); |
|
2824 |
DispVal[1] = wrkOrderVal - wrkExecVal; |
|
2819 | 2825 |
// 発注金額 |
2820 |
DispVal[2] = OrderVal.Sum() - PurVal.Sum(); |
|
2826 |
//DispVal[2] = OrderVal.Sum() - PurVal.Sum(); |
|
2827 |
DispVal[2] = wrkOrderVal - wrkPurVal; |
|
2821 | 2828 |
|
2822 | 2829 |
// データセット |
2823 | 2830 |
object[] RowData = new object[dgv.Columns.Count]; |
... | ... | |
2843 | 2850 |
dgv.Rows[CurRow].Cells[(int)GridColumn.No].Style.BackColor = CommonDefine.DefineColorList[nRowCnt]; |
2844 | 2851 |
|
2845 | 2852 |
nRowCnt++; |
2853 |
DataCnt++; |
|
2846 | 2854 |
} |
2847 | 2855 |
// 行位置セット |
2848 | 2856 |
m_CostsRowCount[(int)CostsRowLine.NetIncomeRowLine] = SaveLineCnt; |
2857 |
|
|
2858 |
// 純利益が2行以上あれば合計を表示する |
|
2859 |
if (DataCnt > 1) |
|
2860 |
{ |
|
2861 |
// 純利益合計表示処理 |
|
2862 |
CreateNetIncome2Total(m_SourceCodeList[0], OrderVal, EstVal, ExecVal, PurVal); |
|
2863 |
} |
|
2849 | 2864 |
} |
2850 | 2865 |
catch (Exception ex) |
2851 | 2866 |
{ |
... | ... | |
2854 | 2869 |
} |
2855 | 2870 |
#endregion |
2856 | 2871 |
|
2872 |
#region 純利益合計表示処理 |
|
2873 |
/// <summary> |
|
2874 |
/// 純利益合計表示処理 |
|
2875 |
/// </summary> |
|
2876 |
private void CreateNetIncome2Total(int CurCode, List<long> OrderVal, List<long> EstVal, List<long> ExecVal, List<long> PurVal) |
|
2877 |
{ |
|
2878 |
try |
|
2879 |
{ |
|
2880 |
DataGridViewEX dgv = dgvAllDisplay; |
|
2881 |
|
|
2882 |
long[] DispVal = new long[3]; |
|
2883 |
|
|
2884 |
// 予算書金額 |
|
2885 |
DispVal[0] = OrderVal.Sum() - EstVal.Sum(); |
|
2886 |
// 実行金額 |
|
2887 |
DispVal[1] = OrderVal.Sum() - ExecVal.Sum(); |
|
2888 |
// 発注金額 |
|
2889 |
DispVal[2] = OrderVal.Sum() - PurVal.Sum(); |
|
2890 |
|
|
2891 |
// データセット |
|
2892 |
object[] RowData = new object[dgv.Columns.Count]; |
|
2893 |
RowData[(int)GridColumn.FixFlg] = "*"; |
|
2894 |
RowData[(int)GridColumn.GroupCount] = (int)DataGroup.NetIncome; |
|
2895 |
RowData[(int)GridColumn.ItemName] = "純 利 益 合 計"; |
|
2896 |
RowData[(int)GridColumn.EstimatePrice] = DispVal[0].ToString("#,0"); |
|
2897 |
RowData[(int)GridColumn.ExecPrice] = DispVal[1].ToString("#,0"); |
|
2898 |
RowData[(int)GridColumn.Percent] = CalculattionPercent((double)DispVal[1]).ToString("0.00"); |
|
2899 |
RowData[(int)GridColumn.OrderPrice] = DispVal[2].ToString("#,0"); |
|
2900 |
RowData[(int)GridColumn.IndependentFlg] = "1"; |
|
2901 |
RowData[(int)GridColumn.SourceCode] = CurCode; |
|
2902 |
|
|
2903 |
// 行セット |
|
2904 |
CreateDataRow(RowData); |
|
2905 |
} |
|
2906 |
catch (Exception ex) |
|
2907 |
{ |
|
2908 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
2909 |
} |
|
2910 |
} |
|
2911 |
#endregion |
|
2912 |
|
|
2857 | 2913 |
#region 予算超過金額セット |
2858 | 2914 |
/// <summary> |
2859 | 2915 |
/// 予算超過金額セット |
... | ... | |
3372 | 3428 |
strcmd.Append(", B.PAYMENTAMOUNT"); |
3373 | 3429 |
|
3374 | 3430 |
strcmd.Append(", ifnull(Odr.OrdersLinePrice, 0) As OrderPrice"); |
3375 |
strcmd.Append(", ifnull(Odr2.StatutoryWelfareRate, 0.0)"); |
|
3431 |
strcmd.Append(", ifnull(Odr2.StatutoryWelfareRate, 0.0) As WelfareRate");
|
|
3376 | 3432 |
|
3377 | 3433 |
strcmd.Append(", CASE WHEN BudgetHead.OrdersDecisionPrice > 0 THEN BudgetHead.OrdersDecisionPrice"); |
3378 |
strcmd.Append(" ELSE BASE.OrdersDecisionPrice END"); |
|
3434 |
strcmd.Append(" ELSE BASE.OrdersDecisionPrice END As OrdersDecisionPrice");
|
|
3379 | 3435 |
strcmd.Append(", Budget1.SumOdrVal"); |
3380 | 3436 |
strcmd.Append(", Budget1.SumExecVal"); |
3381 | 3437 |
strcmd.Append(", Budget2.SumOdrVal"); |
... | ... | |
3395 | 3451 |
strcmd.Append(" AND B.GROUPCOUNT = A.GROUPCOUNT"); |
3396 | 3452 |
strcmd.Append(" AND B.LINECOUNT = A.LINECOUNT"); |
3397 | 3453 |
|
3398 |
//strcmd.Append(" LEFT JOIN(Select OdrA.ConstructionCode, OdrA.SourceDetailCnt, SUM(OdrA.OrdersLinePrice) As OrdersLinePrice"); |
|
3399 |
//strcmd.Append(" From PurchaseOrderDetail As OdrA"); |
|
3400 |
//strcmd.AppendFormat(" Where OdrA.GroupCount in ({0}, {1})", (int)PurchaseOrderDetail.GroupCountDef.Detail |
|
3401 |
// , (int)PurchaseOrderDetail.GroupCountDef.StatutoryWelfare); |
|
3402 |
//strcmd.AppendFormat(" Group By OdrA.ConstructionCode, OdrA.SourceDetailCnt) As Odr"); |
|
3403 |
//strcmd.AppendFormat(" ON Odr.ConstructionCode = A.SourceCode"); |
|
3404 |
//strcmd.AppendFormat(" And Odr.SourceDetailCnt = A.DetailCount"); |
|
3405 |
|
|
3406 | 3454 |
strcmd.Append(" LEFT JOIN PurchaseOrderDetail As Odr"); |
3407 | 3455 |
strcmd.Append(" ON Odr.ConstructionCode = A.SourceCode"); |
3408 | 3456 |
strcmd.Append(" And Odr.SourceCode = A.ConstructionCode"); |
... | ... | |
3419 | 3467 |
// 経費取得 |
3420 | 3468 |
strcmd.Append(" LEFT JOIN(Select Bdd.ConstructionCode, EstSum.PriceValue As SumOdrVal, SUM(Bdd.ExecutionAmount) As SumExecVal"); |
3421 | 3469 |
strcmd.Append(" From ConstructionBudgetdetail As Bdd"); |
3422 |
strcmd.Append(" Left Join(Select EstSumA.ConstructionCode, SUM(EstSumA.PriceValue) AS PriceValue From estimatedata As EstSumA");
|
|
3470 |
strcmd.Append(" Left Join(Select EstSumA.ConstructionCode, SUM(EstSumA.EstimatePrice) AS PriceValue From estimatebudgetdetail As EstSumA");
|
|
3423 | 3471 |
strcmd.AppendFormat(" Where EstSumA.ConstructionCode = {0}", m_ConstructionCode); |
3424 | 3472 |
strcmd.AppendFormat(" And EstSumA.ComponentCode in ({0}, {1})) As EstSum" |
3425 | 3473 |
, m_CommonCosts.NormalManagementPublic |
... | ... | |
3429 | 3477 |
strcmd.Append(" Group By Bdd.ConstructionCode) As Budget1 ON Budget1.ConstructionCode = A.SourceCode"); |
3430 | 3478 |
|
3431 | 3479 |
// 施工費取得 |
3432 |
strcmd.Append(" LEFT JOIN(Select Bdd.ConstructionCode, SUM(Bdd.NegotiationPrice) As SumOdrVal, SUM(Bdd.ExecutionAmount) As SumExecVal");
|
|
3480 |
strcmd.Append(" LEFT JOIN(Select Bdd.ConstructionCode, SUM(Bdd.EstimatePrice) As SumOdrVal, SUM(Bdd.ExecutionAmount) As SumExecVal");
|
|
3433 | 3481 |
strcmd.Append(" From ConstructionBudgetdetail As Bdd"); |
3434 | 3482 |
strcmd.AppendFormat(" WHERE Bdd.GroupCount In ({0}, {1}, {2})", (int)FrmConstructionBudget.DataGroup.CommonTempCosts |
3435 | 3483 |
, (int)FrmConstructionBudget.DataGroup.OutSourceCosts |
... | ... | |
3437 | 3485 |
strcmd.Append(" Group By Bdd.ConstructionCode) As Budget2 ON Budget2.ConstructionCode = A.SourceCode"); |
3438 | 3486 |
|
3439 | 3487 |
// 諸経費取得 |
3440 |
strcmd.Append(" LEFT JOIN(Select Bdd.ConstructionCode, SUM(Bdd.NegotiationPrice) As SumOdrVal, SUM(Bdd.ExecutionAmount) As SumExecVal");
|
|
3488 |
strcmd.Append(" LEFT JOIN(Select Bdd.ConstructionCode, SUM(Bdd.EstimatePrice) As SumOdrVal, SUM(Bdd.ExecutionAmount) As SumExecVal");
|
|
3441 | 3489 |
strcmd.Append(" From ConstructionBudgetdetail As Bdd"); |
3442 | 3490 |
strcmd.AppendFormat(" Where Bdd.GroupCount In ({0}, {1}, {2}, {3}, {4}, {5})" |
3443 | 3491 |
, (int)FrmConstructionBudget.DataGroup.PurchaseCosts |
... | ... | |
3565 | 3613 |
foreach (object[] CurObj in DetailList) |
3566 | 3614 |
{ |
3567 | 3615 |
int wrkCode = CommonMotions.cnvInt(CurObj[(int)IOConstructionLedgerDetail.TableColumn.SourceCode]); |
3568 |
if (wrkCode == 0) continue;
|
|
3616 |
if (wrkCode < 1) continue;
|
|
3569 | 3617 |
if (m_SourceCodeList.IndexOf(wrkCode) < 0) m_SourceCodeList.Add(wrkCode); |
3570 | 3618 |
} |
3571 | 3619 |
m_SourceCodeList.Sort(); |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ReqApprovalStatus/FrmReqApprovalStatus.designer.cs | ||
---|---|---|
340 | 340 |
// |
341 | 341 |
// Column4 |
342 | 342 |
// |
343 |
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
|
343 |
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
|
344 | 344 |
this.Column4.DefaultCellStyle = dataGridViewCellStyle4; |
345 | 345 |
this.Column4.Frozen = true; |
346 | 346 |
this.Column4.HeaderText = "工事担当者"; |
他の形式にエクスポート: Unified diff