示例#1
0
        private void SetupLists()
        {
            listView.Size     = new Size(800, 450);
            listView.Location = new Point(50, 120);

            listView.Columns.Add("Local Invoice ID", -2, HorizontalAlignment.Left);
            listView.Columns.Add("Invoice #", 100, HorizontalAlignment.Left);
            listView.Columns.Add("Customer Name", 200, HorizontalAlignment.Left);
            listView.Columns.Add("Shipping Address", 300, HorizontalAlignment.Left);
            listView.Columns.Add("Total Cost", -2, HorizontalAlignment.Left);


            listView.GridLines     = true;
            listView.Scrollable    = true;
            listView.FullRowSelect = true;
            listView.View          = System.Windows.Forms.View.Details;
            listView.DoubleClick  += listView_DoubleClick;
            this.Controls.Add(listView);

            Button viewButton = new Button();

            viewButton.Location = new Point(400, 600);
            viewButton.Size     = new Size(70, 40);
            viewButton.Text     = "View";
            viewButton.Click   += ViewButton_Click;
            this.Controls.Add(viewButton);



            list = InvoiceDatabase.SearchInvoicesByStage(3);
            foreach (Invoice l in list)
            {
                listView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.InvoiceNo.ToString(), l.customer.StoreName, l.customer.ShippingAddress, l.NetTotal.ToString("0.00") }));
            }
        }
示例#2
0
        private static void SeedInvoices(int num)
        {
            int invoiceID = 1;

            //make invoices for 5 customers
            for (int i = 1; i < num; i++)
            {
                //make 5 invoice per customer
                for (int j = 1; j < 5; j++)
                {
                    InvoiceDatabase.AddInvoice(invoiceID, i, "order" + j, "invoice" + j);

                    //make num items in each invoice
                    for (int m = 1; m < num; m++)
                    {
                        InvoiceContentsDatabase.AddInvoiceContent(invoiceID, "A" + m, m, "notes");
                    }


                    Invoice inv = new Invoice(invoiceID);
                    inv.SaveToExcel();
                    invoiceID++;
                }
            }
        }
示例#3
0
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     if (pickingListView.SelectedItems.Count > 0 || doubleCheckListView.SelectedItems.Count > 0)
     {
         var confirmResult = MessageBox.Show("Are you sure to delete this invoice?",
                                             "Confirm Delete!",
                                             MessageBoxButtons.YesNo);
         if (confirmResult == DialogResult.Yes)
         {
             foreach (ListViewItem l in pickingListView.SelectedItems)
             {
                 InvoiceDatabase.DeleteInvoice(Int32.Parse(l.SubItems[0].Text));
             }
             foreach (ListViewItem l in doubleCheckListView.SelectedItems)
             {
                 InvoiceDatabase.DeleteInvoice(Int32.Parse(l.SubItems[0].Text));
             }
             RefreshView();
         }
         else
         {
             RefreshView();
         }
     }
 }
