This commit is contained in:
Bobbie Hodgetts
2024-05-12 00:07:24 +01:00
parent a56a97031a
commit fb058fc22f
14 changed files with 920 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ using static System.ComponentModel.Design.ObjectSelectorEditor;
namespace bnhtrade.Core.Data.Database.Account namespace bnhtrade.Core.Data.Database.Account
{ {
internal class PurchaseInvoice : Connection public class PurchaseInvoice : Connection
{ {
private bnhtrade.Core.Data.Database.SqlWhereBuilder sqlBuilder; private bnhtrade.Core.Data.Database.SqlWhereBuilder sqlBuilder;

View File

@@ -44,6 +44,7 @@ namespace bnhtrade.Core.Data.Database.Account
InvoiceIdList = new List<int>(); InvoiceIdList = new List<int>();
InvoiceLineIdList = new List<int>(); InvoiceLineIdList = new List<int>();
StatusList = new List<string>(); StatusList = new List<string>();
ItemDescription = new List<string>();
} }
public Dictionary<int, Model.Account.PurchaseInvoice.Line> Read() public Dictionary<int, Model.Account.PurchaseInvoice.Line> Read()
@@ -104,6 +105,9 @@ namespace bnhtrade.Core.Data.Database.Account
sql = sql + sqlBuilder.SqlWhereString; sql = sql + sqlBuilder.SqlWhereString;
} }
// catch taxcode to add in after db read
var lineTaxCodeDict = new Dictionary<int, string>();
using (SqlConnection conn = new SqlConnection(SqlConnectionString)) using (SqlConnection conn = new SqlConnection(SqlConnectionString))
{ {
conn.Open(); conn.Open();
@@ -173,14 +177,35 @@ namespace bnhtrade.Core.Data.Database.Account
line.RecordModified = recordModified; line.RecordModified = recordModified;
line.RecordCreated = recordCreated; line.RecordCreated = recordCreated;
line.IsActive = isActive; line.IsActive = isActive;
line.AccountTaxCode = accountTaxCode;
returnList.Add(purchaseLineID, line); returnList.Add(purchaseLineID, line);
lineTaxCodeDict.Add(purchaseLineID, accountTaxCode);
} }
} }
} }
} }
} }
// read tax codes form db and add to return object
var taxcodeList = new Data.Database.Account.ReadTaxCode().GetByTaxCode(lineTaxCodeDict.Values.ToList());
foreach (var line in returnList.Values)
{
foreach(var taxcode in taxcodeList)
{
if (taxcode.TaxCode == lineTaxCodeDict[line.PurchaseLineId])
{
line.AccountTaxCode = taxcode;
break;
}
}
if (line.AccountTaxCode == null)
{
throw new Exception("Fail safe, this really shouodn't happen");
}
}
// all done
return returnList; return returnList;
} }
} }

View File

@@ -6,16 +6,7 @@ using System.Threading.Tasks;
namespace bnhtrade.Core.Logic.Account namespace bnhtrade.Core.Logic.Account
{ {
public class PurchaseInvoice public class PurchaseInvoice : Core.Data.Database.Account.PurchaseInvoice
{ {
public List<Model.Account.PurchaseInvoiceLineStatus> ReadLineStatusToList()
{
return new Data.Database.Account.PurchaseInvoiceLineStatus().Read().Values.ToList();
}
public List<Model.Account.PurchaseInvoiceLineSummary> GetLineSummary(DateTime maxDate, string lineStatus, List<string> wordSearchList)
{
return new Data.Database.Account.PurchaseInvoiceLineSummary().Read(maxDate,lineStatus, wordSearchList);
}
} }
} }

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Logic.Account
{
public class PurchaseInvoiceMisc
{
public List<Model.Account.PurchaseInvoiceLineStatus> ReadLineStatusToList()
{
return new Data.Database.Account.PurchaseInvoiceLineStatus().Read().Values.ToList();
}
public List<Model.Account.PurchaseInvoiceLineSummary> GetLineSummary(DateTime maxDate, string lineStatus, List<string> wordSearchList)
{
return new Data.Database.Account.PurchaseInvoiceLineSummary().Read(maxDate,lineStatus, wordSearchList);
}
}
}

View File

