49 |
49 |
private enum DispColumn
|
50 |
50 |
{
|
51 |
51 |
// 請求書データ(自動入力)
|
52 |
|
No = 0, // No.
|
|
52 |
KB = 0, // ■KB
|
|
53 |
No, // No.
|
53 |
54 |
RequestMonth, // ■請求月
|
54 |
55 |
RequestNo, // ■請求書No.
|
55 |
56 |
OrderersDivision, // ■発注者区分
|
... | ... | |
66 |
67 |
|
67 |
68 |
// 入金明細データ(工事担当入力欄)
|
68 |
69 |
OrderNo, // ■受付番号
|
69 |
|
DepositAmount, // 入金金額
|
|
70 |
DepositAmount, // 入金金額(税抜)
|
|
71 |
TaxAmount, // 入金金額(消費税)
|
70 |
72 |
DiscountAmount, // 値引金額
|
71 |
73 |
CnstrPrice, // 協力金
|
72 |
74 |
Fees, // 手数料
|
... | ... | |
118 |
120 |
|
119 |
121 |
// 入金明細データ
|
120 |
122 |
OrderNo, // ■受付番号
|
121 |
|
DepositAmount, // 入金金額
|
|
123 |
DepositAmount, // 入金金額(税抜き)
|
|
124 |
TaxAmount, // 入金金額(消費税)
|
122 |
125 |
DiscountAmount, // 値引金額
|
123 |
126 |
CnstrPrice, // 協力金
|
124 |
127 |
Fees, // 手数料
|
... | ... | |
140 |
143 |
}
|
141 |
144 |
#endregion
|
142 |
145 |
|
|
146 |
#region 金額最大最小値
|
143 |
147 |
private const long amount_max = 9999999999; // 金額最大
|
144 |
148 |
private const long amount_min = -9999999999; // 金額最小
|
|
149 |
#endregion
|
145 |
150 |
|
146 |
151 |
#endregion
|
147 |
152 |
|
... | ... | |
270 |
275 |
public long BillPrice;
|
271 |
276 |
public long TaxPrice;
|
272 |
277 |
public long DepositAmount;
|
|
278 |
public long TaxAmount;
|
273 |
279 |
public long DiscountAmount;
|
274 |
280 |
public long CnstrPrice;
|
275 |
281 |
public long Fees;
|
... | ... | |
389 |
395 |
|
390 |
396 |
SetGridHeaderColor();
|
391 |
397 |
DisplayData();
|
|
398 |
|
|
399 |
// 入金入力ができる権限以外は入金入力ボタンを非表示
|
|
400 |
if (CommonMotions.LoginUserData.DepartmentCode == CommonDefine.s_GeneralAffairsDevision ||
|
|
401 |
m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
|
|
402 |
{
|
|
403 |
DepositBtn.Visible = true;
|
|
404 |
}
|
|
405 |
else
|
|
406 |
{
|
|
407 |
DepositBtn.Visible = false;
|
|
408 |
}
|
392 |
409 |
}
|
393 |
410 |
catch (Exception ex)
|
394 |
411 |
{
|
... | ... | |
396 |
413 |
}
|
397 |
414 |
finally
|
398 |
415 |
{
|
399 |
|
dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
|
400 |
|
dgvMaster.CellEnter += DataGridView_CellEnter;
|
401 |
|
dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
|
|
416 |
//dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
|
|
417 |
//dgvMaster.CellEnter += DataGridView_CellEnter;
|
|
418 |
//dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
|
402 |
419 |
|
403 |
420 |
IoDd.close();
|
404 |
421 |
IoDd = null;
|
... | ... | |
514 |
531 |
}
|
515 |
532 |
#endregion
|
516 |
533 |
|
|
534 |
#region 入金入力ボタンクリック時のイベント
|
|
535 |
/// <summary>
|
|
536 |
/// 入金入力ボタンクリック時のイベント
|
|
537 |
/// </summary>
|
|
538 |
/// <param name="sender"></param>
|
|
539 |
/// <param name="e"></param>
|
|
540 |
private void DepositBtn_Click(object sender, EventArgs e)
|
|
541 |
{
|
|
542 |
dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
|
|
543 |
dgvMaster.CellEnter -= DataGridView_CellEnter;
|
|
544 |
dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
|
|
545 |
try
|
|
546 |
{
|
|
547 |
var cells = dgvMaster.Rows[dgvMaster.CurrentCell.RowIndex].Cells;
|
|
548 |
var checkTargetMonth = CommonMotions.cnvInt(cells[(int)DispColumn.RequestMonth].Value);
|
|
549 |
// 行インデックスが不正な場合はスルー
|
|
550 |
if (dgvMaster.CurrentCell.RowIndex == -1 || checkTargetMonth == 0)
|
|
551 |
{
|
|
552 |
return;
|
|
553 |
}
|
|
554 |
|
|
555 |
// 入金入力画面の表示
|
|
556 |
if (CommonMotions.LoginUserData.DepartmentCode == CommonDefine.s_GeneralAffairsDevision ||
|
|
557 |
m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
|
|
558 |
{
|
|
559 |
if (isDirty && MessageBox.Show("データに変更があります、登録せずに入金入力を行いますか?", "終了確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
|
|
560 |
{
|
|
561 |
return;
|
|
562 |
}
|
|
563 |
var orderersDiv = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value);
|
|
564 |
var orderersCode = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value);
|
|
565 |
string reqDate = CommonMotions.cnvInt(cells[(int)DispColumn.RequestMonth].Value).ToString();
|
|
566 |
|
|
567 |
EntryDeposit(orderersDiv, orderersCode, reqDate);
|
|
568 |
return;
|
|
569 |
}
|
|
570 |
}
|
|
571 |
catch (Exception ex)
|
|
572 |
{
|
|
573 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
|
574 |
}
|
|
575 |
finally
|
|
576 |
{
|
|
577 |
dgvMaster.CellDoubleClick += DataGridView_DoubleCellClick;
|
|
578 |
dgvMaster.CellEnter += DataGridView_CellEnter;
|
|
579 |
dgvMaster.CellValueChanged += DataGridView_CellValueChanged;
|
|
580 |
}
|
|
581 |
}
|
|
582 |
#endregion
|
|
583 |
|
517 |
584 |
#region 登録ボタンクリック時のイベント
|
518 |
585 |
/// <summary>
|
519 |
586 |
/// 登録ボタンクリック時のイベント
|
... | ... | |
560 |
627 |
RequestNo = depositDetail.RequestNo,
|
561 |
628 |
OrderNo = depositDetail.OrderNo,
|
562 |
629 |
DepositAmount = depositDetail.DepositAmount,
|
|
630 |
TaxAmount = depositDetail.TaxAmount,
|
563 |
631 |
DiscountAmount = depositDetail.DiscountAmount,
|
564 |
632 |
CnstrPrice = depositDetail.CnstrPrice,
|
565 |
633 |
Fees = depositDetail.Fees,
|
... | ... | |
605 |
673 |
throw new Exception();
|
606 |
674 |
}
|
607 |
675 |
}
|
608 |
|
|
609 |
676 |
}
|
610 |
677 |
}
|
611 |
678 |
}
|
... | ... | |
651 |
718 |
dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
|
652 |
719 |
try
|
653 |
720 |
{
|
|
721 |
var cells = dgvMaster.Rows[e.RowIndex].Cells;
|
|
722 |
var checkTargetMonth = CommonMotions.cnvInt(cells[(int)DispColumn.RequestMonth].Value);
|
654 |
723 |
// 行インデックスが不正な場合はスルー
|
655 |
|
if (e.RowIndex == -1)
|
|
724 |
if (e.RowIndex == -1 || checkTargetMonth ==0)
|
656 |
725 |
{
|
657 |
726 |
return;
|
658 |
727 |
}
|
... | ... | |
661 |
730 |
if (e.ColumnIndex == (int)DispColumn.DepositAmountBill
|
662 |
731 |
|| e.ColumnIndex == (int)DispColumn.DepositAmountCash)
|
663 |
732 |
{
|
664 |
|
if (CommonMotions.LoginUserData.DepartmentCode == 4 ||
|
665 |
|
CommonMotions.LoginUserData.SecCode == 2 ||
|
|
733 |
if (CommonMotions.LoginUserData.DepartmentCode == CommonDefine.s_GeneralAffairsDevision ||
|
666 |
734 |
m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
|
667 |
735 |
{
|
668 |
|
var cells = dgvMaster.Rows[e.RowIndex].Cells;
|
|
736 |
if (isDirty && MessageBox.Show("データに変更があります、登録せずに入金入力を行いますか?", "終了確認", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
|
|
737 |
{
|
|
738 |
return;
|
|
739 |
}
|
669 |
740 |
var orderersDiv = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersDivision].Value);
|
670 |
741 |
var orderersCode = CommonMotions.cnvInt(cells[(int)DispColumn.OrderersCode].Value);
|
671 |
742 |
string reqDate = CommonMotions.cnvInt(cells[(int)DispColumn.RequestMonth].Value).ToString();
|
... | ... | |
681 |
752 |
// エラー表示解除
|
682 |
753 |
UnsetErrorDisp();
|
683 |
754 |
|
684 |
|
var cells = dgvMaster.Rows[e.RowIndex].Cells;
|
685 |
755 |
// 自分以外のセルは編集不可
|
686 |
|
if (CommonMotions.cnvInt(dgvMaster[(int)DispColumn.ConfirmationPersonCode, e.RowIndex].Value) != CommonMotions.LoginUserData.PersonCode)
|
|
756 |
if (m_UserInfo.m_Type != CommonDefine.SecurityRankPos.SpecialAuthority)
|
687 |
757 |
{
|
688 |
|
return;
|
|
758 |
if (CommonMotions.cnvInt(dgvMaster[(int)DispColumn.ConfirmationPersonCode, e.RowIndex].Value) != CommonMotions.LoginUserData.PersonCode)
|
|
759 |
{
|
|
760 |
return;
|
|
761 |
}
|
689 |
762 |
}
|
690 |
763 |
|
691 |
764 |
var depositOrderer = FindDepositOrderer(e.RowIndex);
|
... | ... | |
829 |
902 |
int trow = e.RowIndex;
|
830 |
903 |
|
831 |
904 |
if ((tcol == (int)DispColumn.DepositAmount) ||
|
|
905 |
(tcol == (int)DispColumn.TaxAmount) ||
|
832 |
906 |
(tcol == (int)DispColumn.DiscountAmount) ||
|
833 |
907 |
(tcol == (int)DispColumn.CnstrPrice) ||
|
834 |
908 |
(tcol == (int)DispColumn.Fees) ||
|
... | ... | |
872 |
946 |
dgvMaster.CellDoubleClick -= DataGridView_DoubleCellClick;
|
873 |
947 |
dgvMaster.CellEnter -= DataGridView_CellEnter;
|
874 |
948 |
dgvMaster.CellValueChanged -= DataGridView_CellValueChanged;
|
|
949 |
bool sumDataCheck = false;
|
875 |
950 |
try
|
876 |
951 |
{
|
877 |
952 |
|
... | ... | |
899 |
974 |
var depositOrderer = FindDepositOrderer(key.OrderersDivision, key.OrderersCode);
|
900 |
975 |
|
901 |
976 |
if ((e.ColumnIndex == (int)DispColumn.DepositAmount) ||
|
|
977 |
(e.ColumnIndex == (int)DispColumn.TaxAmount) ||
|
902 |
978 |
(e.ColumnIndex == (int)DispColumn.DiscountAmount) ||
|
903 |
979 |
(e.ColumnIndex == (int)DispColumn.CnstrPrice) ||
|
904 |
980 |
(e.ColumnIndex == (int)DispColumn.Fees) ||
|
... | ... | |
911 |
987 |
|
912 |
988 |
// 入金明細金額を編集
|
913 |
989 |
if (e.ColumnIndex == (int)DispColumn.DepositAmount
|
|
990 |
|| e.ColumnIndex == (int)DispColumn.TaxAmount
|
914 |
991 |
|| e.ColumnIndex == (int)DispColumn.DiscountAmount
|
915 |
992 |
|| e.ColumnIndex == (int)DispColumn.CnstrPrice
|
916 |
993 |
|| e.ColumnIndex == (int)DispColumn.Fees
|
... | ... | |
925 |
1002 |
case (int)DispColumn.DepositAmount:
|
926 |
1003 |
depositDetail.DepositAmount = amount;
|
927 |
1004 |
bUpdateCarryAmount = true;
|
|
1005 |
sumDataCheck = true;
|
928 |
1006 |
break;
|
|
1007 |
case (int)DispColumn.TaxAmount:
|
|
1008 |
depositDetail.TaxAmount = amount;
|
|
1009 |
bUpdateCarryAmount = true;
|
|
1010 |
sumDataCheck = true;
|
|
1011 |
break;
|
929 |
1012 |
case (int)DispColumn.DiscountAmount:
|
930 |
1013 |
depositDetail.DiscountAmount = amount;
|
931 |
1014 |
bUpdateCarryAmount = true;
|
|
1015 |
sumDataCheck = true;
|
932 |
1016 |
break;
|
933 |
1017 |
case (int)DispColumn.CnstrPrice:
|
934 |
1018 |
depositDetail.CnstrPrice = amount;
|
935 |
1019 |
bUpdateCarryAmount = true;
|
|
1020 |
sumDataCheck = true;
|
936 |
1021 |
break;
|
937 |
1022 |
case (int)DispColumn.Fees:
|
938 |
1023 |
depositDetail.Fees = amount;
|
939 |
1024 |
bUpdateCarryAmount = true;
|
|
1025 |
sumDataCheck = true;
|
940 |
1026 |
break;
|
941 |
1027 |
case (int)DispColumn.OtherAdjustments:
|
942 |
1028 |
depositDetail.OtherAdjustments = amount;
|
943 |
1029 |
bUpdateCarryAmount = true;
|
|
1030 |
sumDataCheck = true;
|
944 |
1031 |
break;
|
945 |
1032 |
case (int)DispColumn.DifferentAmount:
|
946 |
1033 |
depositDetail.DifferenceAmount = amount;
|
|
1034 |
sumDataCheck = true;
|
947 |
1035 |
break;
|
948 |
1036 |
}
|
949 |
1037 |
long RequestAmount = depositDetail.BillPrice + depositDetail.TaxPrice;
|
... | ... | |
951 |
1039 |
// 繰越金以外を修正した場合、
|
952 |
1040 |
if (bUpdateCarryAmount == true)
|
953 |
1041 |
{
|
954 |
|
long DepositAmount = depositDetail.DepositAmount + depositDetail.DiscountAmount
|
|
1042 |
long DepositAmount = depositDetail.DepositAmount + depositDetail.TaxAmount + depositDetail.DiscountAmount
|
955 |
1043 |
+ depositDetail.CnstrPrice + depositDetail.Fees + depositDetail.OtherAdjustments;
|
956 |
1044 |
depositDetail.DifferenceAmount = DepositAmount - RequestAmount;
|
957 |
1045 |
}
|
... | ... | |
973 |
1061 |
depositDetail.Editted = true;
|
974 |
1062 |
}
|
975 |
1063 |
var headerIndex = DetectHeaderIndex(e.RowIndex);
|
976 |
|
UpdateDepositOrdererRows(depositOrderer, headerIndex);
|
|
1064 |
|
|
1065 |
//編集したカラムの修正
|
|
1066 |
UpdateDepositOrdererRows(depositOrderer, e.RowIndex);
|
|
1067 |
|
|
1068 |
//合計行の修正
|
|
1069 |
if (sumDataCheck)
|
|
1070 |
{
|
|
1071 |
var sumRowIndex = DetectSumIndex(e.RowIndex);
|
|
1072 |
var depositOrdererSum = new DepositOrderer();
|
|
1073 |
depositOrdererSum.KB = 3;
|
|
1074 |
depositOrdererSum.OrderersCode = depositOrderer.OrderersCode;
|
|
1075 |
depositOrdererSum.OrderersDivision = depositOrderer.OrderersDivision;
|
|
1076 |
depositOrdererSum.RequestMonth = depositOrderer.RequestMonth;
|
|
1077 |
UpdateDepositOrdererRows(depositOrdererSum, sumRowIndex);
|
|
1078 |
}
|
977 |
1079 |
dgvMaster.CurrentCell = dgvMaster[e.ColumnIndex, e.RowIndex];
|
978 |
1080 |
isDirty = true;
|
979 |
1081 |
}
|
... | ... | |
1012 |
1114 |
var data = new List<DepositOrderer>();
|
1013 |
1115 |
var no = 1;
|
1014 |
1116 |
|
|
1117 |
bool sumDataBool = false;
|
|
1118 |
bool lastSumDataCheck = false;
|
|
1119 |
int invoiceDataCount = invoiceData.Count();
|
|
1120 |
int dataCount = 0;
|
|
1121 |
var oSumV = new DepositOrderer();
|
|
1122 |
var oEmpty = new DepositOrderer();
|
|
1123 |
|
1015 |
1124 |
foreach (var invoice in invoiceData)
|
1016 |
1125 |
{
|
|
1126 |
// 最終行確認用
|
|
1127 |
dataCount = dataCount + 1;
|
|
1128 |
|
1017 |
1129 |
// 請求先情報
|
1018 |
1130 |
var o = new DepositOrderer();
|
1019 |
1131 |
o.KB = CommonMotions.cnvInt(invoice[(int)GetDataFirst.KB]);
|
... | ... | |
1022 |
1134 |
o.OrderersDivision = CommonMotions.cnvInt(invoice[(int)GetDataFirst.OrderersDivision]);
|
1023 |
1135 |
o.OrderersName = CommonMotions.cnvString(invoice[(int)GetDataFirst.OrderersName]);
|
1024 |
1136 |
|
1025 |
|
// 表示権限がない場合は次へ
|
1026 |
|
if (!CheckOrdererPermission(o))
|
|
1137 |
if (o.KB == 1)
|
1027 |
1138 |
{
|
1028 |
|
continue;
|
1029 |
|
}
|
|
1139 |
// 最終行ではない場合は合計行と空行を挿入する
|
|
1140 |
if (invoiceDataCount != dataCount)
|
|
1141 |
{
|
|
1142 |
if (sumDataBool == true)
|
|
1143 |
{
|
|
1144 |
// 合計行用のデータを追加
|
|
1145 |
data.Add(oSumV);
|
1030 |
1146 |
|
1031 |
|
if (o.KB == 1)
|
1032 |
|
{
|
|
1147 |
// 空行用のデータを追加
|
|
1148 |
data.Add(oEmpty);
|
|
1149 |
|
|
1150 |
sumDataBool = false;
|
|
1151 |
lastSumDataCheck = false;
|
|
1152 |
}
|
|
1153 |
}
|
1033 |
1154 |
o.No = 0;
|
1034 |
1155 |
}
|
1035 |
1156 |
else
|
1036 |
1157 |
{
|
|
1158 |
if (sumDataBool == false)
|
|
1159 |
{
|
|
1160 |
//合計行用データの作成
|
|
1161 |
var oSum = new DepositOrderer();
|
|
1162 |
var dSum = new Deposit();
|
|
1163 |
|
|
1164 |
oSum.KB = 3;
|
|
1165 |
oSum.RequestMonth = m_Select_TargetDate;
|
|
1166 |
oSum.OrderersCode = CommonMotions.cnvInt(invoice[(int)GetDataFirst.OrderersCode]);
|
|
1167 |
oSum.OrderersDivision = CommonMotions.cnvInt(invoice[(int)GetDataFirst.OrderersDivision]);
|
|
1168 |
oSum.Deposits = new List<Deposit>();
|
|
1169 |
dSum.SeqNo = CommonMotions.cnvInt(invoice[(int)GetDataFirst.SeqNoD]);
|
|
1170 |
dSum.DepositDate = CommonMotions.cnvString(invoice[(int)GetDataFirst.DepositDate]);
|
|
1171 |
dSum.DepositAmountCash = CommonMotions.cnvLong(invoice[(int)GetDataFirst.DepositAmountCash]);
|
|
1172 |
dSum.DepositAmountBill = CommonMotions.cnvLong(invoice[(int)GetDataFirst.DepositAmountBill]);
|
|
1173 |
dSum.Note = CommonMotions.cnvString(invoice[(int)GetDataFirst.NoteD]);
|
|
1174 |
oSum.Deposits.Add(dSum);
|
|
1175 |
oSumV = oSum;
|
|
1176 |
|
|
1177 |
//空行用のデータの作成
|
|
1178 |
var oEmp = new DepositOrderer();
|
|
1179 |
oEmpty.KB = 4;
|
|
1180 |
oEmp.RequestMonth = m_Select_TargetDate;
|
|
1181 |
oEmp.OrderersCode = CommonMotions.cnvInt(invoice[(int)GetDataFirst.OrderersCode]);
|
|
1182 |
oEmp.OrderersDivision = CommonMotions.cnvInt(invoice[(int)GetDataFirst.OrderersDivision]);
|
|
1183 |
oEmpty = oEmp;
|
|
1184 |
sumDataBool = true;
|
|
1185 |
lastSumDataCheck = true;
|
|
1186 |
}
|
1037 |
1187 |
o.No = no;
|
1038 |
1188 |
no++;
|
1039 |
1189 |
}
|
1040 |
|
|
1041 |
1190 |
o.Deposits = new List<Deposit>();
|
1042 |
1191 |
o.DepositDetails = new List<DepositDetail>();
|
1043 |
1192 |
|
1044 |
1193 |
// 入金データ情報
|
1045 |
|
|
1046 |
1194 |
var d = new Deposit();
|
1047 |
1195 |
d.SeqNo = CommonMotions.cnvInt(invoice[(int)GetDataFirst.SeqNoD]);
|
1048 |
1196 |
d.DepositDate = CommonMotions.cnvString(invoice[(int)GetDataFirst.DepositDate]);
|
... | ... | |
1066 |
1214 |
dd.BillPrice = CommonMotions.cnvLong(invoice[(int)GetDataFirst.BillPrice]);
|
1067 |
1215 |
dd.TaxPrice = CommonMotions.cnvLong(invoice[(int)GetDataFirst.TaxPrice]);
|
1068 |
1216 |
dd.DepositAmount = CommonMotions.cnvLong(invoice[(int)GetDataFirst.DepositAmount]);
|
|
1217 |
dd.TaxAmount = CommonMotions.cnvLong(invoice[(int)GetDataFirst.TaxAmount]);
|
1069 |
1218 |
dd.DiscountAmount = CommonMotions.cnvLong(invoice[(int)GetDataFirst.DiscountAmount]);
|
1070 |
1219 |
dd.CnstrPrice = CommonMotions.cnvLong(invoice[(int)GetDataFirst.CnstrPrice]);
|
1071 |
1220 |
dd.Fees = CommonMotions.cnvLong(invoice[(int)GetDataFirst.Fees]);
|
... | ... | |
1083 |
1232 |
dd.ConstrSubPersonCode = CommonMotions.cnvInt(invoice[(int)GetDataFirst.ConstrSubPersonCode]);
|
1084 |
1233 |
dd.ConstructionInstructor = CommonMotions.cnvInt(invoice[(int)GetDataFirst.ConstructionInstructor]);
|
1085 |
1234 |
|
1086 |
|
dd.Visible = CheckPermission(dd.DepartmentCode, dd.ConstructionPersonCode, dd.ConstrSubPersonCode, dd.ConstructionInstructor);
|
|
1235 |
//dd.Visible = CheckPermission(dd.DepartmentCode, dd.ConstructionPersonCode, dd.ConstrSubPersonCode, dd.ConstructionInstructor);
|
|
1236 |
dd.Visible = true;
|
1087 |
1237 |
dd.ConfirmationDate = "";
|
1088 |
1238 |
if (CommonMotions.cnvString(invoice[(int)GetDataFirst.ConfirmationDate]) != "0001-01-01")
|
1089 |
1239 |
dd.ConfirmationDate = CommonMotions.cnvString(invoice[(int)GetDataFirst.ConfirmationDate]);
|
... | ... | |
1091 |
1241 |
o.DepositDetails.Add(dd);
|
1092 |
1242 |
|
1093 |
1243 |
data.Add(o);
|
|
1244 |
|
|
1245 |
// 最終行かつ最後の請求データに請求書データがない場合に合計行のみ追加する
|
|
1246 |
if (lastSumDataCheck && invoiceDataCount == dataCount)
|
|
1247 |
{
|
|
1248 |
// 合計行用のデータを追加
|
|
1249 |
data.Add(oSumV);
|
|
1250 |
}
|
1094 |
1251 |
}
|
1095 |
1252 |
return data;
|
1096 |
1253 |
}
|
... | ... | |
1129 |
1286 |
sql.Append(" , NULL AS NOTE ");
|
1130 |
1287 |
sql.Append(" , NULL AS ORDERNO ");
|
1131 |
1288 |
sql.Append(" , NULL AS DEPOSITAMOUNT ");
|
|
1289 |
sql.Append(" , NULL AS TAXAMOUNT ");
|
1132 |
1290 |
sql.Append(" , NULL AS DISCOUNTAMOUNT ");
|
1133 |
1291 |
sql.Append(" , NULL AS CNSTRPRICE ");
|
1134 |
1292 |
sql.Append(" , NULL AS FEES ");
|
... | ... | |
1173 |
1331 |
sql.Append(" , NULL AS NOTE ");
|
1174 |
1332 |
sql.Append(" , H.ORDERNO ");
|
1175 |
1333 |
sql.Append(" , DPDE.DEPOSITAMOUNT ");
|
|
1334 |
sql.Append(" , DPDE.TAXAMOUNT ");
|
1176 |
1335 |
sql.Append(" , DPDE.DISCOUNTAMOUNT ");
|
1177 |
1336 |
sql.Append(" , DPDE.CNSTRPRICE ");
|
1178 |
1337 |
sql.Append(" , DPDE.FEES ");
|
... | ... | |
1329 |
1488 |
}
|
1330 |
1489 |
#endregion
|
1331 |
1490 |
|
|
1491 |
#region 入金明細の合計を取得
|
|
1492 |
/// <summary>
|
|
1493 |
/// 入金合計を取得
|
|
1494 |
/// </summary>
|
|
1495 |
/// <returns></returns>
|
|
1496 |
private ArrayList DepositDetailSumCalc(int orderersDiv, int orderersCd, int targetDate)
|
|
1497 |
{
|
|
1498 |
var ivD = new IODepositData();
|
|
1499 |
|
|
1500 |
try
|
|
1501 |
{
|
|
1502 |
var sql = new StringBuilder();
|
|
1503 |
sql.Append(" SELECT ");
|
|
1504 |
sql.Append(" SUM(DEPOSITAMOUNT) ");
|
|
1505 |
sql.Append(" , SUM(TAXAMOUNT) ");
|
|
1506 |
sql.Append(" , SUM(DISCOUNTAMOUNT) ");
|
|
1507 |
sql.Append(" , SUM(CNSTRPRICE) ");
|
|
1508 |
sql.Append(" , SUM(FEES) ");
|
|
1509 |
sql.Append(" , SUM(OTHERADJUSTMENTS) ");
|
|
1510 |
sql.Append(" , SUM(DIFFERENCEAMOUNT) ");
|
|
1511 |
sql.Append(" FROM ");
|
|
1512 |
sql.Append(" DEPOSITDATADETAIL ");
|
|
1513 |
sql.Append(" WHERE ");
|
|
1514 |
sql.AppendFormat(" ORDERERSDIVISION = {0} ", orderersDiv);
|
|
1515 |
sql.AppendFormat(" AND ORDERERSCODE = {0} ", orderersCd);
|
|
1516 |
sql.AppendFormat(" AND TARGETDATE = {0} ", targetDate);
|
|
1517 |
var data = new ArrayList();
|
|
1518 |
if (!ivD.ExecuteReader(sql.ToString(), ref data))
|
|
1519 |
{
|
|
1520 |
return new ArrayList();
|
|
1521 |
}
|
|
1522 |
return data;
|
|
1523 |
}
|
|
1524 |
catch (Exception ex)
|
|
1525 |
{
|
|
1526 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
|
1527 |
return new ArrayList();
|
|
1528 |
}
|
|
1529 |
finally
|
|
1530 |
{
|
|
1531 |
ivD.close();
|
|
1532 |
ivD = null;
|
|
1533 |
}
|
|
1534 |
}
|
|
1535 |
#endregion
|
|
1536 |
|
1332 |
1537 |
#region 変更行の内容を更新する。
|
1333 |
1538 |
/// <summary>
|
1334 |
1539 |
/// 変更行の内容を更新する。
|
... | ... | |
1380 |
1585 |
|
1381 |
1586 |
if (depositOrderer.KB == 1)
|
1382 |
1587 |
{
|
|
1588 |
// 表示権限確認
|
|
1589 |
var visibleCheck = CheckPermission(depositOrderer);
|
|
1590 |
dgvMaster.Rows[position].Visible = visibleCheck;
|
|
1591 |
|
1383 |
1592 |
// 請求先情報の表示
|
|
1593 |
ordererRow.Cells[(int)DispColumn.KB].Style.BackColor = Color.Gainsboro;
|
1384 |
1594 |
ordererRow.Cells[(int)DispColumn.No].Style.BackColor = Color.Gainsboro;
|
1385 |
1595 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Style.BackColor = Color.Gainsboro;
|
1386 |
1596 |
ordererRow.Cells[(int)DispColumn.OrderersName].Style.BackColor = Color.Gainsboro;
|
1387 |
1597 |
|
|
1598 |
ordererRow.Cells[(int)DispColumn.KB].Value = depositOrderer.KB;
|
1388 |
1599 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Value = depositOrderer.RequestMonth;
|
1389 |
1600 |
ordererRow.Cells[(int)DispColumn.OrderersDivision].Value = depositOrderer.OrderersDivision;
|
1390 |
1601 |
ordererRow.Cells[(int)DispColumn.OrderersCode].Value = depositOrderer.OrderersCode;
|
1391 |
1602 |
ordererRow.Cells[(int)DispColumn.OrderersName].Value = depositOrderer.OrderersName;
|
|
1603 |
ordererRow.Cells[(int)DispColumn.DepositAmountCash].Style.BackColor = Color.Gainsboro;
|
|
1604 |
ordererRow.Cells[(int)DispColumn.DepositAmountBill].Style.BackColor = Color.Gainsboro;
|
1392 |
1605 |
|
1393 |
|
// 入金金額の合計を算出
|
1394 |
|
int tgl = 1;
|
1395 |
|
var DepositSum = DepositSumCalc(depositOrderer.OrderersDivision, depositOrderer.OrderersCode, depositOrderer.RequestMonth, tgl).OfType<object[]>();
|
1396 |
|
int SumDepositAmountCash = 0;
|
1397 |
|
int SumDepositAmountBill = 0;
|
1398 |
|
foreach (var sum in DepositSum)
|
1399 |
|
{
|
1400 |
|
SumDepositAmountCash = CommonMotions.cnvInt(sum[0]);
|
1401 |
|
SumDepositAmountBill = CommonMotions.cnvInt(sum[1]);
|
1402 |
|
}
|
1403 |
|
|
1404 |
|
// 請求金額合計の合計を算出
|
1405 |
|
var RequestSum = RequestSumCalc(depositOrderer.OrderersDivision, depositOrderer.OrderersCode, depositOrderer.RequestMonth, tgl).OfType<object[]>();
|
1406 |
|
int SumRequestBill = 0;
|
1407 |
|
int SumRequestTax = 0;
|
1408 |
|
foreach (var sum in RequestSum)
|
1409 |
|
{
|
1410 |
|
SumRequestBill = CommonMotions.cnvInt(sum[0]);
|
1411 |
|
SumRequestTax = CommonMotions.cnvInt(sum[1]);
|
1412 |
|
}
|
1413 |
|
|
1414 |
|
|
1415 |
|
|
1416 |
|
index = 0;
|
1417 |
|
foreach (var deposit in depositOrderer.VisibleDeposits)
|
1418 |
|
{
|
1419 |
|
var row = dgvMaster.Rows[position + index];
|
1420 |
|
ordererRow.Cells[(int)DispColumn.DepositAmountCash].Style.BackColor = Color.Gainsboro;
|
1421 |
|
ordererRow.Cells[(int)DispColumn.DepositAmountBill].Style.BackColor = Color.Gainsboro;
|
1422 |
|
|
1423 |
|
SetPrice(row.Cells, (int)DispColumn.DepositAmountCash, (long)SumDepositAmountCash);
|
1424 |
|
SetPrice(row.Cells, (int)DispColumn.DepositAmountBill, (long)SumDepositAmountBill);
|
1425 |
|
index++;
|
1426 |
|
}
|
1427 |
|
|
1428 |
1606 |
// 入金明細情報の表示
|
1429 |
1607 |
index = 0;
|
1430 |
1608 |
foreach (var depositDetail in depositOrderer.VisibleDepositDetails)
|
... | ... | |
1438 |
1616 |
row.Cells[(int)DispColumn.TaxPrice].Style.BackColor = Color.Gainsboro;
|
1439 |
1617 |
row.Cells[(int)DispColumn.BillPrice].Style.BackColor = Color.Gainsboro;
|
1440 |
1618 |
|
1441 |
|
SetPrice(row.Cells, (int)DispColumn.BillPrice, SumRequestBill);
|
1442 |
|
SetPrice(row.Cells, (int)DispColumn.TaxPrice, SumRequestTax);
|
1443 |
|
|
1444 |
1619 |
row.Cells[(int)DispColumn.DepositAmount].Style.BackColor = Color.Gainsboro;
|
|
1620 |
row.Cells[(int)DispColumn.TaxAmount].Style.BackColor = Color.Gainsboro;
|
1445 |
1621 |
row.Cells[(int)DispColumn.DiscountAmount].Style.BackColor = Color.Gainsboro;
|
1446 |
1622 |
row.Cells[(int)DispColumn.CnstrPrice].Style.BackColor = Color.Gainsboro;
|
1447 |
1623 |
row.Cells[(int)DispColumn.Fees].Style.BackColor = Color.Gainsboro;
|
... | ... | |
1449 |
1625 |
row.Cells[(int)DispColumn.DifferentAmount].Style.BackColor = Color.Gainsboro;
|
1450 |
1626 |
|
1451 |
1627 |
row.Cells[(int)DispColumn.DepositAmount].ReadOnly = true;
|
|
1628 |
row.Cells[(int)DispColumn.TaxAmount].ReadOnly = true;
|
1452 |
1629 |
row.Cells[(int)DispColumn.DiscountAmount].ReadOnly = true;
|
1453 |
1630 |
row.Cells[(int)DispColumn.CnstrPrice].ReadOnly = true;
|
1454 |
1631 |
row.Cells[(int)DispColumn.Fees].ReadOnly = true;
|
... | ... | |
1465 |
1642 |
row.Cells[(int)DispColumn.PersonName].Style.BackColor = Color.Gainsboro;
|
1466 |
1643 |
row.Cells[(int)DispColumn.NoteDD].Style.BackColor = Color.Gainsboro;
|
1467 |
1644 |
|
|
1645 |
index++;
|
|
1646 |
}
|
|
1647 |
}
|
|
1648 |
// 合計行の表示
|
|
1649 |
else if (depositOrderer.KB == 3)
|
|
1650 |
{
|
|
1651 |
// 表示権限確認
|
|
1652 |
var visibleCheck = CheckPermission(depositOrderer);
|
|
1653 |
dgvMaster.Rows[position].Visible = visibleCheck;
|
1468 |
1654 |
|
1469 |
|
// 担当者承認
|
1470 |
|
if (depositDetail.ConfirmationEndFlg == 1)
|
|
1655 |
ordererRow.Cells[(int)DispColumn.KB].Value = depositOrderer.KB;
|
|
1656 |
ordererRow.Cells[(int)DispColumn.OrderersName].Value = "合計";
|
|
1657 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Value = depositOrderer.RequestMonth;
|
|
1658 |
ordererRow.Cells[(int)DispColumn.OrderersDivision].Value = depositOrderer.OrderersDivision;
|
|
1659 |
ordererRow.Cells[(int)DispColumn.OrderersCode].Value = depositOrderer.OrderersCode;
|
|
1660 |
|
|
1661 |
// 入金金額の合計を算出
|
|
1662 |
int tgl = 1;
|
|
1663 |
var DepositSum = DepositSumCalc(depositOrderer.OrderersDivision, depositOrderer.OrderersCode, depositOrderer.RequestMonth, tgl).OfType<object[]>();
|
|
1664 |
int SumDepositAmountCash = 0;
|
|
1665 |
int SumDepositAmountBill = 0;
|
|
1666 |
foreach (var sum in DepositSum)
|
|
1667 |
{
|
|
1668 |
SumDepositAmountCash = CommonMotions.cnvInt(sum[0]);
|
|
1669 |
SumDepositAmountBill = CommonMotions.cnvInt(sum[1]);
|
|
1670 |
}
|
|
1671 |
|
|
1672 |
//請求金額合計の合計を算出
|
|
1673 |
var RequestSum = RequestSumCalc(depositOrderer.OrderersDivision, depositOrderer.OrderersCode, depositOrderer.RequestMonth, tgl).OfType<object[]>();
|
|
1674 |
int SumRequestBill = 0;
|
|
1675 |
int SumRequestTax = 0;
|
|
1676 |
foreach (var sum in RequestSum)
|
|
1677 |
{
|
|
1678 |
SumRequestBill = CommonMotions.cnvInt(sum[0]);
|
|
1679 |
SumRequestTax = CommonMotions.cnvInt(sum[1]);
|
|
1680 |
}
|
|
1681 |
|
|
1682 |
SetPrice(ordererRow.Cells, (int)DispColumn.DepositAmountCash, (long)SumDepositAmountCash);
|
|
1683 |
SetPrice(ordererRow.Cells, (int)DispColumn.DepositAmountBill, (long)SumDepositAmountBill);
|
|
1684 |
|
|
1685 |
// 入金明細金額の合計を算出
|
|
1686 |
var DepositDetailSum = DepositDetailSumCalc(depositOrderer.OrderersDivision, depositOrderer.OrderersCode, depositOrderer.RequestMonth).OfType<object[]>();
|
|
1687 |
int DepositAmountSum = 0;
|
|
1688 |
int TaxAmountSum = 0;
|
|
1689 |
int DiscountAmountSum = 0;
|
|
1690 |
int CnstrPriceSum = 0;
|
|
1691 |
int FeesSum = 0;
|
|
1692 |
int OtherAdjustmentsSum = 0;
|
|
1693 |
int DifferenceAmountSum = 0;
|
|
1694 |
|
|
1695 |
for (int dgvRowCnt = 0; dgvRowCnt < dgvMaster.RowCount; dgvRowCnt++)
|
|
1696 |
{
|
|
1697 |
// 明細行が明細区分で発注者コードと発注者区分が同一のカラムの計算を行う。
|
|
1698 |
if (CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.KB].Value) == 2
|
|
1699 |
&& CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.OrderersDivision].Value) == CommonMotions.cnvInt(ordererRow.Cells[(int)DispColumn.OrderersDivision].Value)
|
|
1700 |
&& CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.OrderersCode].Value) == CommonMotions.cnvInt(ordererRow.Cells[(int)DispColumn.OrderersCode].Value))
|
1471 |
1701 |
{
|
1472 |
|
row.Cells[(int)DispColumn.PersonName].Style.ForeColor = Color.Red;
|
|
1702 |
DepositAmountSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.DepositAmount].Value);
|
|
1703 |
TaxAmountSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.TaxAmount].Value);
|
|
1704 |
DiscountAmountSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.DiscountAmount].Value);
|
|
1705 |
CnstrPriceSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.CnstrPrice].Value);
|
|
1706 |
FeesSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.Fees].Value);
|
|
1707 |
OtherAdjustmentsSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.OtherAdjustments].Value);
|
|
1708 |
DifferenceAmountSum += CommonMotions.cnvInt(dgvMaster.Rows[dgvRowCnt].Cells[(int)DispColumn.DifferentAmount].Value);
|
1473 |
1709 |
}
|
1474 |
|
// 担当者未承認
|
1475 |
|
else
|
1476 |
|
{
|
1477 |
|
row.Cells[(int)DispColumn.PersonName].Style.ForeColor = Color.Gray;
|
1478 |
|
}
|
|
1710 |
}
|
1479 |
1711 |
|
1480 |
|
index++;
|
|
1712 |
ordererRow.Cells[(int)DispColumn.No].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1713 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1714 |
ordererRow.Cells[(int)DispColumn.OrderersName].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1715 |
ordererRow.Cells[(int)DispColumn.DepositAmountCash].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1716 |
ordererRow.Cells[(int)DispColumn.DepositAmountBill].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1717 |
|
|
1718 |
ordererRow.Cells[(int)DispColumn.ConstructionCode].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1719 |
ordererRow.Cells[(int)DispColumn.RequestNo].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1720 |
ordererRow.Cells[(int)DispColumn.ConstructionName].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1721 |
ordererRow.Cells[(int)DispColumn.OrderNo].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1722 |
|
|
1723 |
ordererRow.Cells[(int)DispColumn.TaxPrice].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1724 |
ordererRow.Cells[(int)DispColumn.BillPrice].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1725 |
SetPrice(ordererRow.Cells, (int)DispColumn.BillPrice, SumRequestBill);
|
|
1726 |
SetPrice(ordererRow.Cells, (int)DispColumn.TaxPrice, SumRequestTax);
|
|
1727 |
|
|
1728 |
ordererRow.Cells[(int)DispColumn.DepositAmount].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1729 |
ordererRow.Cells[(int)DispColumn.TaxAmount].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1730 |
ordererRow.Cells[(int)DispColumn.DiscountAmount].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1731 |
ordererRow.Cells[(int)DispColumn.CnstrPrice].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1732 |
ordererRow.Cells[(int)DispColumn.Fees].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1733 |
ordererRow.Cells[(int)DispColumn.OtherAdjustments].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1734 |
if (DifferenceAmountSum < 0)
|
|
1735 |
{
|
|
1736 |
ordererRow.Cells[(int)DispColumn.DifferentAmount].Style.BackColor = Color.Yellow;
|
1481 |
1737 |
}
|
|
1738 |
else
|
|
1739 |
{
|
|
1740 |
ordererRow.Cells[(int)DispColumn.DifferentAmount].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1741 |
}
|
|
1742 |
|
|
1743 |
SetPrice(ordererRow.Cells, (int)DispColumn.DepositAmount, DepositAmountSum);
|
|
1744 |
SetPrice(ordererRow.Cells, (int)DispColumn.TaxAmount, TaxAmountSum);
|
|
1745 |
SetPrice(ordererRow.Cells, (int)DispColumn.DiscountAmount, DiscountAmountSum);
|
|
1746 |
SetPrice(ordererRow.Cells, (int)DispColumn.CnstrPrice, CnstrPriceSum);
|
|
1747 |
SetPrice(ordererRow.Cells, (int)DispColumn.Fees, FeesSum);
|
|
1748 |
SetPrice(ordererRow.Cells, (int)DispColumn.OtherAdjustments, OtherAdjustmentsSum);
|
|
1749 |
SetPrice(ordererRow.Cells, (int)DispColumn.DifferentAmount, DifferenceAmountSum);
|
|
1750 |
|
|
1751 |
ordererRow.Cells[(int)DispColumn.DepositAmount].ReadOnly = true;
|
|
1752 |
ordererRow.Cells[(int)DispColumn.TaxAmount].ReadOnly = true;
|
|
1753 |
ordererRow.Cells[(int)DispColumn.DiscountAmount].ReadOnly = true;
|
|
1754 |
ordererRow.Cells[(int)DispColumn.CnstrPrice].ReadOnly = true;
|
|
1755 |
ordererRow.Cells[(int)DispColumn.Fees].ReadOnly = true;
|
|
1756 |
ordererRow.Cells[(int)DispColumn.OtherAdjustments].ReadOnly = true;
|
|
1757 |
ordererRow.Cells[(int)DispColumn.NoteDD].ReadOnly = true;
|
|
1758 |
|
|
1759 |
ordererRow.Cells[(int)DispColumn.ConfirmationPersonCode].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1760 |
ordererRow.Cells[(int)DispColumn.ConfirmationDate].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1761 |
ordererRow.Cells[(int)DispColumn.ConfirmationEndFlg].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1762 |
ordererRow.Cells[(int)DispColumn.ConstructionPersonCode].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1763 |
ordererRow.Cells[(int)DispColumn.ConstrSubPersonCode].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1764 |
ordererRow.Cells[(int)DispColumn.ConstructionInstructor].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1765 |
ordererRow.Cells[(int)DispColumn.DepartmentCode].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1766 |
ordererRow.Cells[(int)DispColumn.PersonName].Style.BackColor = Color.LightGoldenrodYellow;
|
|
1767 |
ordererRow.Cells[(int)DispColumn.NoteDD].Style.BackColor = Color.LightGoldenrodYellow;
|
1482 |
1768 |
}
|
|
1769 |
// 空行を追加
|
|
1770 |
else if (depositOrderer.KB == 4)
|
|
1771 |
{
|
|
1772 |
// 表示権限確認
|
|
1773 |
var visibleCheck = CheckPermission(depositOrderer);
|
|
1774 |
dgvMaster.Rows[position].Visible = visibleCheck;
|
|
1775 |
|
|
1776 |
ordererRow.Cells[(int)DispColumn.KB].Value = depositOrderer.KB;
|
|
1777 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Value = depositOrderer.RequestMonth;
|
|
1778 |
ordererRow.Cells[(int)DispColumn.OrderersDivision].Value = depositOrderer.OrderersDivision;
|
|
1779 |
ordererRow.Cells[(int)DispColumn.OrderersCode].Value = depositOrderer.OrderersCode;
|
|
1780 |
|
|
1781 |
ordererRow.Cells[(int)DispColumn.No].Style.BackColor = Color.White;
|
|
1782 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Style.BackColor = Color.White;
|
|
1783 |
ordererRow.Cells[(int)DispColumn.OrderersName].Style.BackColor = Color.White;
|
|
1784 |
ordererRow.Cells[(int)DispColumn.DepositAmountCash].Style.BackColor = Color.White;
|
|
1785 |
ordererRow.Cells[(int)DispColumn.DepositAmountBill].Style.BackColor = Color.White;
|
|
1786 |
ordererRow.Cells[(int)DispColumn.ConstructionCode].Style.BackColor = Color.White;
|
|
1787 |
ordererRow.Cells[(int)DispColumn.RequestNo].Style.BackColor = Color.White;
|
|
1788 |
ordererRow.Cells[(int)DispColumn.ConstructionName].Style.BackColor = Color.White;
|
|
1789 |
ordererRow.Cells[(int)DispColumn.OrderNo].Style.BackColor = Color.White;
|
|
1790 |
ordererRow.Cells[(int)DispColumn.TaxPrice].Style.BackColor = Color.White;
|
|
1791 |
ordererRow.Cells[(int)DispColumn.BillPrice].Style.BackColor = Color.White;
|
|
1792 |
ordererRow.Cells[(int)DispColumn.DepositAmount].Style.BackColor = Color.White;
|
|
1793 |
ordererRow.Cells[(int)DispColumn.TaxAmount].Style.BackColor = Color.White;
|
|
1794 |
ordererRow.Cells[(int)DispColumn.DiscountAmount].Style.BackColor = Color.White;
|
|
1795 |
ordererRow.Cells[(int)DispColumn.CnstrPrice].Style.BackColor = Color.White;
|
|
1796 |
ordererRow.Cells[(int)DispColumn.Fees].Style.BackColor = Color.White;
|
|
1797 |
ordererRow.Cells[(int)DispColumn.OtherAdjustments].Style.BackColor = Color.White;
|
|
1798 |
ordererRow.Cells[(int)DispColumn.DifferentAmount].Style.BackColor = Color.White;
|
|
1799 |
|
|
1800 |
ordererRow.Cells[(int)DispColumn.DepositAmount].ReadOnly = true;
|
|
1801 |
ordererRow.Cells[(int)DispColumn.TaxAmount].ReadOnly = true;
|
|
1802 |
ordererRow.Cells[(int)DispColumn.DiscountAmount].ReadOnly = true;
|
|
1803 |
ordererRow.Cells[(int)DispColumn.CnstrPrice].ReadOnly = true;
|
|
1804 |
ordererRow.Cells[(int)DispColumn.Fees].ReadOnly = true;
|
|
1805 |
ordererRow.Cells[(int)DispColumn.OtherAdjustments].ReadOnly = true;
|
|
1806 |
ordererRow.Cells[(int)DispColumn.NoteDD].ReadOnly = true;
|
|
1807 |
|
|
1808 |
ordererRow.Cells[(int)DispColumn.ConfirmationPersonCode].Style.BackColor = Color.White;
|
|
1809 |
ordererRow.Cells[(int)DispColumn.ConfirmationDate].Style.BackColor = Color.White;
|
|
1810 |
ordererRow.Cells[(int)DispColumn.ConfirmationEndFlg].Style.BackColor = Color.White;
|
|
1811 |
ordererRow.Cells[(int)DispColumn.ConstructionPersonCode].Style.BackColor = Color.White;
|
|
1812 |
ordererRow.Cells[(int)DispColumn.ConstrSubPersonCode].Style.BackColor = Color.White;
|
|
1813 |
ordererRow.Cells[(int)DispColumn.ConstructionInstructor].Style.BackColor = Color.White;
|
|
1814 |
ordererRow.Cells[(int)DispColumn.DepartmentCode].Style.BackColor = Color.White;
|
|
1815 |
ordererRow.Cells[(int)DispColumn.PersonName].Style.BackColor = Color.White;
|
|
1816 |
ordererRow.Cells[(int)DispColumn.NoteDD].Style.BackColor = Color.White;
|
|
1817 |
}
|
|
1818 |
// 明細行の表示
|
1483 |
1819 |
else
|
1484 |
1820 |
{
|
|
1821 |
|
|
1822 |
// 表示権限のチェックを行う
|
|
1823 |
if (CommonMotions.LoginUserData.DepartmentCode != CommonDefine.s_GeneralAffairsDevision &&
|
|
1824 |
m_UserInfo.m_Type != CommonDefine.SecurityRankPos.SpecialAuthority)
|
|
1825 |
{
|
|
1826 |
var visibleCheck = CheckDepositDetailPermission(depositOrderer);
|
|
1827 |
dgvMaster.Rows[position].Visible = visibleCheck;
|
|
1828 |
}
|
|
1829 |
|
|
1830 |
ordererRow.Cells[(int)DispColumn.KB].Value = depositOrderer.KB;
|
1485 |
1831 |
// 請求先情報の表示
|
1486 |
1832 |
ordererRow.Cells[(int)DispColumn.No].Value = depositOrderer.No;
|
1487 |
1833 |
ordererRow.Cells[(int)DispColumn.RequestMonth].Value = depositOrderer.RequestMonth;
|
... | ... | |
1510 |
1856 |
SetPrice(row.Cells, (int)DispColumn.BillPrice, depositDetail.BillPrice);
|
1511 |
1857 |
SetPrice(row.Cells, (int)DispColumn.TaxPrice, depositDetail.TaxPrice);
|
1512 |
1858 |
SetPrice(row.Cells, (int)DispColumn.DepositAmount, depositDetail.DepositAmount);
|
|
1859 |
SetPrice(row.Cells, (int)DispColumn.TaxAmount, depositDetail.TaxAmount);
|
1513 |
1860 |
SetPrice(row.Cells, (int)DispColumn.DiscountAmount, depositDetail.DiscountAmount);
|
1514 |
1861 |
SetPrice(row.Cells, (int)DispColumn.CnstrPrice, depositDetail.CnstrPrice);
|
1515 |
1862 |
SetPrice(row.Cells, (int)DispColumn.Fees, depositDetail.Fees);
|
1516 |
1863 |
SetPrice(row.Cells, (int)DispColumn.OtherAdjustments, depositDetail.OtherAdjustments);
|
1517 |
1864 |
|
1518 |
1865 |
row.Cells[(int)DispColumn.DepositAmount].Style.BackColor = Color.LightCyan;
|
|
1866 |
row.Cells[(int)DispColumn.TaxAmount].Style.BackColor = Color.LightCyan;
|
1519 |
1867 |
row.Cells[(int)DispColumn.DiscountAmount].Style.BackColor = Color.LightCyan;
|
1520 |
1868 |
row.Cells[(int)DispColumn.CnstrPrice].Style.BackColor = Color.LightCyan;
|
1521 |
1869 |
row.Cells[(int)DispColumn.Fees].Style.BackColor = Color.LightCyan;
|
... | ... | |
1523 |
1871 |
row.Cells[(int)DispColumn.DifferentAmount].Style.BackColor = Color.LightCyan;
|
1524 |
1872 |
|
1525 |
1873 |
long RequestAmount = depositDetail.BillPrice + depositDetail.TaxPrice;
|
1526 |
|
long DepositAmount = depositDetail.DepositAmount + depositDetail.DiscountAmount
|
|
1874 |
long DepositAmount = depositDetail.DepositAmount + depositDetail.TaxAmount + depositDetail.DiscountAmount
|
1527 |
1875 |
+ depositDetail.CnstrPrice + depositDetail.Fees + depositDetail.OtherAdjustments;
|
1528 |
1876 |
depositDetail.DifferenceAmount = DepositAmount - RequestAmount;
|
1529 |
1877 |
|
... | ... | |
1545 |
1893 |
if (CanEditDepositDetail(depositDetail))
|
1546 |
1894 |
{
|
1547 |
1895 |
row.Cells[(int)DispColumn.DepositAmount].ReadOnly = false;
|
|
1896 |
row.Cells[(int)DispColumn.TaxAmount].ReadOnly = false;
|
1548 |
1897 |
row.Cells[(int)DispColumn.DiscountAmount].ReadOnly = false;
|
1549 |
1898 |
row.Cells[(int)DispColumn.CnstrPrice].ReadOnly = false;
|
1550 |
1899 |
row.Cells[(int)DispColumn.Fees].ReadOnly = false;
|
... | ... | |
1554 |
1903 |
else
|
1555 |
1904 |
{
|
1556 |
1905 |
row.Cells[(int)DispColumn.DepositAmount].ReadOnly = true;
|
|
1906 |
row.Cells[(int)DispColumn.TaxAmount].ReadOnly = true;
|
1557 |
1907 |
row.Cells[(int)DispColumn.DiscountAmount].ReadOnly = true;
|
1558 |
1908 |
row.Cells[(int)DispColumn.CnstrPrice].ReadOnly = true;
|
1559 |
1909 |
row.Cells[(int)DispColumn.Fees].ReadOnly = true;
|
... | ... | |
1685 |
2035 |
}
|
1686 |
2036 |
#endregion
|
1687 |
2037 |
|
|
2038 |
#region 指定行から合計行を検索
|
|
2039 |
/// <summary>
|
|
2040 |
/// 指定行から合計行を検索
|
|
2041 |
/// </summary>
|
|
2042 |
/// <param name="index"></param>
|
|
2043 |
/// <returns></returns>
|
|
2044 |
private int DetectSumIndex(int index)
|
|
2045 |
{
|
|
2046 |
for (var i = index; i >= 0; i++)
|
|
2047 |
{
|
|
2048 |
if (CommonMotions.cnvInt(dgvMaster.Rows[i].Cells[(int)DispColumn.KB].Value) == 3)
|
|
2049 |
{
|
|
2050 |
return i;
|
|
2051 |
}
|
|
2052 |
}
|
|
2053 |
return 0;
|
|
2054 |
}
|
|
2055 |
#endregion
|
|
2056 |
|
1688 |
2057 |
#region 入金請求先情報からヘッダ行を検索
|
1689 |
2058 |
/// <summary>
|
1690 |
2059 |
/// 入金請求先情報からヘッダ行を検索
|
... | ... | |
1754 |
2123 |
{
|
1755 |
2124 |
// ヘッダ色、-1:非表示、0:自動計算、1:総務、2:工事
|
1756 |
2125 |
int[] mc = {
|
|
2126 |
0, // KB
|
1757 |
2127 |
0, // No
|
1758 |
2128 |
-1, // ■請求月
|
1759 |
2129 |
-1, // ■請求No.
|
... | ... | |
1769 |
2139 |
1, // 入金金額 (手形)
|
1770 |
2140 |
|
1771 |
2141 |
2, // ■受付番号
|
1772 |
|
2, // 入金金額
|
|
2142 |
2, // 入金金額(税抜)
|
|
2143 |
2, // 入金金額(消費税)
|
1773 |
2144 |
2, // 値引金額
|
1774 |
2145 |
2, // 協力金
|
1775 |
2146 |
2, // 手数料
|
... | ... | |
1813 |
2184 |
}
|
1814 |
2185 |
#endregion
|
1815 |
2186 |
|
1816 |
|
#region 表示権限のチェックを実施する。
|
|
2187 |
#region 請求行の表示権限のチェックを実施する。
|
1817 |
2188 |
/// <summary>
|
1818 |
|
/// 表示権限のチェックを実施する。
|
|
2189 |
/// 請求行の表示権限のチェックを実施する。
|
1819 |
2190 |
/// </summary>
|
1820 |
2191 |
/// <param name="orderer"></param>
|
1821 |
2192 |
/// <returns></returns>
|
1822 |
|
private bool CheckOrdererPermission(DepositOrderer orderer)
|
|
2193 |
private bool CheckDepositDetailPermission(DepositOrderer depositOrderer)
|
1823 |
2194 |
{
|
|
2195 |
var ioCbi = new IOConstructionBaseInfo();
|
|
2196 |
var SalesDepCodeData = 0;
|
|
2197 |
var SalesPersonCodeData = 0;
|
|
2198 |
var SalesSubDepCodeData = 0;
|
|
2199 |
var SalesSubPersonCodeData = 0;
|
1824 |
2200 |
|
1825 |
|
// すべて表示させる
|
1826 |
|
return true;
|
|
2201 |
var ConstrDepCodeData = 0;
|
|
2202 |
var ConstructionPersonCodeData = 0;
|
|
2203 |
var ConstrSubDepCodeData = 0;
|
|
2204 |
var ConstrSubPersonCodeData = 0;
|
|
2205 |
var ConstrInstrDepCodeData = 0;
|
|
2206 |
var ConstructionInstructorData = 0;
|
1827 |
2207 |
|
1828 |
|
#region 表示権限
|
1829 |
|
//var ioDepData = new IODepositData();
|
1830 |
|
//var ioDepDtl = new IODepositDataDetail();
|
|
2208 |
try
|
|
2209 |
{
|
|
2210 |
var doDepDetails = depositOrderer.VisibleDepositDetails;
|
|
2211 |
var data = new ArrayList();
|
|
2212 |
var sql = new StringBuilder();
|
|
2213 |
sql.Append(" SELECT ");
|
|
2214 |
sql.Append(" SALESDEPCODE ");
|
|
2215 |
sql.Append(" , SALESPERSONCODE ");
|
|
2216 |
sql.Append(" , SALESSUBDEPCODE ");
|
|
2217 |
sql.Append(" , SALESSUBPERSONCODE ");
|
|
2218 |
sql.Append(" , CONSTRDEPCODE ");
|
|
2219 |
sql.Append(" , CONSTRUCTIONPERSONCODE ");
|
|
2220 |
sql.Append(" , CONSTRSUBDEPCODE ");
|
|
2221 |
sql.Append(" , CONSTRSUBPERSONCODE ");
|
|
2222 |
sql.Append(" , CONSTRINSTRDEPCODE ");
|
|
2223 |
sql.Append(" , CONSTRUCTIONINSTRUCTOR ");
|
|
2224 |
sql.Append(" FROM CONSTRUCTIONBASEINFO ");
|
|
2225 |
sql.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}; ", doDepDetails[0].ConstructionCode);
|
|
2226 |
if (!ioCbi.ExecuteReader(sql.ToString(), ref data))
|
|
2227 |
{
|
|
2228 |
return false;
|
|
2229 |
}
|
|
2230 |
foreach (object[] work in data)
|
|
2231 |
{
|
|
2232 |
SalesDepCodeData = CommonMotions.cnvInt(work[0]);
|
|
2233 |
SalesPersonCodeData = CommonMotions.cnvInt(work[1]);
|
|
2234 |
SalesSubDepCodeData = CommonMotions.cnvInt(work[2]);
|
|
2235 |
SalesSubPersonCodeData = CommonMotions.cnvInt(work[3]);
|
|
2236 |
ConstrDepCodeData = CommonMotions.cnvInt(work[4]);
|
|
2237 |
ConstructionPersonCodeData = CommonMotions.cnvInt(work[5]);
|
|
2238 |
ConstrSubDepCodeData = CommonMotions.cnvInt(work[6]);
|
|
2239 |
ConstrSubPersonCodeData = CommonMotions.cnvInt(work[7]);
|
|
2240 |
ConstrInstrDepCodeData = CommonMotions.cnvInt(work[8]);
|
|
2241 |
ConstructionInstructorData = CommonMotions.cnvInt(work[9]);
|
|
2242 |
}
|
1831 |
2243 |
|
1832 |
|
//try
|
1833 |
|
//{
|
1834 |
|
// // 全部署対象
|
1835 |
|
// if (m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.AllDepartment)
|
1836 |
|
// {
|
1837 |
|
// return true;
|
1838 |
|
// }
|
1839 |
|
|
1840 |
|
// var sql = new StringBuilder();
|
1841 |
|
// var arWork = new ArrayList();
|
1842 |
|
// sql.Length = 0;
|
1843 |
|
// var arDataPdm = new ArrayList();
|
1844 |
|
|
1845 |
|
// // 担当分のみ対象の場合
|
1846 |
|
// if (m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.InCharge)
|
1847 |
|
// {
|
1848 |
|
// sql.Append("SELECT COUNT(*) FROM DepositDataDetail DepDtl ");
|
1849 |
|
// sql.Append("INNER JOIN RequestHead ReqHead ON ");
|
1850 |
|
// sql.Append("DepDtl.RequestNo = ReqHead.RequestNo ");
|
1851 |
|
// sql.Append("INNER JOIN ConstructionBaseInfo Info ON ");
|
1852 |
|
// sql.Append("ReqHead.ReqConstructionCode = Info.ConstructionCode ");
|
1853 |
|
// sql.AppendFormat("WHERE DepDtl.OrderersDivision = {0} ", orderer.OrderersDivision);
|
1854 |
|
// sql.AppendFormat("AND DepDtl.OrderersCode = {0} ", orderer.OrderersCode);
|
1855 |
|
// sql.AppendFormat("AND DepDtl.TargetDate = {0} ", m_Select_TargetDate);
|
1856 |
|
// sql.AppendFormat("AND (Info.ConstructionPersonCode = {0} OR Info.ConstrSubPersonCode = {0} OR Info.ConstructionInstructor = {0}) ", CommonMotions.LoginUserData.PersonCode);
|
1857 |
|
// }
|
1858 |
|
// // 自部署のみ
|
1859 |
|
// else if (m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.OneDepartment)
|
1860 |
|
// {
|
1861 |
|
// sql.Append("SELECT COUNT(*) FROM DepositDataDetail DepDtl ");
|
1862 |
|
// sql.Append("INNER JOIN RequestHead ReqHead ON ");
|
1863 |
|
// sql.Append("DepDtl.RequestNo = ReqHead.RequestNo ");
|
1864 |
|
// sql.Append("INNER JOIN ConstructionBaseInfo Info ON ");
|
1865 |
|
// sql.Append("ReqHead.ReqConstructionCode = Info.ConstructionCode ");
|
1866 |
|
// sql.Append("INNER JOIN PersonInChargeMaster Prsn ON ");
|
1867 |
|
// sql.Append("Info.ConstructionPersonCode = Prsn.PersonCode ");
|
1868 |
|
// sql.AppendFormat("WHERE DepDtl.OrderersDivision = {0} ", orderer.OrderersDivision);
|
1869 |
|
// sql.AppendFormat("AND DepDtl.OrderersCode = {0} ", orderer.OrderersCode);
|
1870 |
|
// sql.AppendFormat("AND DepDtl.TargetDate = {0} ", m_Select_TargetDate);
|
1871 |
|
// sql.AppendFormat("AND Prsn.DepartmentCode = {0} ", CommonMotions.LoginUserData.DepartmentCode);
|
1872 |
|
// }
|
1873 |
|
// // 複数部署
|
1874 |
|
// else if (m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.MultiDepartment)
|
1875 |
|
// {
|
1876 |
|
// sql.Append("SELECT COUNT(*) FROM DepositDataDetail DepDtl ");
|
1877 |
|
// sql.Append("INNER JOIN RequestHead ReqHead ON ");
|
1878 |
|
// sql.Append("DepDtl.RequestNo = ReqHead.RequestNo ");
|
1879 |
|
// sql.Append("INNER JOIN ConstructionBaseInfo Info ON ");
|
1880 |
|
// sql.Append("ReqHead.ReqConstructionCode = Info.ConstructionCode ");
|
1881 |
|
// sql.Append("INNER JOIN PersonInChargeMaster Prsn ON ");
|
1882 |
|
// sql.Append("Info.ConstructionPersonCode = Prsn.PersonCode ");
|
1883 |
|
// sql.Append("INNER JOIN PersonDepartmentMaster PrsnDep ON ");
|
1884 |
|
// sql.Append("Prsn.DepartmentCode = PrsnDep.DepartmentCode ");
|
1885 |
|
// sql.AppendFormat("WHERE DepDtl.OrderersDivision = {0} ", orderer.OrderersDivision);
|
1886 |
|
// sql.AppendFormat("AND DepDtl.OrderersCode = {0} ", orderer.OrderersCode);
|
1887 |
|
// sql.AppendFormat("AND DepDtl.TargetDate = {0} ", m_Select_TargetDate);
|
1888 |
|
// sql.AppendFormat("AND PrsnDep.PersonCode = {0} ", CommonMotions.LoginUserData.PersonCode);
|
1889 |
|
|
1890 |
|
// }
|
1891 |
|
|
1892 |
|
// if (!ioDepDtl.ExecuteReader(sql.ToString(), ref arDataPdm))
|
1893 |
|
// return false;
|
1894 |
|
|
1895 |
|
// int nCount = CommonMotions.cnvInt(((object[])arDataPdm[0])[0]);
|
1896 |
|
|
1897 |
|
// // 権限を所有する工事がある場合は保持
|
1898 |
|
// if (nCount > 0)
|
1899 |
|
// {
|
1900 |
|
// return true;
|
1901 |
|
// }
|
1902 |
|
// else
|
1903 |
|
// {
|
1904 |
|
// return false;
|
1905 |
|
// }
|
1906 |
|
//}
|
1907 |
|
//catch (Exception ex)
|
1908 |
|
//{
|
1909 |
|
// logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
1910 |
|
// return false;
|
1911 |
|
//}
|
1912 |
|
//finally
|
1913 |
|
//{
|
1914 |
|
// ioDepData.close();
|
1915 |
|
// ioDepData = null;
|
1916 |
|
// ioDepDtl.close();
|
1917 |
|
// ioDepDtl = null;
|
1918 |
|
//}
|
1919 |
|
#endregion
|
|
2244 |
// 特別権限と総務は表示
|
|
2245 |
if (CommonMotions.LoginUserData.DepartmentCode == CommonDefine.s_GeneralAffairsDevision ||
|
|
2246 |
m_UserInfo.m_Type == CommonDefine.SecurityRankPos.SpecialAuthority)
|
|
2247 |
{
|
|
2248 |
return true;
|
|
2249 |
}
|
|
2250 |
// 複数部署対象、または自部署のみ対象
|
|
2251 |
else if ((m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.MultiDepartment) ||
|
|
2252 |
(m_UserInfo.m_SecRange == ClsSecurityPermission.SecRangeType.OneDepartment))
|
|
2253 |
{
|
|
2254 |
if (CommonMotions.LoginUserData.DepartmentCode == SalesDepCodeData ||
|
|
2255 |
CommonMotions.LoginUserData.DepartmentCode == SalesSubDepCodeData ||
|
|
2256 |
CommonMotions.LoginUserData.DepartmentCode == ConstrDepCodeData ||
|
|
2257 |
CommonMotions.LoginUserData.DepartmentCode == ConstrSubDepCodeData ||
|
|
2258 |
CommonMotions.LoginUserData.DepartmentCode == ConstrInstrDepCodeData)
|
|
2259 |
{
|
|
2260 |
return true;
|
|
2261 |
}
|
|
2262 |
}
|
|
2263 |
// 自分の担当の場合は表示
|
|
2264 |
else if(CommonMotions.LoginUserData.PersonCode == SalesPersonCodeData ||
|
|
2265 |
CommonMotions.LoginUserData.PersonCode == SalesSubPersonCodeData ||
|
|
2266 |
CommonMotions.LoginUserData.PersonCode == ConstructionPersonCodeData ||
|
|
2267 |
CommonMotions.LoginUserData.PersonCode == ConstrSubPersonCodeData ||
|
|
2268 |
CommonMotions.LoginUserData.PersonCode == ConstructionInstructorData)
|
|
2269 |
{
|
|
2270 |
return true;
|
|
2271 |
}
|
|
2272 |
return false;
|
|
2273 |
}
|