示例#4
0
        static void SeedData()
        {
            ProvinceTaxDatabase.AddProvinceTax("ON1", 7, 5);
            ProvinceTaxDatabase.AddProvinceTax("ON2", 0, 5);
            ProvinceTaxDatabase.AddProvinceTax("BC1", 7, 12);
            ProvinceTaxDatabase.AddProvinceTax("BC2", 0, 5);
            ProvinceTaxDatabase.AddProvinceTax("BC3", 7, 5);
            ProvinceTaxDatabase.AddProvinceTax("AB1", 7, 5);


            ProductDatabase.AddProduct("12121", "Bouncy Ball", 1, "TSBK", 1.70, 2.50, 3242343, "may7");
            ProductDatabase.AddProduct("34523", "PlayDough", 6, "TS", 3.90, 4.99, 3453453, "discontinued");
            ProductDatabase.AddProduct("78666", "U-Fidget", 15, "TS", 1.25, 2.00, 5645334, "discontinued");
            ProductDatabase.AddProduct("34513", "Kaleidoscope", 20, "TS", 5.50, 6.50, 6433423, "jn9");
            ProductDatabase.AddProduct("89798", "PlayDough", 8, "TS", 1.20, 2.50, 2565443, "discontinued");
            ProductDatabase.AddProduct("45323", "Sidewalk Chalk", 12, "TS00", 5.50, 7.00, 4534634);
            ProductDatabase.AddProduct("89675", "Rubber Duck", 5, "TSD", 1.90, 2.20, 9678565);
            ProductDatabase.AddProduct("34921", "Baseball", 20, "TS2", 3.00, 3.50, 3527657);
            ProductDatabase.AddProduct("90243", "SuperSoaker", 1, "TS3", 10.50, 12.50, 7687432);
            ProductDatabase.AddProduct("43424", "Diving Sub", 10, "TS1", 3.50, 4.00, 1787424);
            ProductDatabase.AddProduct("42131", "Geo Twister", 4, "TS1", 1.50, 2.00, 2437583);
            ProductDatabase.AddProduct("14513", "Chicken Flingers", 16, "TS1", 8.50, 10.00, 5898275);
            ProductDatabase.AddProduct("24235", "Stunt Flyer", 18, "TS1", 4.00, 4.50, 4980240);



            CustomerDatabase.AddCustomer("Splash Toys", "", "*****@*****.**", "1201 Main st, Vancouver, BC  V6G9K7", "1201 Main st, Vancouver, BC  V6G9K7", "Nicole", "6047990643", "net30", "fedex", "BC2", "Kyle");
            CustomerDatabase.AddCustomer("Kaboodles", "", "*****@*****.**", "5601 Broadway st, Vancouver, BC  L6G9K7", "5601 Broadway st, Vancouver, BC  L6G9K7", "Ben", "6047342643", "credit", "canpar", "BC3", "Jake");
            CustomerDatabase.AddCustomer("Childrens Hospital", "Gift Shop", "*****@*****.**", "8901 Cambie st, Vancouver, BC  H7J9K0", "8901 Cambie st, Vancouver, BC  H7J9K0", "Sammy", "6045690643", "net30", "canpar", "BC1", "Kyle");
            CustomerDatabase.AddCustomer("Science World Edmonton", "Gift Shop", "*****@*****.**", "4745 Main st, Edmonton, AB  K7G5F4", "4745 Main st, Edmonton, AB  K7G5F4", "Julie", "6047670643", "net30", "canpar", "AB1", "Mike");

            int custID;

            custID = CustomerDatabase.GetStoreID("Splash Toys", "1201 Main st, Vancouver, BC  V6G9K7");
            InvoiceDatabase.AddInvoice(custID, "2312343", "", "", 0, 0, 0, 0, 1);
            InvoiceDatabase.UpdateBackorderSpecialNotes(custID, "monday only not friday");
            InvoiceContentsDatabase.AddInvoiceContent(1, "12121", 10, "2 Red");
            InvoiceContentsDatabase.AddInvoiceContent(1, "24235", 8, "");
            InvoiceContentsDatabase.AddInvoiceContent(1, "89675", 12, "1 Pink");
            InvoiceContentsDatabase.AddInvoiceContent(1, "90243", 2, "");
            InvoiceContentsDatabase.AddInvoiceContent(1, "43424", 5, "");

            custID = CustomerDatabase.GetStoreID("Kaboodles", "5601 Broadway st, Vancouver, BC  L6G9K7");
            InvoiceDatabase.AddInvoice(custID, "2312343", "", "", 0, 0, 0, 0, 2);
            InvoiceContentsDatabase.AddInvoiceContent(2, "45323", 10, "3 blue");
            InvoiceContentsDatabase.AddInvoiceContent(2, "34523", 8, "");
            InvoiceContentsDatabase.AddInvoiceContent(2, "34513", 12, "1 Pink");
            InvoiceContentsDatabase.AddInvoiceContent(2, "89798", 2, "");
            InvoiceContentsDatabase.AddInvoiceContent(2, "42131", 5, "");
        }
示例#5
0
 private void RefreshView()
 {
     foreach (ListViewItem lvItem in listView.Items)
     {
         listView.Items.Remove(lvItem);
     }
     if (invoices_textBox.Text.Length == 0)
     {
         list = InvoiceDatabase.SearchInvoicesByStage(3);
     }
     else
     {
         list = InvoiceDatabase.SearchInvoicesByInvoiceNo(this.Controls["invoices_textBox"].Text);
     }
     foreach (Invoice i in list)
     {
         listView.Items.Add(new ListViewItem(new String[] { i.InvoiceID.ToString(), i.InvoiceNo, i.customer.StoreName, i.customer.ShippingAddress, i.NetTotal.ToString("0.00") }));
     }
 }