@@ -9,18 +9,71 @@ namespace bnhtrade.Core.Model.Account
public class PurchaseInvoice public class PurchaseInvoice
{ {
public int PurchaseID { get; set; } public int PurchaseID { get; set; }
public int PurchaseNumber { get; set; } public int PurchaseNumber { get; set; }
public int? RecordID { get; set; } public int? RecordID { get; set; }
public DateTime PurchaseDate { get; set; } public DateTime PurchaseDate { get; set; }
public Model.Account.Contact Contact { get; set; } public Model.Account.Contact Contact { get; set; }
public string SupplierRef { get; set; } public string SupplierRef { get; set; }
public string AccountCurrency { get; set; } public string AccountCurrency { get; set; }
public string PurchaseChannel { get; set; } public string PurchaseChannel { get; set; }
public string CurrencyCode { get; set; } public string CurrencyCode { get; set; }
public decimal PurchaseTotalAmount { get; set; }
public decimal InvoiceNetAmount
{
get
{
return InvoiceGrossAmount - InvoiceTaxAmount;
}
}
public decimal InvoiceTaxAmount
{
get
{
decimal amount = 0;
foreach (var item in InvoiceLines)
{
amount = amount + item.LineTotalTax;
}
return amount;
}
}
public decimal InvoiceGrossAmount
{
get
{
decimal amount = 0;
foreach (var item in InvoiceLines)
{
amount = amount + item.LineTotalGross;
}
return amount;
}
}
/// <summary>
/// Value stored in database to check invoice lines against
/// </summary>
public decimal InvoiceGrossAmountCheck { get; set; }
/// <summary>
/// Don't know what this is for, all the amounts in the db are gross, so this is always true
/// </summary>
public bool VatInclusiveAmounts { get; set; } public bool VatInclusiveAmounts { get; set; }
public DateTime RecordCreated { get; set; } public DateTime RecordCreated { get; set; }
public DateTime RecordModified { get; set; } public DateTime RecordModified { get; set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }
public List<Model.Account.PurchaseInvoice.Line> InvoiceLines { get; set; } public List<Model.Account.PurchaseInvoice.Line> InvoiceLines { get; set; }
@@ -28,24 +81,91 @@ namespace bnhtrade.Core.Model.Account
public class Line public class Line
{ {
public int PurchaseLineId { get; set; } public int PurchaseLineId { get; set; }
public int PurchaseId { get; set; } public int PurchaseId { get; set; }
public string Status { get; set; } public string Status { get; set; }
public string SupplierRef { get; set; } public string SupplierRef { get; set; }
public DateTime? CheckedIn { get; set; } public DateTime? CheckedIn { get; set; }
public string ItemDescription { get; set; } public string ItemDescription { get; set; }
public int ItemQuantity { get; set; } public int ItemQuantity { get; set; }
public decimal ItemNet
{
get
{
return ItemGross - ItemTax;
}
}
public decimal ItemGross { get; set; } public decimal ItemGross { get; set; }
public decimal ItemTax { get; set; } public decimal ItemTax { get; set; }
public decimal ShippingNet
{
get
{
return ShippingGross - ShippingTax;
}
}
public decimal ShippingGross { get; set; } public decimal ShippingGross { get; set; }
public decimal ShippingTax { get; set; } public decimal ShippingTax { get; set; }
public decimal OtherNet
{
get
{
return OtherGross - OtherTax;
}
}
public decimal OtherGross { get; set; } public decimal OtherGross { get; set; }
public decimal OtherTax { get; set; } public decimal OtherTax { get; set; }
public string AccountTaxCode { get; set; }
public decimal LineTotalNet
{
get
{
return (ItemGross + ShippingGross + OtherGross) - (ItemTax + ShippingTax + OtherTax);
}
}
public decimal LineTotalTax
{
get
{
return ItemTax + ShippingTax + OtherTax;
}
}
public decimal LineTotalGross
{
get
{
return ItemGross + ShippingGross + OtherGross;
}
}
public bnhtrade.Core.Model.Account.TaxCodeInfo AccountTaxCode { get; set; }
public int? Tax_AccountTransactionId { get; set; } public int? Tax_AccountTransactionId { get; set; }
public int Net_AccountChartOfId { get; set; } public int Net_AccountChartOfId { get; set; }
public int? Net_AccountTransactionId { get; set; } public int? Net_AccountTransactionId { get; set; }
public DateTime RecordCreated { get; set; } public DateTime RecordCreated { get; set; }
public DateTime RecordModified { get; set; } public DateTime RecordModified { get; set; }
public bool IsActive { get; set; } public bool IsActive { get; set; }
} }
} }

View File

