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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user