示例#6
0
        private void RefreshView()
        {
            foreach (ListViewItem lvItem in pickingListView.Items)
            {
                pickingListView.Items.Remove(lvItem);
            }

            pickingList = InvoiceDatabase.GetAllInvoices();

            foreach (Invoice l in pickingList)
            {
                pickingListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.StreetAddress }));
            }

            pickingListView.Columns[2].Width = 180;
            if (pickingListView.Items.Count != 0)
            {
                pickingListView.EnsureVisible(pickingListView.Items.Count - 1);
            }
        }
示例#7
0
 private void RefreshView()
 {
     foreach (ListViewItem lvItem in pickingListView.Items)
     {
         pickingListView.Items.Remove(lvItem);
     }
     foreach (ListViewItem lvItem in doubleCheckListView.Items)
     {
         doubleCheckListView.Items.Remove(lvItem);
     }
     pickingList     = InvoiceDatabase.SearchInvoicesByStage(1);
     doubleCheckList = InvoiceDatabase.SearchInvoicesByStage(2);
     foreach (Invoice l in pickingList)
     {
         pickingListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.ShippingAddress }));
     }
     foreach (Invoice l in doubleCheckList)
     {
         doubleCheckListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.ShippingAddress }));
     }
 }
示例#8
0
 private void MoveButton_Click(object sender, EventArgs e)
 {
     if (doubleCheckListView.SelectedItems.Count > 0)
     {
         var confirmResult = MessageBox.Show("Are you sure you want to move these to the Double Checking Stage?",
                                             "Confirm Delete!!",
                                             MessageBoxButtons.YesNo);
         if (confirmResult == DialogResult.Yes)
         {
             foreach (ListViewItem l in doubleCheckListView.SelectedItems)
             {
                 InvoiceDatabase.UpdateStage(Int32.Parse(l.SubItems[0].Text), 1);
             }
             RefreshView();
         }
         else
         {
             // If 'No', do something here.
         }
     }
 }
示例#9
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            Customer cust = CustomerDatabase.SearchCustomersByID(customerID);

            for (int i = 0; i < invoiceContentsList.Count; i++)
            {
                int    numBO;
                String itemNo  = this.panel1.Controls["itemNumber" + i].Text;
                String notes   = this.panel1.Controls["specialNotes" + i].Text;
                int    qty     = Int32.Parse(this.panel1.Controls["qty" + i].Text);
                int    entryID = InvoiceContentsDatabase.GetEntryID(invoice.InvoiceID, itemNo);

                if (invoiceContentsList[i].Backorder > 0)
                {
                    numBO = Int32.Parse(this.panel1.Controls["backorder" + i].Text);
                    InvoiceContentsDatabase.EditInvoiceContent(entryID, invoice.InvoiceID, itemNo, qty, notes);
                    InvoiceContentsDatabase.UpdateBackorder(entryID, qty - numBO);
                    InvoiceContentsDatabase.UpdateBackorderSpecialNotes(entryID, this.panel1.Controls["backorderNotes" + i].Text);
                }
            }
            InvoiceDatabase.EditInvoice(invoice.InvoiceID, cust.StoreID, invoice.PurchaseOrder, invoice.SpecialNotes, 0, Single.Parse(this.Controls["subTotalAmount"].Text), Single.Parse(this.Controls["gst"].Text), Single.Parse(this.Controls["pst"].Text), Single.Parse(this.Controls["invoiceTotal"].Text), 3);
        }