@@ -9,7 +9,7 @@ namespace bnhtrade.Core.Model.Account
{ {
public class TaxCodeInfo : IValidatableObject public class TaxCodeInfo : IValidatableObject
{ {
public TaxCodeInfo(string taxCodeId, string title, string description, decimal taxRatePercent, bool isMarginSchemeRate, public TaxCodeInfo(string taxCode, string title, string description, decimal taxRatePercent, bool isMarginSchemeRate,
bool isValidOnExpense, bool isValidOnIncome, string taxType, bool isActive) bool isValidOnExpense, bool isValidOnIncome, string taxType, bool isActive)
{ {
if (TaxRate < 0) if (TaxRate < 0)
@@ -24,7 +24,7 @@ namespace bnhtrade.Core.Model.Account
throw new Exception("Tax rate is >= 100%"); throw new Exception("Tax rate is >= 100%");
} }
TaxCode = taxCodeId; TaxCode = taxCode;
TaxCodeDescription = description; TaxCodeDescription = description;
TaxRate = taxRatePercent; TaxRate = taxRatePercent;
IsMarginScheme = isMarginSchemeRate; IsMarginScheme = isMarginSchemeRate;

View File

@@ -0,0 +1,514 @@
namespace bnhtrade.gui.Forms.Account
{
partial class PurchaseInvoice
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
bsInvoice = new BindingSource(components);
textBoxEbayUsername = new TextBox();
bsContact = new BindingSource(components);
label1 = new Label();
label2 = new Label();
textBoxEbayEmail = new TextBox();
label3 = new Label();
textBoxPaypalUsername = new TextBox();
label4 = new Label();
textBoxPaypalEmail = new TextBox();
label5 = new Label();
textBoxUsername = new TextBox();
labelPurchaseInvoiceNumber = new Label();
labelSupplierRef = new Label();
textBox1 = new TextBox();
dateTimeOrderDate = new DateTimePicker();
textBoxTotalAmount = new TextBox();
textBoxTaxAmount = new TextBox();
textBoxNetAmount = new TextBox();
label6 = new Label();
label7 = new Label();
label8 = new Label();
label = new Label();
label11 = new Label();
dataGridView1 = new DataGridView();
itemDescriptionDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
statusDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
itemQuantityDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
PurchaseId = new DataGridViewTextBoxColumn();
PurchaseLineId = new DataGridViewTextBoxColumn();
ItemNet = new DataGridViewTextBoxColumn();
ShippingNet = new DataGridViewTextBoxColumn();
OtherNet = new DataGridViewTextBoxColumn();
LineTotalTax = new DataGridViewTextBoxColumn();
LineTotalGross = new DataGridViewTextBoxColumn();
bsInvoiceLines = new BindingSource(components);
textBoxOrderChannel = new TextBox();
tabControl1 = new TabControl();
tabPageAccountTransactions = new TabPage();
tabPageNotes = new TabPage();
((System.ComponentModel.ISupportInitialize)bsInvoice).BeginInit();
((System.ComponentModel.ISupportInitialize)bsContact).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)bsInvoiceLines).BeginInit();
tabControl1.SuspendLayout();
SuspendLayout();
//
// bsInvoice
//
bsInvoice.DataSource = typeof(Core.Model.Account.PurchaseInvoice);
//
// textBoxEbayUsername
//
textBoxEbayUsername.DataBindings.Add(new Binding("Text", bsContact, "ContactEbayName", true));
textBoxEbayUsername.Location = new Point(118, 83);
textBoxEbayUsername.Name = "textBoxEbayUsername";
textBoxEbayUsername.Size = new Size(215, 23);
textBoxEbayUsername.TabIndex = 0;
//
// bsContact
//
bsContact.DataSource = typeof(Core.Model.Account.Contact);
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(16, 86);
label1.Name = "label1";
label1.Size = new Size(87, 15);
label1.TabIndex = 1;
label1.Text = "ebay username";
//
// label2
//
label2.AutoSize = true;
label2.Location = new Point(16, 115);
label2.Name = "label2";
label2.Size = new Size(64, 15);
label2.TabIndex = 3;
label2.Text = "ebay email";
//
// textBoxEbayEmail
//
textBoxEbayEmail.DataBindings.Add(new Binding("Text", bsContact, "ContactEbayEmail", true));
textBoxEbayEmail.Location = new Point(118, 112);
textBoxEbayEmail.Name = "textBoxEbayEmail";
textBoxEbayEmail.Size = new Size(215, 23);
textBoxEbayEmail.TabIndex = 2;
//
// label3
//
label3.AutoSize = true;
label3.Location = new Point(16, 144);
label3.Name = "label3";
label3.Size = new Size(97, 15);
label3.TabIndex = 5;
label3.Text = "paypal username";
//
// textBoxPaypalUsername
//
textBoxPaypalUsername.DataBindings.Add(new Binding("Text", bsContact, "ContactPaypalName", true));
textBoxPaypalUsername.Location = new Point(118, 141);
textBoxPaypalUsername.Name = "textBoxPaypalUsername";
textBoxPaypalUsername.Size = new Size(215, 23);
textBoxPaypalUsername.TabIndex = 4;
//
// label4
//
label4.AutoSize = true;
label4.Location = new Point(16, 173);
label4.Name = "label4";
label4.Size = new Size(74, 15);
label4.TabIndex = 7;
label4.Text = "paypal email";
//
// textBoxPaypalEmail
//
textBoxPaypalEmail.DataBindings.Add(new Binding("Text", bsContact, "ContactPaypalEmail", true));
textBoxPaypalEmail.Location = new Point(118, 170);
textBoxPaypalEmail.Name = "textBoxPaypalEmail";
textBoxPaypalEmail.Size = new Size(215, 23);
textBoxPaypalEmail.TabIndex = 6;
//
// label5
//
label5.AutoSize = true;
label5.Location = new Point(16, 57);
label5.Name = "label5";
label5.Size = new Size(39, 15);
label5.TabIndex = 9;
label5.Text = "Name";
//
// textBoxUsername
//
textBoxUsername.DataBindings.Add(new Binding("Text", bsContact, "ContantName", true));
textBoxUsername.Location = new Point(118, 54);
textBoxUsername.Name = "textBoxUsername";
textBoxUsername.Size = new Size(215, 23);
textBoxUsername.TabIndex = 8;
//
// labelPurchaseInvoiceNumber
//
labelPurchaseInvoiceNumber.AutoSize = true;
labelPurchaseInvoiceNumber.Font = new Font("Segoe UI", 18F, FontStyle.Regular, GraphicsUnit.Point, 0);
labelPurchaseInvoiceNumber.Location = new Point(12, 9);
labelPurchaseInvoiceNumber.Name = "labelPurchaseInvoiceNumber";
labelPurchaseInvoiceNumber.Size = new Size(213, 32);
labelPurchaseInvoiceNumber.TabIndex = 10;
labelPurchaseInvoiceNumber.Text = "Purchase Invoice #";
//
// labelSupplierRef
//
labelSupplierRef.AutoSize = true;
labelSupplierRef.Location = new Point(16, 202);
labelSupplierRef.Name = "labelSupplierRef";
labelSupplierRef.Size = new Size(73, 15);
labelSupplierRef.TabIndex = 12;
labelSupplierRef.Text = "Supplier Ref.";
//
// textBox1
//
textBox1.DataBindings.Add(new Binding("Text", bsInvoice, "SupplierRef", true));
textBox1.Location = new Point(118, 199);
textBox1.Name = "textBox1";
textBox1.Size = new Size(215, 23);
textBox1.TabIndex = 11;
//
// dateTimeOrderDate
//
dateTimeOrderDate.Anchor = AnchorStyles.Top | AnchorStyles.Right;
dateTimeOrderDate.DataBindings.Add(new Binding("Value", bsInvoice, "PurchaseDate", true, DataSourceUpdateMode.Never));
dateTimeOrderDate.Location = new Point(915, 51);
dateTimeOrderDate.Name = "dateTimeOrderDate";
dateTimeOrderDate.Size = new Size(143, 23);
dateTimeOrderDate.TabIndex = 14;
//
// textBoxTotalAmount
//
textBoxTotalAmount.Anchor = AnchorStyles.Top | AnchorStyles.Right;
textBoxTotalAmount.DataBindings.Add(new Binding("Text", bsInvoice, "InvoiceGrossAmount", true));
textBoxTotalAmount.Location = new Point(915, 167);
textBoxTotalAmount.Name = "textBoxTotalAmount";
textBoxTotalAmount.Size = new Size(143, 23);
textBoxTotalAmount.TabIndex = 18;
//
// textBoxTaxAmount
//
textBoxTaxAmount.Anchor = AnchorStyles.Top | AnchorStyles.Right;
textBoxTaxAmount.DataBindings.Add(new Binding("Text", bsInvoice, "InvoiceTaxAmount", true));
textBoxTaxAmount.Location = new Point(915, 138);
textBoxTaxAmount.Name = "textBoxTaxAmount";
textBoxTaxAmount.Size = new Size(143, 23);
textBoxTaxAmount.TabIndex = 17;
//
// textBoxNetAmount
//
textBoxNetAmount.Anchor = AnchorStyles.Top | AnchorStyles.Right;
textBoxNetAmount.DataBindings.Add(new Binding("Text", bsInvoice, "InvoiceNetAmount", true));
textBoxNetAmount.Location = new Point(915, 109);
textBoxNetAmount.Name = "textBoxNetAmount";
textBoxNetAmount.Size = new Size(143, 23);
textBoxNetAmount.TabIndex = 16;
//
// label6
//
label6.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label6.AutoSize = true;
label6.Location = new Point(824, 83);
label6.Name = "label6";
label6.Size = new Size(84, 15);
label6.TabIndex = 19;
label6.Text = "Order Channel";
//
// label7
//
label7.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label7.AutoSize = true;
label7.Location = new Point(824, 141);
label7.Name = "label7";
label7.Size = new Size(69, 15);
label7.TabIndex = 20;
label7.Text = "Tax amount";
//
// label8
//
label8.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label8.AutoSize = true;
label8.Location = new Point(824, 112);
label8.Name = "label8";
label8.Size = new Size(71, 15);
label8.TabIndex = 21;
label8.Text = "Net amount";
//
// label
//
label.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label.AutoSize = true;
label.Location = new Point(824, 57);
label.Name = "label";
label.Size = new Size(64, 15);
label.TabIndex = 23;
label.Text = "Order Date";
//
// label11
//
label11.Anchor = AnchorStyles.Top | AnchorStyles.Right;
label11.AutoSize = true;
label11.Location = new Point(824, 170);
label11.Name = "label11";
label11.Size = new Size(79, 15);
label11.TabIndex = 24;
label11.Text = "Total Amount";
//
// dataGridView1
//
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dataGridView1.AutoGenerateColumns = false;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { itemDescriptionDataGridViewTextBoxColumn, statusDataGridViewTextBoxColumn, itemQuantityDataGridViewTextBoxColumn, PurchaseId, PurchaseLineId, ItemNet, ShippingNet, OtherNet, LineTotalTax, LineTotalGross });
dataGridView1.DataSource = bsInvoiceLines;
dataGridView1.Location = new Point(16, 259);
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowTemplate.Height = 30;
dataGridView1.Size = new Size(1042, 264);
dataGridView1.TabIndex = 25;
//
// itemDescriptionDataGridViewTextBoxColumn
//
itemDescriptionDataGridViewTextBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
itemDescriptionDataGridViewTextBoxColumn.DataPropertyName = "ItemDescription";
itemDescriptionDataGridViewTextBoxColumn.HeaderText = "Description";
itemDescriptionDataGridViewTextBoxColumn.Name = "itemDescriptionDataGridViewTextBoxColumn";
itemDescriptionDataGridViewTextBoxColumn.ReadOnly = true;
//
// statusDataGridViewTextBoxColumn
//
statusDataGridViewTextBoxColumn.DataPropertyName = "Status";
statusDataGridViewTextBoxColumn.HeaderText = "Status";
statusDataGridViewTextBoxColumn.Name = "statusDataGridViewTextBoxColumn";
statusDataGridViewTextBoxColumn.ReadOnly = true;
//
// itemQuantityDataGridViewTextBoxColumn
//
itemQuantityDataGridViewTextBoxColumn.DataPropertyName = "ItemQuantity";
itemQuantityDataGridViewTextBoxColumn.HeaderText = "Qty.";
itemQuantityDataGridViewTextBoxColumn.MinimumWidth = 50;
itemQuantityDataGridViewTextBoxColumn.Name = "itemQuantityDataGridViewTextBoxColumn";
itemQuantityDataGridViewTextBoxColumn.ReadOnly = true;
itemQuantityDataGridViewTextBoxColumn.Width = 50;
//
// PurchaseId
//
PurchaseId.DataPropertyName = "PurchaseId";
PurchaseId.HeaderText = "PurchaseId";
PurchaseId.Name = "PurchaseId";
PurchaseId.ReadOnly = true;
PurchaseId.Visible = false;
//
// PurchaseLineId
//
PurchaseLineId.DataPropertyName = "PurchaseLineId";
PurchaseLineId.HeaderText = "PurchaseLineId";
PurchaseLineId.Name = "PurchaseLineId";
PurchaseLineId.ReadOnly = true;
PurchaseLineId.Visible = false;
//
// ItemNet
//
ItemNet.DataPropertyName = "ItemNet";
ItemNet.HeaderText = "Item";
ItemNet.MinimumWidth = 60;
ItemNet.Name = "ItemNet";
ItemNet.ReadOnly = true;
ItemNet.Width = 60;
//
// ShippingNet
//
ShippingNet.DataPropertyName = "ShippingNet";
ShippingNet.HeaderText = "Ship";
ShippingNet.MinimumWidth = 60;
ShippingNet.Name = "ShippingNet";
ShippingNet.ReadOnly = true;
ShippingNet.Width = 60;
//
// OtherNet
//
OtherNet.DataPropertyName = "OtherNet";
OtherNet.HeaderText = "Adjust";
OtherNet.MinimumWidth = 60;
OtherNet.Name = "OtherNet";
OtherNet.ReadOnly = true;
OtherNet.Width = 60;
//
// LineTotalTax
//
LineTotalTax.DataPropertyName = "LineTotalTax";
LineTotalTax.HeaderText = "Tax";
LineTotalTax.MinimumWidth = 60;
LineTotalTax.Name = "LineTotalTax";
LineTotalTax.ReadOnly = true;
LineTotalTax.Width = 60;
//
// LineTotalGross
//
LineTotalGross.DataPropertyName = "LineTotalGross";
LineTotalGross.HeaderText = "Total";
LineTotalGross.MinimumWidth = 60;
LineTotalGross.Name = "LineTotalGross";
LineTotalGross.ReadOnly = true;
LineTotalGross.Width = 60;
//
// bsInvoiceLines
//
bsInvoiceLines.DataMember = "InvoiceLines";
bsInvoiceLines.DataSource = bsInvoice;
//
// textBoxOrderChannel
//
textBoxOrderChannel.Anchor = AnchorStyles.Top | AnchorStyles.Right;
textBoxOrderChannel.DataBindings.Add(new Binding("Text", bsInvoice, "PurchaseChannel", true));
textBoxOrderChannel.Location = new Point(915, 80);
textBoxOrderChannel.Name = "textBoxOrderChannel";
textBoxOrderChannel.Size = new Size(143, 23);
textBoxOrderChannel.TabIndex = 26;
//
// tabControl1
//
tabControl1.Controls.Add(tabPageAccountTransactions);
tabControl1.Controls.Add(tabPageNotes);
tabControl1.Location = new Point(16, 541);
tabControl1.Name = "tabControl1";
tabControl1.SelectedIndex = 0;
tabControl1.Size = new Size(1042, 197);
tabControl1.TabIndex = 27;
//
// tabPageAccountTransactions
//
tabPageAccountTransactions.Location = new Point(4, 24);
tabPageAccountTransactions.Name = "tabPageAccountTransactions";
tabPageAccountTransactions.Padding = new Padding(3);
tabPageAccountTransactions.Size = new Size(1034, 169);
tabPageAccountTransactions.TabIndex = 0;
tabPageAccountTransactions.Text = "Account Transactions";
tabPageAccountTransactions.UseVisualStyleBackColor = true;
//
// tabPageNotes
//
tabPageNotes.Location = new Point(4, 24);
tabPageNotes.Name = "tabPageNotes";
tabPageNotes.Padding = new Padding(3);
tabPageNotes.Size = new Size(1034, 169);
tabPageNotes.TabIndex = 1;
tabPageNotes.Text = "Notes";
tabPageNotes.UseVisualStyleBackColor = true;
//
// PurchaseInvoice
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1070, 750);
Controls.Add(tabControl1);
Controls.Add(textBoxOrderChannel);
Controls.Add(dataGridView1);
Controls.Add(label11);
Controls.Add(label);
Controls.Add(label8);
Controls.Add(label7);
Controls.Add(label6);
Controls.Add(textBoxTotalAmount);
Controls.Add(textBoxTaxAmount);
Controls.Add(textBoxNetAmount);
Controls.Add(dateTimeOrderDate);
Controls.Add(labelSupplierRef);
Controls.Add(textBox1);
Controls.Add(labelPurchaseInvoiceNumber);
Controls.Add(label5);
Controls.Add(textBoxUsername);
Controls.Add(label4);
Controls.Add(textBoxPaypalEmail);
Controls.Add(label3);
Controls.Add(textBoxPaypalUsername);
Controls.Add(label2);
Controls.Add(textBoxEbayEmail);
Controls.Add(label1);
Controls.Add(textBoxEbayUsername);
Name = "PurchaseInvoice";
Text = "PurchaseInvoice";
Load += PurchaseInvoice_Load;
((System.ComponentModel.ISupportInitialize)bsInvoice).EndInit();
((System.ComponentModel.ISupportInitialize)bsContact).EndInit();
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)bsInvoiceLines).EndInit();
tabControl1.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
#endregion
private BindingSource bsInvoice;
private TextBox textBoxEbayUsername;
private Label label1;
private Label label2;
private TextBox textBoxEbayEmail;
private Label label3;
private TextBox textBoxPaypalUsername;
private Label label4;
private TextBox textBoxPaypalEmail;
private Label label5;
private TextBox textBoxUsername;
private Label labelPurchaseInvoiceNumber;
private Label labelSupplierRef;
private TextBox textBox1;
private DateTimePicker dateTimeOrderDate;
private TextBox textBoxTotalAmount;
private TextBox textBoxTaxAmount;
private TextBox textBoxNetAmount;
private Label label6;
private Label label7;
private Label label8;
private Label label;
private Label label11;
private DataGridView dataGridView1;
private BindingSource bsContact;
private BindingSource bsInvoiceLines;
private DataGridViewTextBoxColumn itemDescriptionDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn statusDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn itemQuantityDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn PurchaseId;
private DataGridViewTextBoxColumn PurchaseLineId;
private DataGridViewTextBoxColumn ItemNet;
private DataGridViewTextBoxColumn ShippingNet;
private DataGridViewTextBoxColumn OtherNet;
private DataGridViewTextBoxColumn LineTotalTax;
private DataGridViewTextBoxColumn LineTotalGross;
private TextBox textBoxOrderChannel;
public TabControl tabControl1;
private TabPage tabPageAccountTransactions;
private TabPage tabPageNotes;
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace bnhtrade.gui.Forms.Account
{
public partial class PurchaseInvoice : Form
{
Core.Model.Account.PurchaseInvoice purchaseInvoice;
public PurchaseInvoice(Core.Model.Account.PurchaseInvoice purchaseInvoice)
{
InitializeComponent();
this.purchaseInvoice = purchaseInvoice;
}
private void PurchaseInvoice_Load(object sender, EventArgs e)
{
bsInvoiceLines.DataSource = purchaseInvoice;
bsContact.DataSource = purchaseInvoice.Contact;
bsInvoice.DataSource = purchaseInvoice;
labelPurchaseInvoiceNumber.Text += purchaseInvoice.PurchaseNumber.ToString("D6");
}
}
}

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="bsInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="bsContact.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>149, 21</value>
</metadata>
<metadata name="PurchaseId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PurchaseLineId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ItemNet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ShippingNet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="OtherNet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LineTotalTax.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="LineTotalGross.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bsInvoiceLines.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>257, 21</value>
</metadata>
</root>

