プロジェクト

全般

プロフィール

リビジョン 385

山内6年以上前に追加

入金確認・入金入力画面:製品化対応完了(単体テスト済み)

差分を表示:

trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmEntryDeposit.Designer.cs
34 34
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
35 35
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
36 36
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
37
            this.dgv1 = new CustomControls.DataGridViewEX();
37
            this.dgv1 = new ProcessManagement.Forms.CustomControls.DataGridViewEX();
38 38
            this.OrderersDivision = new System.Windows.Forms.DataGridViewTextBoxColumn();
39 39
            this.OrderersCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
40 40
            this.TargetDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmEntryDeposit.cs
311 311
                    }
312 312
                    else
313 313
                    {
314
                        dgv1.Rows[i].Cells[(int)DispColumn.seqNo].Value = i;
314
                        var maxSeqNo = Dlist.Max(x => x.seqNo);
315
                        Dlist[i].AddEdit = 0;
316
                        dgv1.Rows[i].Cells[(int)DispColumn.seqNo].Value = maxSeqNo + 1;
315 317
                        dgv1.Rows[i].Cells[(int)DispColumn.depositPersonCode].Value = CommonMotions.LoginUserData.PersonCode;
316 318
                        dgv1.Rows[i].Cells[(int)DispColumn.personName].Value = CommonMotions.LoginUserData.SealPrintName;
317 319
                        dgv1.Rows[i].Cells[(int)DispColumn.personName].Style.ForeColor = Color.Gray;
......
560 562
                    {
561 563
                        return;
562 564
                    }
563
                    int seqno = (int)dgv1.Rows[e.RowIndex].Cells[(int)DispColumn.seqNo].Value + 1;
564
                    if (seqno == Dlist.Count)
565
                    int seqno = (int)dgv1.Rows[e.RowIndex].Cells[(int)DispColumn.seqNo].Value;
566
                    int maxSeq = Dlist.Max(x => x.seqNo) + 1;
567
                    if (seqno == maxSeq)
565 568
                    {
566 569
                        Dlist[e.RowIndex].AddEdit = 1;
567 570
                        isDirty = true;
......
730 733

  
731 734
                    // 入金日入力済みで入金金額が入力されていない
732 735
                    if (!string.IsNullOrEmpty(Dlist[i].depositDate)
733
                        && string.IsNullOrEmpty(Dlist[i].depositAmountCash.ToString())
734
                        && string.IsNullOrEmpty(Dlist[i].depositAmountBill.ToString()))
736
                        && (string.IsNullOrEmpty(Dlist[i].depositAmountCash.ToString()) || Dlist[i].depositAmountCash == 0)
737
                        && (string.IsNullOrEmpty(Dlist[i].depositAmountBill.ToString()) || Dlist[i].depositAmountBill == 0)
738
                       )
735 739
                    {
736 740
                        // エラー表示
737 741
                        MessageBox.Show("入金日が登録されている行に入金金額が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
......
739 743
                        return;
740 744
                    }
741 745
                    // 入金金額入力済みで入金日が入力されていない
742
                    if (string.IsNullOrEmpty(Dlist[i].depositDate)
743
                        && (!string.IsNullOrEmpty(Dlist[i].depositAmountCash.ToString())
744
                        || !string.IsNullOrEmpty(Dlist[i].depositAmountBill.ToString())))
746
                    if (string.IsNullOrEmpty(Dlist[i].depositDate) &&
747
                        (
748
                          !(string.IsNullOrEmpty(Dlist[i].depositAmountCash.ToString()) || Dlist[i].depositAmountCash == 0)
749
                           || !(string.IsNullOrEmpty(Dlist[i].depositAmountBill.ToString()) || Dlist[i].depositAmountBill == 0)
750
                        )
751
                       )
745 752
                    {
746 753
                        // エラー表示
747 754
                        MessageBox.Show("入金金額が登録されている行に入金日が入力されていません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.Designer.cs
42 42
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
43 43
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
44 44
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
45
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
46
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
45 47
            this.label3 = new System.Windows.Forms.Label();
46 48
            this.panel1 = new System.Windows.Forms.Panel();
47 49
            this.lblRequestAmount = new System.Windows.Forms.Label();
......
54 56
            this.label2 = new System.Windows.Forms.Label();
55 57
            this.btnShow = new System.Windows.Forms.Button();
56 58
            this.button1 = new System.Windows.Forms.Button();
59
            this.Registration = new System.Windows.Forms.Button();
60
            this.btnEnd = new System.Windows.Forms.Button();
61
            this.lblCellTotal = new System.Windows.Forms.Label();
62
            this.DepositBtn = new System.Windows.Forms.Button();
57 63
            this.dgvMaster = new ProcessManagement.Forms.CustomControls.DataGridViewEX();
64
            this.KB = new System.Windows.Forms.DataGridViewTextBoxColumn();
58 65
            this.No = new System.Windows.Forms.DataGridViewTextBoxColumn();
59 66
            this.RequestMonth = new System.Windows.Forms.DataGridViewTextBoxColumn();
60 67
            this.RequestNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
......
69 76
            this.DepositAmountBill = new System.Windows.Forms.DataGridViewTextBoxColumn();
70 77
            this.OrderNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
71 78
            this.DepositAmount = new System.Windows.Forms.DataGridViewTextBoxColumn();
79
            this.TaxAmount = new System.Windows.Forms.DataGridViewTextBoxColumn();
72 80
            this.DiscountAmount = new System.Windows.Forms.DataGridViewTextBoxColumn();
73 81
            this.CnstrPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
74 82
            this.Fees = new System.Windows.Forms.DataGridViewTextBoxColumn();
......
83 91
            this.DepartmentCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
84 92
            this.PersonName = new System.Windows.Forms.DataGridViewTextBoxColumn();
85 93
            this.NoteDD = new System.Windows.Forms.DataGridViewTextBoxColumn();
86
            this.Registration = new System.Windows.Forms.Button();
87
            this.btnEnd = new System.Windows.Forms.Button();
88 94
            this.panel1.SuspendLayout();
89 95
            ((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).BeginInit();
90 96
            this.SuspendLayout();
......
245 251
            this.button1.TabIndex = 3;
246 252
            this.button1.Text = "・・・";
247 253
            this.button1.UseVisualStyleBackColor = true;
248
            this.button1.Visible = false;
249 254
            this.button1.Click += new System.EventHandler(this.button1_Click);
250 255
            // 
256
            // Registration
257
            // 
258
            this.Registration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
259
            this.Registration.BackColor = System.Drawing.Color.Green;
260
            this.Registration.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
261
            this.Registration.ForeColor = System.Drawing.Color.White;
262
            this.Registration.Location = new System.Drawing.Point(1071, 585);
263
            this.Registration.Name = "Registration";
264
            this.Registration.Size = new System.Drawing.Size(120, 30);
265
            this.Registration.TabIndex = 6;
266
            this.Registration.Text = "登 録";
267
            this.Registration.UseVisualStyleBackColor = false;
268
            this.Registration.Click += new System.EventHandler(this.Registration_Click);
269
            // 
270
            // btnEnd
271
            // 
272
            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
273
            this.btnEnd.BackColor = System.Drawing.Color.Blue;
274
            this.btnEnd.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
275
            this.btnEnd.ForeColor = System.Drawing.Color.White;
276
            this.btnEnd.Location = new System.Drawing.Point(1197, 585);
277
            this.btnEnd.Name = "btnEnd";
278
            this.btnEnd.Size = new System.Drawing.Size(120, 30);
279
            this.btnEnd.TabIndex = 7;
280
            this.btnEnd.Text = "終 了";
281
            this.btnEnd.UseVisualStyleBackColor = false;
282
            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
283
            // 
284
            // lblCellTotal
285
            // 
286
            this.lblCellTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
287
            this.lblCellTotal.AutoSize = true;
288
            this.lblCellTotal.BackColor = System.Drawing.Color.Black;
289
            this.lblCellTotal.Font = new System.Drawing.Font("MS 明朝", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
290
            this.lblCellTotal.ForeColor = System.Drawing.Color.White;
291
            this.lblCellTotal.Location = new System.Drawing.Point(190, 595);
292
            this.lblCellTotal.Name = "lblCellTotal";
293
            this.lblCellTotal.Size = new System.Drawing.Size(0, 13);
294
            this.lblCellTotal.TabIndex = 31;
295
            // 
296
            // DepositBtn
297
            // 
298
            this.DepositBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
299
            this.DepositBtn.BackColor = System.Drawing.Color.Silver;
300
            this.DepositBtn.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
301
            this.DepositBtn.ForeColor = System.Drawing.Color.Black;
302
            this.DepositBtn.Location = new System.Drawing.Point(856, 585);
303
            this.DepositBtn.Name = "DepositBtn";
304
            this.DepositBtn.Size = new System.Drawing.Size(120, 30);
305
            this.DepositBtn.TabIndex = 32;
306
            this.DepositBtn.Text = "入金入力";
307
            this.DepositBtn.UseVisualStyleBackColor = false;
308
            this.DepositBtn.Click += new System.EventHandler(this.DepositBtn_Click);
309
            // 
251 310
            // dgvMaster
252 311
            // 
253 312
            this.dgvMaster.AllowUserToAddRows = false;
......
266 325
            this.dgvMaster.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
267 326
            this.dgvMaster.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
268 327
            this.dgvMaster.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
328
            this.KB,
269 329
            this.No,
270 330
            this.RequestMonth,
271 331
            this.RequestNo,
......
280 340
            this.DepositAmountBill,
281 341
            this.OrderNo,
282 342
            this.DepositAmount,
343
            this.TaxAmount,
283 344
            this.DiscountAmount,
284 345
            this.CnstrPrice,
285 346
            this.Fees,
......
305 366
            this.dgvMaster.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dgvMaster_CellBeginEdit);
306 367
            this.dgvMaster.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dgvMaster_CellFormatting);
307 368
            this.dgvMaster.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dgvMaster_CellValidating);
369
            this.dgvMaster.MouseUp += new System.Windows.Forms.MouseEventHandler(this.DataGridView_MouseUp);
308 370
            // 
371
            // KB
372
            // 
373
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
374
            this.KB.DefaultCellStyle = dataGridViewCellStyle2;
375
            this.KB.HeaderText = "行区分";
376
            this.KB.Name = "KB";
377
            this.KB.ReadOnly = true;
378
            this.KB.Resizable = System.Windows.Forms.DataGridViewTriState.False;
379
            this.KB.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
380
            this.KB.Visible = false;
381
            // 
309 382
            // No
310 383
            // 
311
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
312
            this.No.DefaultCellStyle = dataGridViewCellStyle2;
313
            this.No.Frozen = true;
384
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
385
            this.No.DefaultCellStyle = dataGridViewCellStyle3;
314 386
            this.No.HeaderText = "No.";
315 387
            this.No.Name = "No";
316 388
            this.No.ReadOnly = true;
......
355 427
            // 
356 428
            // OrderersName
357 429
            // 
358
            this.OrderersName.Frozen = true;
359 430
            this.OrderersName.HeaderText = "請求先名/請求日";
360 431
            this.OrderersName.Name = "OrderersName";
361 432
            this.OrderersName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
......
371 442
            // 
372 443
            // ConstructionName
373 444
            // 
374
            this.ConstructionName.Frozen = true;
375 445
            this.ConstructionName.HeaderText = "現場名";
376 446
            this.ConstructionName.Name = "ConstructionName";
377 447
            this.ConstructionName.ReadOnly = true;
......
380 450
            // 
381 451
            // BillPrice
382 452
            // 
383
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
384
            this.BillPrice.DefaultCellStyle = dataGridViewCellStyle3;
453
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
454
            this.BillPrice.DefaultCellStyle = dataGridViewCellStyle4;
385 455
            this.BillPrice.HeaderText = "請求金額\r\n(税抜)";
386 456
            this.BillPrice.Name = "BillPrice";
387 457
            this.BillPrice.ReadOnly = true;
......
391 461
            // 
392 462
            // TaxPrice
393 463
            // 
394
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
395
            this.TaxPrice.DefaultCellStyle = dataGridViewCellStyle4;
464
            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
465
            this.TaxPrice.DefaultCellStyle = dataGridViewCellStyle5;
396 466
            this.TaxPrice.HeaderText = "請求金額\r\n(消費税)";
397 467
            this.TaxPrice.Name = "TaxPrice";
398 468
            this.TaxPrice.ReadOnly = true;
......
402 472
            // 
403 473
            // DepositAmountCash
404 474
            // 
405
            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
406
            this.DepositAmountCash.DefaultCellStyle = dataGridViewCellStyle5;
475
            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
476
            this.DepositAmountCash.DefaultCellStyle = dataGridViewCellStyle6;
407 477
            this.DepositAmountCash.HeaderText = "入金金額\r\n(振込)";
408 478
            this.DepositAmountCash.Name = "DepositAmountCash";
409 479
            this.DepositAmountCash.ReadOnly = true;
......
413 483
            // 
414 484
            // DepositAmountBill
415 485
            // 
416
            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
417
            this.DepositAmountBill.DefaultCellStyle = dataGridViewCellStyle6;
486
            dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
487
            this.DepositAmountBill.DefaultCellStyle = dataGridViewCellStyle7;
418 488
            this.DepositAmountBill.HeaderText = "入金金額\r\n(手形)";
419 489
            this.DepositAmountBill.Name = "DepositAmountBill";
420 490
            this.DepositAmountBill.ReadOnly = true;
......
433 503
            // 
434 504
            // DepositAmount
435 505
            // 
436
            dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
437
            this.DepositAmount.DefaultCellStyle = dataGridViewCellStyle7;
438
            this.DepositAmount.HeaderText = "入金金額";
506
            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
507
            this.DepositAmount.DefaultCellStyle = dataGridViewCellStyle8;
508
            this.DepositAmount.HeaderText = "入金金額\r\n(税抜)";
439 509
            this.DepositAmount.Name = "DepositAmount";
440 510
            this.DepositAmount.ReadOnly = true;
441 511
            this.DepositAmount.Resizable = System.Windows.Forms.DataGridViewTriState.False;
442 512
            this.DepositAmount.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
443 513
            this.DepositAmount.Width = 140;
444 514
            // 
515
            // TaxAmount
516
            // 
517
            dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
518
            this.TaxAmount.DefaultCellStyle = dataGridViewCellStyle9;
519
            this.TaxAmount.HeaderText = "入金金額\r\n(消費税)";
520
            this.TaxAmount.Name = "TaxAmount";
521
            this.TaxAmount.ReadOnly = true;
522
            this.TaxAmount.Resizable = System.Windows.Forms.DataGridViewTriState.False;
523
            this.TaxAmount.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
524
            this.TaxAmount.Width = 140;
525
            // 
445 526
            // DiscountAmount
446 527
            // 
447
            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
448
            this.DiscountAmount.DefaultCellStyle = dataGridViewCellStyle8;
528
            dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
529
            this.DiscountAmount.DefaultCellStyle = dataGridViewCellStyle10;
449 530
            this.DiscountAmount.HeaderText = "値引金額";
450 531
            this.DiscountAmount.Name = "DiscountAmount";
451 532
            this.DiscountAmount.ReadOnly = true;
......
455 536
            // 
456 537
            // CnstrPrice
457 538
            // 
458
            dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
459
            this.CnstrPrice.DefaultCellStyle = dataGridViewCellStyle9;
539
            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
540
            this.CnstrPrice.DefaultCellStyle = dataGridViewCellStyle11;
460 541
            this.CnstrPrice.HeaderText = "協力金";
461 542
            this.CnstrPrice.Name = "CnstrPrice";
462 543
            this.CnstrPrice.ReadOnly = true;
......
466 547
            // 
467 548
            // Fees
468 549
            // 
469
            dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
470
            this.Fees.DefaultCellStyle = dataGridViewCellStyle10;
550
            dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
551
            this.Fees.DefaultCellStyle = dataGridViewCellStyle12;
471 552
            this.Fees.HeaderText = "手数料";
472 553
            this.Fees.Name = "Fees";
473 554
            this.Fees.ReadOnly = true;
......
477 558
            // 
478 559
            // OtherAdjustments
479 560
            // 
480
            dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
481
            this.OtherAdjustments.DefaultCellStyle = dataGridViewCellStyle11;
561
            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
562
            this.OtherAdjustments.DefaultCellStyle = dataGridViewCellStyle13;
482 563
            this.OtherAdjustments.HeaderText = "送料";
483 564
            this.OtherAdjustments.Name = "OtherAdjustments";
484 565
            this.OtherAdjustments.ReadOnly = true;
......
488 569
            // 
489 570
            // CarryAmount
490 571
            // 
491
            dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
492
            this.CarryAmount.DefaultCellStyle = dataGridViewCellStyle12;
572
            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
573
            this.CarryAmount.DefaultCellStyle = dataGridViewCellStyle14;
493 574
            this.CarryAmount.HeaderText = "差分";
494 575
            this.CarryAmount.Name = "CarryAmount";
495 576
            this.CarryAmount.ReadOnly = true;
......
555 636
            // 
556 637
            // PersonName
557 638
            // 
558
            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
559
            this.PersonName.DefaultCellStyle = dataGridViewCellStyle13;
639
            dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
640
            this.PersonName.DefaultCellStyle = dataGridViewCellStyle15;
560 641
            this.PersonName.HeaderText = "確認";
561 642
            this.PersonName.Name = "PersonName";
562 643
            this.PersonName.ReadOnly = true;
......
566 647
            // 
567 648
            // NoteDD
568 649
            // 
569
            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
570
            this.NoteDD.DefaultCellStyle = dataGridViewCellStyle14;
650
            dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
651
            this.NoteDD.DefaultCellStyle = dataGridViewCellStyle16;
571 652
            this.NoteDD.HeaderText = "備考";
572 653
            this.NoteDD.Name = "NoteDD";
573 654
            this.NoteDD.ReadOnly = true;
574 655
            this.NoteDD.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
575 656
            this.NoteDD.Width = 250;
576 657
            // 
577
            // Registration
578
            // 
579
            this.Registration.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
580
            this.Registration.BackColor = System.Drawing.Color.Green;
581
            this.Registration.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
582
            this.Registration.ForeColor = System.Drawing.Color.White;
583
            this.Registration.Location = new System.Drawing.Point(1071, 585);
584
            this.Registration.Name = "Registration";
585
            this.Registration.Size = new System.Drawing.Size(120, 30);
586
            this.Registration.TabIndex = 6;
587
            this.Registration.Text = "登 録";
588
            this.Registration.UseVisualStyleBackColor = false;
589
            this.Registration.Click += new System.EventHandler(this.Registration_Click);
590
            // 
591
            // btnEnd
592
            // 
593
            this.btnEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
594
            this.btnEnd.BackColor = System.Drawing.Color.Blue;
595
            this.btnEnd.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
596
            this.btnEnd.ForeColor = System.Drawing.Color.White;
597
            this.btnEnd.Location = new System.Drawing.Point(1197, 585);
598
            this.btnEnd.Name = "btnEnd";
599
            this.btnEnd.Size = new System.Drawing.Size(120, 30);
600
            this.btnEnd.TabIndex = 7;
601
            this.btnEnd.Text = "終 了";
602
            this.btnEnd.UseVisualStyleBackColor = false;
603
            this.btnEnd.Click += new System.EventHandler(this.btnEnd_Click);
604
            // 
605 658
            // FrmSelectPayment
606 659
            // 
607 660
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 15F);
608 661
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
609 662
            this.BackColor = System.Drawing.Color.Black;
610 663
            this.ClientSize = new System.Drawing.Size(1328, 625);
664
            this.Controls.Add(this.DepositBtn);
665
            this.Controls.Add(this.lblCellTotal);
611 666
            this.Controls.Add(this.btnEnd);
612 667
            this.Controls.Add(this.Registration);
613 668
            this.Controls.Add(this.button1);
......
626 681
            this.panel1.ResumeLayout(false);
627 682
            ((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).EndInit();
628 683
            this.ResumeLayout(false);
684
            this.PerformLayout();
629 685

  
630 686
        }
631 687

  
......
646 702
        private System.Windows.Forms.Label label8;
647 703
        private System.Windows.Forms.Label lblRequestAmount;
648 704
        private System.Windows.Forms.Label label5;
705
        private System.Windows.Forms.Label lblCellTotal;
706
        private System.Windows.Forms.Button DepositBtn;
707
        private System.Windows.Forms.DataGridViewTextBoxColumn KB;
649 708
        private System.Windows.Forms.DataGridViewTextBoxColumn No;
650 709
        private System.Windows.Forms.DataGridViewTextBoxColumn RequestMonth;
651 710
        private System.Windows.Forms.DataGridViewTextBoxColumn RequestNo;
......
660 719
        private System.Windows.Forms.DataGridViewTextBoxColumn DepositAmountBill;
661 720
        private System.Windows.Forms.DataGridViewTextBoxColumn OrderNo;
662 721
        private System.Windows.Forms.DataGridViewTextBoxColumn DepositAmount;
722
        private System.Windows.Forms.DataGridViewTextBoxColumn TaxAmount;
663 723
        private System.Windows.Forms.DataGridViewTextBoxColumn DiscountAmount;
664 724
        private System.Windows.Forms.DataGridViewTextBoxColumn CnstrPrice;
665 725
        private System.Windows.Forms.DataGridViewTextBoxColumn Fees;
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/SelectPayment/FrmSelectPayment.cs
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
            }
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

他の形式にエクスポート: Unified diff