示例#10
0
文件: InvoiceForm.cs 项目: shewmj/gww
        private void OkButton_Click(object sender, EventArgs e)
        {
            bool valid = true;

            for (int j = 0; j < i; j++)
            {
                if (this.panel1.Controls["qty" + j].Text.Length == 0 & this.panel1.Controls["itemNumber" + j].Text.Length != 0)
                {
                    valid = false;
                    this.panel1.Controls["qty" + j].BackColor = Color.Red;
                }

                if (this.panel1.Controls["qty" + j].Text.Length != 0 & this.panel1.Controls["itemNumber" + j].Text.Length == 0)
                {
                    valid = false;
                    this.panel1.Controls["itemNumber" + j].BackColor = Color.Red;
                }
                if (this.panel1.Controls["qty" + j].Text.Length == 1 && this.panel1.Controls["qty" + j].Text == "-")
                {
                    valid = false;
                    this.panel1.Controls["qty" + j].BackColor = Color.Red;
                }
            }

            if (valid == true)
            {
                var confirmResult = MessageBox.Show("Are you sure this invoice is complete?",
                                                    "Confirm Completion!!",
                                                    MessageBoxButtons.YesNo);
                if (confirmResult == DialogResult.Yes)
                {
                    Customer cust = CustomerDatabase.SearchCustomersByID(customerID);
                    int      invoiceID;


                    invoiceID = InvoiceDatabase.AddInvoice(customerID, this.Controls["purchaseOrder"].Text, "");


                    for (int j = 0; j < i; j++)
                    {
                        if (this.panel1.Controls["qty" + j].Text.Length != 0)
                        {
                            String itemNo = this.panel1.Controls["itemNumber" + j].Text;
                            int    qty    = Int32.Parse(this.panel1.Controls["qty" + j].Text);
                            String notes  = this.panel1.Controls["specialNotes" + j].Text;
                            InvoiceContentsDatabase.AddInvoiceContent(invoiceID, itemNo, qty, notes);
                        }
                    }

                    Invoice invoice = new Invoice(invoiceID);
                    invoice.SaveToExcel();
                    finished = true;

                    this.Close();
                }
                else
                {
                    // If 'No', do something here.
                }
            }
        }
示例#11
0
        private void SetupLists()
        {
            Label pickingLabel = new System.Windows.Forms.Label();

            pickingLabel.AutoSize = true;
            pickingLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 13.875F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            pickingLabel.Location = new System.Drawing.Point(210, 95);
            pickingLabel.Size     = new System.Drawing.Size(238, 42);
            pickingLabel.TabIndex = 0;
            pickingLabel.Text     = "INVOICES";
            this.Controls.Add(pickingLabel);

            pickingListView.Size     = new Size(500, 450);
            pickingListView.Location = new Point(50, 120);

            pickingListView.Columns.Add("Local Invoice ID", -2, HorizontalAlignment.Left);
            pickingListView.Columns.Add("Customer Name", 200, HorizontalAlignment.Left);
            pickingListView.Columns.Add("Shipping Address", 200, HorizontalAlignment.Left);

            pickingListView.GridLines     = true;
            pickingListView.Scrollable    = true;
            pickingListView.FullRowSelect = true;
            pickingListView.View          = System.Windows.Forms.View.Details;
            pickingListView.DoubleClick  += PickingListView_DoubleClick;
            pickingListView.Enter        += PickingListView_Enter;
            this.Controls.Add(pickingListView);


            Button refreshButton = new Button();

            refreshButton.Location = new Point(50, 60);
            refreshButton.Size     = new Size(70, 40);
            refreshButton.Text     = "Refresh";
            refreshButton.Click   += RefreshButton_Click;
            this.Controls.Add(refreshButton);


            Button deleteButton = new Button();

            deleteButton.Location = new Point(225, 600);
            deleteButton.Size     = new Size(70, 40);
            deleteButton.Text     = "Delete";
            deleteButton.Click   += DeleteButton_Click;
            this.Controls.Add(deleteButton);


            Button printButton = new Button();

            printButton.Location = new Point(305, 600);
            printButton.Size     = new Size(60, 40);
            printButton.Text     = "Print";
            printButton.Click   += PrintButton_Click;
            this.Controls.Add(printButton);

            pickingList = InvoiceDatabase.GetAllInvoices();

            foreach (Invoice l in pickingList)
            {
                pickingListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.StreetAddress }));
            }
        }