View File

@@ -1,6 +1,6 @@
namespace bnhtrade.gui namespace bnhtrade.gui
{ {
partial class Form1 partial class Home
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@@ -41,7 +41,7 @@
purchaseLineIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn(); purchaseLineIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
lineStatusDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn(); lineStatusDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
purchaseIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn(); purchaseIdDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
bindingSource1 = new BindingSource(components); bsReceivingLines = new BindingSource(components);
buttonSearch = new Button(); buttonSearch = new Button();
comboBox1 = new ComboBox(); comboBox1 = new ComboBox();
purchaseLineStatusBindingSource = new BindingSource(components); purchaseLineStatusBindingSource = new BindingSource(components);
@@ -51,7 +51,7 @@
tabControl1.SuspendLayout(); tabControl1.SuspendLayout();
Receiving.SuspendLayout(); Receiving.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit(); ((System.ComponentModel.ISupportInitialize)bsReceivingLines).BeginInit();
((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).BeginInit(); ((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).BeginInit();
SuspendLayout(); SuspendLayout();
// //
@@ -64,7 +64,7 @@
tabControl1.Location = new Point(12, 12); tabControl1.Location = new Point(12, 12);
tabControl1.Name = "tabControl1"; tabControl1.Name = "tabControl1";
tabControl1.SelectedIndex = 0; tabControl1.SelectedIndex = 0;
tabControl1.Size = new Size(1010, 533); tabControl1.Size = new Size(1022, 533);
tabControl1.TabIndex = 0; tabControl1.TabIndex = 0;
tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged; tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged;
// //
@@ -73,7 +73,7 @@
tabPage1.Location = new Point(4, 24); tabPage1.Location = new Point(4, 24);
tabPage1.Name = "tabPage1"; tabPage1.Name = "tabPage1";
tabPage1.Padding = new Padding(3); tabPage1.Padding = new Padding(3);
tabPage1.Size = new Size(1002, 505); tabPage1.Size = new Size(1014, 505);
tabPage1.TabIndex = 0; tabPage1.TabIndex = 0;
tabPage1.Text = "Home"; tabPage1.Text = "Home";
tabPage1.UseVisualStyleBackColor = true; tabPage1.UseVisualStyleBackColor = true;
@@ -84,7 +84,7 @@
tabPage2.Location = new Point(4, 24); tabPage2.Location = new Point(4, 24);
tabPage2.Name = "tabPage2"; tabPage2.Name = "tabPage2";
tabPage2.Padding = new Padding(3); tabPage2.Padding = new Padding(3);
tabPage2.Size = new Size(1002, 505); tabPage2.Size = new Size(1014, 505);
tabPage2.TabIndex = 1; tabPage2.TabIndex = 1;
tabPage2.Text = "FBA Shipments"; tabPage2.Text = "FBA Shipments";
tabPage2.UseVisualStyleBackColor = true; tabPage2.UseVisualStyleBackColor = true;
@@ -101,7 +101,7 @@
Receiving.Location = new Point(4, 24); Receiving.Location = new Point(4, 24);
Receiving.Name = "Receiving"; Receiving.Name = "Receiving";
Receiving.Padding = new Padding(3); Receiving.Padding = new Padding(3);
Receiving.Size = new Size(1002, 505); Receiving.Size = new Size(1014, 505);
Receiving.TabIndex = 2; Receiving.TabIndex = 2;
Receiving.Text = "Receiving"; Receiving.Text = "Receiving";
Receiving.UseVisualStyleBackColor = true; Receiving.UseVisualStyleBackColor = true;
@@ -111,7 +111,7 @@
// //
labelDataGridCount.Anchor = AnchorStyles.Right; labelDataGridCount.Anchor = AnchorStyles.Right;
labelDataGridCount.ImageAlign = ContentAlignment.MiddleRight; labelDataGridCount.ImageAlign = ContentAlignment.MiddleRight;
labelDataGridCount.Location = new Point(845, 70); labelDataGridCount.Location = new Point(857, 70);
labelDataGridCount.Name = "labelDataGridCount"; labelDataGridCount.Name = "labelDataGridCount";
labelDataGridCount.RightToLeft = RightToLeft.Yes; labelDataGridCount.RightToLeft = RightToLeft.Yes;
labelDataGridCount.Size = new Size(129, 21); labelDataGridCount.Size = new Size(129, 21);
@@ -125,11 +125,14 @@
dataGridView1.AutoGenerateColumns = false; dataGridView1.AutoGenerateColumns = false;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { purchaseNumberDataGridViewTextBoxColumn, purchaseDateDataGridViewTextBoxColumn, itemDescriptionDataGridViewTextBoxColumn, purchaseLineIdDataGridViewTextBoxColumn, lineStatusDataGridViewTextBoxColumn, purchaseIdDataGridViewTextBoxColumn }); dataGridView1.Columns.AddRange(new DataGridViewColumn[] { purchaseNumberDataGridViewTextBoxColumn, purchaseDateDataGridViewTextBoxColumn, itemDescriptionDataGridViewTextBoxColumn, purchaseLineIdDataGridViewTextBoxColumn, lineStatusDataGridViewTextBoxColumn, purchaseIdDataGridViewTextBoxColumn });
dataGridView1.DataSource = bindingSource1; dataGridView1.DataSource = bsReceivingLines;
dataGridView1.Location = new Point(31, 94); dataGridView1.Location = new Point(31, 94);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1"; dataGridView1.Name = "dataGridView1";
dataGridView1.Size = new Size(943, 396); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(955, 396);
dataGridView1.TabIndex = 5; dataGridView1.TabIndex = 5;
dataGridView1.DoubleClick += dataGridView1_DoubleClick;
// //
// purchaseNumberDataGridViewTextBoxColumn // purchaseNumberDataGridViewTextBoxColumn
// //
@@ -168,9 +171,9 @@
purchaseIdDataGridViewTextBoxColumn.HeaderText = "PurchaseId"; purchaseIdDataGridViewTextBoxColumn.HeaderText = "PurchaseId";
purchaseIdDataGridViewTextBoxColumn.Name = "purchaseIdDataGridViewTextBoxColumn"; purchaseIdDataGridViewTextBoxColumn.Name = "purchaseIdDataGridViewTextBoxColumn";
// //
// bindingSource1 // bsReceivingLines
// //
bindingSource1.DataSource = typeof(Core.Model.Account.PurchaseInvoiceLineSummary); bsReceivingLines.DataSource = typeof(Core.Model.Account.PurchaseInvoiceLineSummary);
// //
// buttonSearch // buttonSearch
// //
@@ -224,20 +227,20 @@
textboxOrderSearch.TabIndex = 0; textboxOrderSearch.TabIndex = 0;
textboxOrderSearch.KeyPress += textboxOrderSearch_KeyPress; textboxOrderSearch.KeyPress += textboxOrderSearch_KeyPress;
// //
// Form1 // Home
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1034, 557); ClientSize = new Size(1046, 557);
Controls.Add(tabControl1); Controls.Add(tabControl1);
Name = "Form1"; Name = "Home";
Text = "Form1"; Text = "Form1";
Load += Form1_Load; Load += Form1_Load;
tabControl1.ResumeLayout(false); tabControl1.ResumeLayout(false);
Receiving.ResumeLayout(false); Receiving.ResumeLayout(false);
Receiving.PerformLayout(); Receiving.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit(); ((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit(); ((System.ComponentModel.ISupportInitialize)bsReceivingLines).EndInit();
((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).EndInit(); ((System.ComponentModel.ISupportInitialize)purchaseLineStatusBindingSource).EndInit();
ResumeLayout(false); ResumeLayout(false);
} }
@@ -255,7 +258,7 @@
private BindingSource purchaseLineStatusBindingSource; private BindingSource purchaseLineStatusBindingSource;
private Button buttonSearch; private Button buttonSearch;
private DataGridView dataGridView1; private DataGridView dataGridView1;
private BindingSource bindingSource1; private BindingSource bsReceivingLines;
private DataGridViewTextBoxColumn purchaseNumberDataGridViewTextBoxColumn; private DataGridViewTextBoxColumn purchaseNumberDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn purchaseDateDataGridViewTextBoxColumn; private DataGridViewTextBoxColumn purchaseDateDataGridViewTextBoxColumn;
private DataGridViewTextBoxColumn itemDescriptionDataGridViewTextBoxColumn; private DataGridViewTextBoxColumn itemDescriptionDataGridViewTextBoxColumn;

View File

@@ -1,11 +1,13 @@
using bnhtrade.gui.Forms.Account;
namespace bnhtrade.gui namespace bnhtrade.gui
{ {
public partial class Form1 : Form public partial class Home : Form
{ {
bool initTabReceiving = false; bool initTabReceiving = false;
public Form1() public Home()
{ {
InitializeComponent(); InitializeComponent();
} }
@@ -34,7 +36,7 @@ namespace bnhtrade.gui
private void InitialiseTabReceiving() private void InitialiseTabReceiving()
{ {
Cursor.Current = Cursors.WaitCursor; Cursor.Current = Cursors.WaitCursor;
purchaseLineStatusBindingSource.DataSource = new Core.Logic.Account.PurchaseInvoice().ReadLineStatusToList(); purchaseLineStatusBindingSource.DataSource = new Core.Logic.Account.PurchaseInvoiceMisc().ReadLineStatusToList();
comboBox1.SelectedIndex = 3; comboBox1.SelectedIndex = 3;
ListBoxQuery(); ListBoxQuery();
initTabReceiving = true; initTabReceiving = true;
@@ -77,12 +79,12 @@ namespace bnhtrade.gui
comboBox = comboBox1.Text; comboBox = comboBox1.Text;
} }
bindingSource1.DataSource = new Core.Logic.Account.PurchaseInvoice().GetLineSummary( bsReceivingLines.DataSource = new Core.Logic.Account.PurchaseInvoiceMisc().GetLineSummary(
dateTimeOrderSearch.Value dateTimeOrderSearch.Value
, comboBox , comboBox
, searchList); , searchList);
labelDataGridCount.Text = bindingSource1.Count.ToString(); labelDataGridCount.Text = bsReceivingLines.Count.ToString();
} }
private void bindingSource1_CurrentChanged(object sender, EventArgs e) private void bindingSource1_CurrentChanged(object sender, EventArgs e)
@@ -95,5 +97,18 @@ namespace bnhtrade.gui
ListBoxQuery(); ListBoxQuery();
textboxOrderSearch.Select(); textboxOrderSearch.Select();
} }
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
var row = dataGridView1.CurrentCell.RowIndex;
var lineSummary = (bnhtrade.Core.Model.Account.PurchaseInvoiceLineSummary)bsReceivingLines[row];
int purchaseId = lineSummary.PurchaseId;
var dbRead = new Core.Logic.Account.PurchaseInvoice();
dbRead.PurchaseInvoiceIdList = new List<int> { purchaseId };
var dbresult = dbRead.Read();
var purchaseInvoice = dbresult[purchaseId];
var form = new PurchaseInvoice(purchaseInvoice);
form.Show();
}
} }
} }

View File

@@ -117,7 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="bsReceivingLines.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>250, 17</value> <value>250, 17</value>
</metadata> </metadata>
<metadata name="purchaseLineStatusBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="purchaseLineStatusBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@@ -11,7 +11,7 @@ namespace bnhtrade.gui
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new Form1()); Application.Run(new Home());
} }
} }
} }

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Contact" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>bnhtrade.Core.Model.Account.Contact, bnhtrade.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>