Fixed a bug where ad specials wasn't being processed properly. Updated the main form to add up all data in the Invoice Net Amount at Cost column instead of the Extended Retail column. Minor behavior fixes.

This commit is contained in:
2017-04-15 12:38:55 -05:00
parent c334c9aa53
commit 61f369f7fe
6 changed files with 75 additions and 23 deletions
+9 -7
View File
@@ -1,5 +1,4 @@
using System;
using System.Data.Entity.Core;
using System.Data.Entity.Infrastructure;
using System.Drawing;
using System.Drawing.Printing;
@@ -651,11 +650,13 @@ namespace AdvertsingProfitControl
invoicesDataGridView.Rows[index].Cells[1].Value = invoice.Supplier.Name;
invoicesDataGridView.Rows[index].Cells[2].Value = invoice.InvoiceNumber;
invoicesDataGridView.Rows[index].Cells[3].Value = $@"{invoice.InvoiceNetAmountAtCost:N2}";
//Net Amount Extended Retail is not the required field.
if (invoice.InvoiceNetAmountAtCost != null) _totalInvoicePurchases += (decimal)invoice.InvoiceNetAmountAtCost;
invoicesDataGridView.Rows[index].Cells[4].Value = $@"{invoice.InvoiceNetAmount:N2}";
if (invoice.InvoiceNetAmount != null) _totalInvoicePurchases += (decimal) invoice.InvoiceNetAmount;
invoicesDataGridView.Rows[index].Cells[5].Value = invoice.InvoiceNote;
}
//Add the total purchases row to the invoice table.
if(invoicesDataGridView.RowCount == 0) return;
var totalPurchaesRow = new DataGridViewRow();
invoicesDataGridView.Rows.Add(totalPurchaesRow);
invoicesDataGridView.Rows[invoicesDataGridView.Rows.Count - 1].Cells[0].Value = @"Total Purchases";
@@ -933,6 +934,12 @@ namespace AdvertsingProfitControl
}
private void DebugViewLogFiles(object sender, EventArgs e)
{
var form = new FrmLogFileViewer();
form.ShowDialog();
}
#endregion
private void ClearActiveDateYearRecords(object sender, EventArgs e)
@@ -1100,10 +1107,5 @@ namespace AdvertsingProfitControl
#endregion
private void DebugViewLogFiles(object sender, EventArgs e)
{
var form = new FrmLogFileViewer();
form.ShowDialog();
}
}
}