示例#12
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            var confirmResult = MessageBox.Show("Are you sure this invoice is complete?",
                                                "Confirm Completion!!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                Customer cust = CustomerDatabase.SearchCustomersByID(customerID);

                for (int i = 0; i < invoiceContentsList.Count; i++)
                {
                    int    numBO;
                    String itemNo  = this.panel1.Controls["itemNumber" + i].Text;
                    String notes   = this.panel1.Controls["specialNotes" + i].Text;
                    int    qty     = Int32.Parse(this.panel1.Controls["qty" + i].Text);
                    int    entryID = InvoiceContentsDatabase.GetEntryID(invoice.InvoiceID, itemNo);

                    if (this.panel1.Controls["backorder" + i].Text.Length == 0)
                    {
                        InvoiceContentsDatabase.EditInvoiceContent(entryID, invoice.InvoiceID, itemNo, qty, notes);
                        continue;
                    }
                    else
                    {
                        numBO = Int32.Parse(this.panel1.Controls["backorder" + i].Text);
                        InvoiceContentsDatabase.EditInvoiceContent(entryID, invoice.InvoiceID, itemNo, qty, notes);
                        InvoiceContentsDatabase.UpdateBackorder(entryID, qty - numBO);
                        InvoiceContentsDatabase.UpdateBackorderSpecialNotes(entryID, this.panel1.Controls["backorderNotes" + i].Text);
                    }
                }
                InvoiceDatabase.EditInvoice(invoice.InvoiceID, cust.StoreID, invoice.PurchaseOrder, invoice.SpecialNotes, 0, Single.Parse(this.Controls["subTotalAmount"].Text), Single.Parse(this.Controls["gst"].Text), Single.Parse(this.Controls["pst"].Text), Single.Parse(this.Controls["invoiceTotal"].Text), 2);

                // Query DB for Invoice
                Invoice printInvoice = new Invoice(invoice.InvoiceID);

                // Define & populate Object to define Table columns for datasource in .rdlc Report
                List <InvoiceItemDetail> invoiceItemDetails;
                invoiceItemDetails = new List <InvoiceItemDetail>();

                for (int i = 0; i < printInvoice.Items.Count; i++)
                {
                    invoiceItemDetails.Add(new InvoiceItemDetail());
                    invoiceItemDetails[i].InvoiceID = invoice.InvoiceID;

                    // Quantity not updated in DB; Subtraction required
                    int SubQuantity = printInvoice.Items[i].Quantity - printInvoice.Items[i].BackOrder;

                    // Invoice Data
                    invoiceItemDetails[i].QTY                  = SubQuantity;
                    invoiceItemDetails[i].GrabCarton           = printInvoice.Items[i].Quantity / printInvoice.Items[i].PerCarton;
                    invoiceItemDetails[i].ItemNo               = printInvoice.Items[i].ItemNo;
                    invoiceItemDetails[i].Location             = printInvoice.Items[i].Location;
                    invoiceItemDetails[i].Description          = printInvoice.Items[i].ItemDesc;
                    invoiceItemDetails[i].CartonTotal          = printInvoice.Items[i].PerCarton;
                    invoiceItemDetails[i].InvoiceItemSellPrice = printInvoice.Items[i].SellPrice;
                    invoiceItemDetails[i].InvoiceItemAmount    = SubQuantity * printInvoice.Items[i].SellPrice;
                    invoiceItemDetails[i].InvoiceItemNote      = printInvoice.Items[i].SpecialNotes;

                    // Backorder Data
                    invoiceItemDetails[i].Backorder           = printInvoice.Items[i].BackOrder;
                    invoiceItemDetails[i].BackorderGrabCarton = printInvoice.Items[i].BackOrder / printInvoice.Items[i].PerCarton;
                    invoiceItemDetails[i].BackorderNote       = printInvoice.Items[i].BackOrderSpecialNotes;
                }

                Form PrintForm = new PrintInvoiceProgress(printInvoice, invoiceItemDetails);
                PrintForm.ShowDialog();

                this.Close();
            }
            else
            {
                // If 'No', do something here.
            }
        }
示例#13
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            bool valid = true;

            for (int j = 0; j < i; j++)
            {
                if (this.panel1.Controls["qty" + j].Text.Length == 0 & this.panel1.Controls["itemNumber" + j].Text.Length != 0)
                {
                    valid = false;
                    this.panel1.Controls["qty" + j].BackColor = Color.Red;
                }

                if (this.panel1.Controls["qty" + j].Text.Length != 0 & this.panel1.Controls["itemNumber" + j].Text.Length == 0)
                {
                    valid = false;
                    this.panel1.Controls["itemNumber" + j].BackColor = Color.Red;
                }
                if (this.panel1.Controls["qty" + j].Text.Length == 1 && this.panel1.Controls["qty" + j].Text == "-")
                {
                    valid = false;
                    this.panel1.Controls["qty" + j].BackColor = Color.Red;
                }
            }

            if (valid == true)
            {
                var confirmResult = MessageBox.Show("Are you sure this invoice is complete?",
                                                    "Confirm Completion!!",
                                                    MessageBoxButtons.YesNo);
                if (confirmResult == DialogResult.Yes)
                {
                    Customer cust = CustomerDatabase.SearchCustomersByID(customerID);
                    int      invoiceID;
                    if (PST)
                    {
                        invoiceID = InvoiceDatabase.AddInvoice(customerID, this.Controls["purchaseOrder"].Text, this.Controls["invoiceSpecialNotes"].Text, "",
                                                               Single.Parse(this.Controls["subtotalAmount"].Text), Single.Parse(this.Controls["gst"].Text),
                                                               Single.Parse(this.Controls["pst"].Text), Single.Parse(this.Controls["invoiceTotal"].Text), 1);
                    }
                    else
                    {
                        invoiceID = InvoiceDatabase.AddInvoice(customerID, this.Controls["purchaseOrder"].Text, this.Controls["invoiceSpecialNotes"].Text, "",
                                                               Single.Parse(this.Controls["subtotalAmount"].Text), Single.Parse(this.Controls["gst"].Text),
                                                               0, Single.Parse(this.Controls["invoiceTotal"].Text), 1);
                    }

                    for (int j = 0; j < i; j++)
                    {
                        if (this.panel1.Controls["qty" + j].Text.Length != 0)
                        {
                            String itemNo = this.panel1.Controls["itemNumber" + j].Text;
                            int    qty    = Int32.Parse(this.panel1.Controls["qty" + j].Text);
                            String notes  = this.panel1.Controls["specialNotes" + j].Text;
                            InvoiceContentsDatabase.AddInvoiceContent(invoiceID, itemNo, qty, notes);
                        }
                    }

                    // Query DB for updated results.
                    Invoice printInvoice = new Invoice(invoiceID);
                    printInvoice.InvoiceNo = "0";

                    // Define & populate Object to define Table columns for datasource in .rdlc Report
                    List <InvoiceItemDetail> invoiceItemDetails;
                    invoiceItemDetails = new List <InvoiceItemDetail>();

                    for (int i = 0; i < printInvoice.Items.Count; i++)
                    {
                        invoiceItemDetails.Add(new InvoiceItemDetail());

                        // Invoice Order Data
                        invoiceItemDetails[i].InvoiceID            = invoiceID;
                        invoiceItemDetails[i].QTY                  = printInvoice.Items[i].Quantity;
                        invoiceItemDetails[i].GrabCarton           = printInvoice.Items[i].Quantity / printInvoice.Items[i].PerCarton;
                        invoiceItemDetails[i].ItemNo               = printInvoice.Items[i].ItemNo;
                        invoiceItemDetails[i].Location             = printInvoice.Items[i].Location;
                        invoiceItemDetails[i].Description          = printInvoice.Items[i].ItemDesc;
                        invoiceItemDetails[i].CartonTotal          = printInvoice.Items[i].PerCarton;
                        invoiceItemDetails[i].InvoiceItemSellPrice = printInvoice.Items[i].SellPrice;
                        invoiceItemDetails[i].InvoiceItemAmount    = printInvoice.Items[i].Quantity * printInvoice.Items[i].SellPrice;
                        invoiceItemDetails[i].InvoiceItemNote      = printInvoice.Items[i].SpecialNotes;

                        // Backorder Data
                        invoiceItemDetails[i].Backorder           = printInvoice.Items[i].BackOrder;
                        invoiceItemDetails[i].BackorderGrabCarton = printInvoice.Items[i].BackOrder / printInvoice.Items[i].PerCarton;
                        invoiceItemDetails[i].BackorderNote       = printInvoice.Items[i].BackOrderSpecialNotes;
                    }

                    Form PrintForm = new PrintInvoiceProgress(printInvoice, invoiceItemDetails);
                    PrintForm.ShowDialog();

                    this.Close();
                }
                else
                {
                    // If 'No', do something here.
                }
            }
        }
示例#14
0
        private void OkButton_Click(object sender, EventArgs e)
        {
            var confirmResult = MessageBox.Show("Are you sure this invoice is complete?",
                                                "Confirm Completion!!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                if (this.Controls["invoiceNumber"].Text.Length == 0)
                {
                    this.Controls["invoiceNumber"].BackColor = Color.Red;
                    return;
                }
                Customer cust = CustomerDatabase.SearchCustomersByID(customerID);

                for (int i = 0; i < invoiceContentsList.Count; i++)
                {
                    int    numBO;
                    String itemNo  = this.panel1.Controls["itemNumber" + i].Text;
                    String notes   = this.panel1.Controls["specialNotes" + i].Text;
                    int    qty     = Int32.Parse(this.panel1.Controls["qty" + i].Text);
                    int    entryID = InvoiceContentsDatabase.GetEntryID(invoice.InvoiceID, itemNo);

                    if (invoiceContentsList[i].Backorder > 0)
                    {
                        numBO = Int32.Parse(this.panel1.Controls["backorder" + i].Text);
                        InvoiceContentsDatabase.EditInvoiceContent(entryID, invoice.InvoiceID, itemNo, qty, notes);
                        InvoiceContentsDatabase.UpdateBackorderSpecialNotes(entryID, this.panel1.Controls["backorderNotes" + i].Text);
                    }
                }
                int invoiceNumber;

                invoiceNumber = Int32.Parse(this.Controls["invoiceNumber"].Text);

                float freight = 0;
                if (this.Controls["freight"].Text.Length == 0)
                {
                    freight = 0;
                }
                else
                {
                    freight = Single.Parse(this.Controls["freight"].Text);
                }
                InvoiceDatabase.EditInvoice(invoice.InvoiceID, cust.StoreID, invoice.PurchaseOrder, invoice.SpecialNotes, invoiceNumber, Single.Parse(this.Controls["subTotalAmount"].Text), Single.Parse(this.Controls["gst"].Text), Single.Parse(this.Controls["pst"].Text), Single.Parse(this.Controls["invoiceTotal"].Text), 3);
                InvoiceDatabase.UpdateFreight(invoice.InvoiceID, freight);
                InvoiceDatabase.UpdateBackorderSpecialNotes(invoice.InvoiceID, this.Controls["backorderInvoiceNotes"].Text);

                bool hasBackorder = false;

                for (int i = 0; i < invoice.Items.Count; i++)
                {
                    if (invoice.Items[i].BackOrder > 0)
                    {
                        hasBackorder = true;
                        break;
                    }
                }

                if (hasBackorder)
                {
                    InvoiceDatabase.UpdateBackorderSpecialNotes(invoice.InvoiceID, this.Controls["backorderInvoiceNotes"].Text);
                }
                else
                {
                    InvoiceDatabase.UpdateBackorderSpecialNotes(invoice.InvoiceID, "");
                }

                // Query DB for updated results.
                Invoice printInvoice = new Invoice(invoice.InvoiceID);

                // Define & populate Object to define Table columns for datasource in .rdlc Report
                List <InvoiceItemDetail> invoiceItemDetails;
                invoiceItemDetails = new List <InvoiceItemDetail>();

                for (int i = 0; i < invoice.Items.Count; i++)
                {
                    invoiceItemDetails.Add(new InvoiceItemDetail());

                    // Invoice Order Data
                    invoiceItemDetails[i].InvoiceID = invoice.InvoiceID;
                    invoiceItemDetails[i].QTY       = printInvoice.Items[i].Quantity;
                    // Hide GrabCarton in Final Invoice Report
                    invoiceItemDetails[i].GrabCarton  = 0.0f;
                    invoiceItemDetails[i].ItemNo      = printInvoice.Items[i].ItemNo;
                    invoiceItemDetails[i].Description = printInvoice.Items[i].ItemDesc;
                    // Hide CartonTotal in Final Invoice Report
                    invoiceItemDetails[i].CartonTotal          = 0;
                    invoiceItemDetails[i].InvoiceItemSellPrice = printInvoice.Items[i].SellPrice;
                    invoiceItemDetails[i].InvoiceItemAmount    = printInvoice.Items[i].Quantity * printInvoice.Items[i].SellPrice;
                    invoiceItemDetails[i].InvoiceItemNote      = printInvoice.Items[i].SpecialNotes;

                    // Backorder Data
                    invoiceItemDetails[i].Backorder           = printInvoice.Items[i].BackOrder;
                    invoiceItemDetails[i].BackorderGrabCarton = 0.0f;
                    invoiceItemDetails[i].BackorderNote       = printInvoice.Items[i].BackOrderSpecialNotes;
                }

                Form PrintForm = new PrintInvoiceProgress(printInvoice, invoiceItemDetails);
                PrintForm.ShowDialog();

                this.Close();
            }
            else
            {
                // If 'No', do something here.
            }
        }
示例#15
0
        private void SetupLists()
        {
            Label pickingLabel = new System.Windows.Forms.Label();

            pickingLabel.AutoSize = true;
            pickingLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 13.875F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            pickingLabel.Location = new System.Drawing.Point(200, 95);
            pickingLabel.Size     = new System.Drawing.Size(238, 42);
            pickingLabel.TabIndex = 0;
            pickingLabel.Text     = "Double Check Stage";
            this.Controls.Add(pickingLabel);

            Label doubleCheckLabel = new System.Windows.Forms.Label();

            doubleCheckLabel.AutoSize = true;
            doubleCheckLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 13.875F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            doubleCheckLabel.Location = new System.Drawing.Point(750, 95);
            doubleCheckLabel.Size     = new System.Drawing.Size(238, 42);
            doubleCheckLabel.TabIndex = 0;
            doubleCheckLabel.Text     = "Final Stage";
            this.Controls.Add(doubleCheckLabel);

            pickingListView.Size     = new Size(500, 450);
            pickingListView.Location = new Point(50, 120);

            pickingListView.Columns.Add("Local Invoice ID", -2, HorizontalAlignment.Left);
            pickingListView.Columns.Add("Customer Name", 200, HorizontalAlignment.Left);
            pickingListView.Columns.Add("Shipping Address", 200, HorizontalAlignment.Left);

            pickingListView.GridLines     = true;
            pickingListView.Scrollable    = true;
            pickingListView.FullRowSelect = true;
            pickingListView.View          = System.Windows.Forms.View.Details;
            pickingListView.DoubleClick  += PickingListView_DoubleClick;
            pickingListView.Enter        += PickingListView_Enter;
            this.Controls.Add(pickingListView);

            doubleCheckListView.Size     = new Size(500, 450);
            doubleCheckListView.Location = new Point(600, 120);

            doubleCheckListView.Columns.Add("Local Invoice ID", -2, HorizontalAlignment.Left);
            doubleCheckListView.Columns.Add("Customer Name", 200, HorizontalAlignment.Left);
            doubleCheckListView.Columns.Add("Shipping Address", 200, HorizontalAlignment.Left);

            doubleCheckListView.GridLines     = true;
            doubleCheckListView.Scrollable    = true;
            doubleCheckListView.FullRowSelect = true;
            doubleCheckListView.Enter        += DoubleCheckListView_Enter;

            doubleCheckListView.View         = System.Windows.Forms.View.Details;
            doubleCheckListView.DoubleClick += DoubleCheckListView_DoubleClick;
            this.Controls.Add(doubleCheckListView);

            Button processButton = new Button();

            processButton.Location = new Point(450, 600);
            processButton.Size     = new Size(70, 40);
            processButton.Text     = "Process";
            processButton.Click   += ProcessButton_Click;
            this.Controls.Add(processButton);

            Button deleteButton = new Button();

            deleteButton.Location = new Point(530, 600);
            deleteButton.Size     = new Size(70, 40);
            deleteButton.Text     = "Delete";
            deleteButton.Click   += DeleteButton_Click;
            this.Controls.Add(deleteButton);

            Button moveButton = new Button();

            moveButton.Location = new Point(610, 600);
            moveButton.Size     = new Size(100, 40);
            moveButton.Text     = "Move to double check";
            moveButton.Click   += MoveButton_Click;
            this.Controls.Add(moveButton);

            pickingList     = InvoiceDatabase.SearchInvoicesByStage(1);
            doubleCheckList = InvoiceDatabase.SearchInvoicesByStage(2);
            foreach (Invoice l in pickingList)
            {
                pickingListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.ShippingAddress }));
            }
            foreach (Invoice l in doubleCheckList)
            {
                doubleCheckListView.Items.Add(new ListViewItem(new String[] { l.InvoiceID.ToString(), l.customer.StoreName, l.customer.ShippingAddress }));
            }
        }