Esempio n. 1
0
 protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             TotalQty    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Qty"));
             TotalAmt    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount"));
             TotalNetAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "NetAmount"));//TotalTax
             TotalTax    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TaxAmount"));
             TotalDisc   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscAmount"));
         }
         if (e.Row.RowType == DataControlRowType.Footer)
         {
             e.Row.Cells[9].Text  = "Total :";
             e.Row.Cells[10].Text = TotalQty.ToString();
             e.Row.Cells[12].Text = TotalAmt.ToString();
             e.Row.Cells[14].Text = TotalTax.ToString();
             e.Row.Cells[16].Text = TotalDisc.ToString();
             e.Row.Cells[17].Text = TotalNetAmt.ToString();
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Billing != null?Billing.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (CartHash != null ? CartHash.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (CartTax != null ? CartTax.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (CreatedVia != null ? CreatedVia.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Currency != null ? Currency.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ CustomerId;
                hashCode = (hashCode * 397) ^ (CustomerIpAddress != null ? CustomerIpAddress.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (CustomerNote != null ? CustomerNote.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (CustomerUserAgent != null ? CustomerUserAgent.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DiscountTax != null ? DiscountTax.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DiscountTotal != null ? DiscountTotal.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ Id;
                hashCode = (hashCode * 397) ^ (Number != null ? Number.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (OrderKey != null ? OrderKey.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ ParentId;
                hashCode = (hashCode * 397) ^ (PaymentMethod != null ? PaymentMethod.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (PaymentMethodTitle != null ? PaymentMethodTitle.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ PricesIncludeTax.GetHashCode();
                hashCode = (hashCode * 397) ^ (Shipping != null ? Shipping.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ShippingTax != null ? ShippingTax.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ShippingTotal != null ? ShippingTotal.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Total != null ? Total.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TotalTax != null ? TotalTax.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (TransactionId != null ? TransactionId.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0);
                return(hashCode);
            }
        }
Esempio n. 3
0
 private AmountBreakdown GetBreakdown()
 {
     return(new AmountBreakdown
     {
         ItemTotal = new Money
         {
             CurrencyCode = "USD",
             Value = TotalItemCost.ToString()
         },
         Shipping = new Money
         {
             CurrencyCode = "USD",
             Value = "20.00"
         },
         Handling = new Money
         {
             CurrencyCode = "USD",
             Value = "10.00"
         },
         TaxTotal = new Money
         {
             CurrencyCode = "USD",
             Value = TotalTax.ToString()
         },
         ShippingDiscount = new Money
         {
             CurrencyCode = "USD",
             Value = "10.00"
         }
     });
 }
Esempio n. 4
0
 //[/BARCODE FUNCTIONS]
 private void UpdateCash()
 {
     SubtotalTemp = 0; TaxTemp = 0; Subtotal = 0; TotalTax = 0;
     if (!semaphore && !OnExit)
     {
         semaphore = true;
         foreach (DataGridViewRow r in TeldgView.Rows)
         {
             if (!r.IsNewRow && !OnExit)
             {
                 try
                 {   //PriceLevelSelection
                     DataRow aItemRow = ItemsMgmt.SelectItemRowByBarcode(TeldgView.Rows[r.Index].Cells["Barcode"].Value.ToString());
                     SubtotalTemp = Math.Round(double.Parse(TeldgView.Rows[r.Index].Cells["PriceTotal"].Value.ToString()), 3);
                     Subtotal    += SubtotalTemp;
                     TaxTemp      = double.Parse(TeldgView.Rows[r.Index].Cells["Tax"].Value.ToString());
                     TotalTax    += (TaxTemp / 100) * SubtotalTemp; //Net amount = (Selling Price - Sales Price)*Tax
                     //updates
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show("UPDATE CASH ERROR IN [DISPOSE ITEMS] Exception:" + ex.ToString());
                     return;
                 }
             }
         }
         TotalTxtBox.Text    = Math.Round(Subtotal + TotalTax, 2).ToString();
         Subtotal            = Math.Round(Subtotal, 2);
         SubtotalTxtBox.Text = Subtotal.ToString();
         TotalTax            = Math.Round(TotalTax, 3);
         TaxTxtBox.Text      = TotalTax.ToString();
         semaphore           = false;
     }
 }
        public FrmSellAuctionItemsToPerson(PersonPickup person)
        {
            InitializeComponent();
            Person         = person;
            StripeFirstTry = true;
            Text           = "Items Won by " + Person.Name;
            LblTaxes.Text  = "Taxes @ " + decimal.Round(Program.TaxRate * 100, 1) + "%";

            var payload = "action=GetItemsForPickup&id=" + Person.BadgeID + "&year=" + Program.Year.ToString();
            var data    = Encoding.ASCII.GetBytes(payload);

            var request = WebRequest.Create(Program.URL + "/functions/artQuery.php");

            request.ContentLength = data.Length;
            request.ContentType   = "application/x-www-form-urlencoded";
            request.Method        = "POST";
            using (var stream = request.GetRequestStream())
                stream.Write(data, 0, data.Length);

            var response = (HttpWebResponse)request.GetResponse();
            var results  = new StreamReader(response.GetResponseStream()).ReadToEnd();

            Items = JsonConvert.DeserializeObject <List <ArtShowItem> >(results);

            TotalPrice = 0;
            TotalDue   = 0;
            decimal taxibleAmount = 0;

            TotalTax = 0;
            foreach (var showItem in Items)
            {
                var item = new ListViewItem {
                    Text = showItem.LocationCode
                };
                item.SubItems.Add(showItem.ShowNumber.ToString());
                item.SubItems.Add(showItem.Title);
                item.SubItems.Add(showItem.ArtistDisplayName);
                item.SubItems.Add(((decimal)showItem.FinalSalePrice).ToString("C"));
                item.Tag = showItem;
                LstItems.Items.Add(item);
                TotalPrice += (decimal)showItem.FinalSalePrice;
                if (showItem.IsCharity)
                {
                    item.BackColor = Color.LightGreen;
                }
                else
                {
                    taxibleAmount += (decimal)showItem.FinalSalePrice;
                }
            }
            TotalTax            = taxibleAmount * Program.TaxRate;
            TotalTax            = decimal.Round(TotalTax, 2);
            TotalDue            = TotalPrice + TotalTax;
            LblAmountDue.Text   = TotalPrice.ToString("C");
            LblAmountTax.Text   = TotalTax.ToString("C");
            LblAmountTotal.Text = TotalDue.ToString("C");
        }
Esempio n. 6
0
 public void GenerateRecipt()
 {
     output.Append($"Date: {DateTime.Now:MMMM dd, yyyy HH:mm}{Environment.NewLine}");
     output.Append($"Stay Charge: ${DaysCharge.ToString()}{Environment.NewLine}");
     output.Append($"Miscellaneous Charge: ${MiscCharge.ToString()}{Environment.NewLine}");
     output.Append($"Tax: ${TotalTax.ToString()}{Environment.NewLine}");
     output.Append($"Total: ${TotalWithTax.ToString()}{Environment.NewLine}");
     output.AppendLine();
     File.AppendAllText(fullName, output.ToString());
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (SubtotalPrice != null ? SubtotalPrice.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalPrice != null ? TotalPrice.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalTax != null ? TotalTax.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 8
0
        private void CalculateTotal()
        {
            TotalPrice = LstCart.Items.Cast <ListViewItem>().Sum(cartItem => ((PrintShopItem)cartItem.Tag).Price);
            decimal taxibleAmount = LstCart.Items.Cast <ListViewItem>().Where(cartItem => !((PrintShopItem)cartItem.Tag).IsCharity).Sum(cartItem => ((PrintShopItem)cartItem.Tag).Price);

            TotalTax            = taxibleAmount * Program.TaxRate;
            TotalTax            = decimal.Round(TotalTax, 2);
            TotalDue            = TotalPrice + TotalTax;
            LblAmountDue.Text   = TotalPrice.ToString("C");
            LblAmountTax.Text   = TotalTax.ToString("C");
            LblAmountTotal.Text = TotalDue.ToString("C");
            UpdatePurchaseButton();
        }
Esempio n. 9
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AddressId.GetHashCode();
         hashCode = (hashCode * 397) ^ (AnalyticsData != null ? AnalyticsData.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BillingAddress != null ? BillingAddress.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ClientDetails != null ? ClientDetails.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (CustomerHash != null ? CustomerHash.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomerId.GetHashCode();
         hashCode = (hashCode * 397) ^ (Email != null ? Email.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ HasUncommitedChanges.GetHashCode();
         hashCode = (hashCode * 397) ^ Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Note != null ? Note.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ProcessedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (ProcessorName != null ? ProcessorName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ScheduledAt.GetHashCode();
         hashCode = (hashCode * 397) ^ ShipmentsCount.GetHashCode();
         hashCode = (hashCode * 397) ^ (ShippingAddress != null ? ShippingAddress.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ShopifyOrderId.GetHashCode();
         hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubTotal != null ? SubTotal.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ SubtotalPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TaxLines.GetHashCode();
         hashCode = (hashCode * 397) ^ (TotalDiscounts != null ? TotalDiscounts.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalLineItemsPrice != null ? TotalLineItemsPrice.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalPrice != null ? TotalPrice.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (TotalRefunds != null ? TotalRefunds.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TotalTax.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalWeight.GetHashCode();
         hashCode = (hashCode * 397) ^ (TransactionId != null ? TransactionId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ UpdatedAt.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 10
0
        protected override void Bottom(Section section)
        {
            var textFrame = section.AddTextFrame();

            textFrame.RelativeVertical = RelativeVertical.Page;
            textFrame.Top = ShapePosition.Bottom;
            //textFrame.Width = section.PageSetup.PageWidth;
            //textFrame.Height = "5.5cm";

            Table table = textFrame.AddTable();

            table.Borders.Visible = false;

            table.AddColumn(GetWidth(section) * 0.2);
            table.AddColumn(GetWidth(section) * 0.3);
            table.AddColumn(GetWidth(section) * 0.24);
            table.AddColumn(GetWidth(section) * 0.1);
            table.AddColumn(GetWidth(section) * 0.16);

            Row row = table.AddRow();

            row.Height              = "0.5cm";
            row.Format.Alignment    = ParagraphAlignment.Right;
            row.Style               = "BottomTaxes";
            row.Cells[0].MergeRight = 3;
            row.Cells[0].AddParagraph("Arvonlisäveroton hinta");
            row.Cells[4].AddParagraph(TotalTaxless.ToString("C", System.Globalization.CultureInfo.CurrentCulture));

            row                     = table.AddRow();
            row.Height              = "0.5cm";
            row.Format.Alignment    = ParagraphAlignment.Right;
            row.Style               = "BottomTaxes";
            row.Cells[0].MergeRight = 3;
            row.Cells[0].AddParagraph("Arvonlisävero yhteensä");
            row.Cells[4].AddParagraph(TotalTax.ToString("C", System.Globalization.CultureInfo.CurrentCulture));

            row.Borders.Bottom.Style = BorderStyle.Single;;

            row       = table.AddRow();
            row.Style = "BottomHeader";
            row.Cells[0].AddParagraph("Eräpäivä");
            row.Cells[1].AddParagraph("Viitenumero");
            row.Height = "0.6cm";

            row.Cells[2].AddParagraph("Maksettava yhteensä");
            row.Cells[2].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[2].MergeRight       = 1;
            row.Cells[2].Style            = "BottomTotal";

            row.Cells[4].AddParagraph(TotalPrice.ToString("C", System.Globalization.CultureInfo.CurrentCulture));
            row.Cells[4].Format.Alignment = ParagraphAlignment.Right;
            row.Cells[4].Style            = "BottomValue";

            row       = table.AddRow();
            row.Style = "Heading3";
            row.Cells[0].AddParagraph(DueDate.ToShortDateString());
            row.Cells[1].AddParagraph(Invoice.Reference);

            row.Borders.Bottom.Style = BorderStyle.Single;

            Row row1 = table.AddRow();

            row1.Style = "BottomHeader";
            row1.Cells[0].AddParagraph("BIC");
            row1.Cells[1].AddParagraph("IBAN");
            row1.Height = "0.6cm";

            row       = table.AddRow();
            row.Style = "BottomValue";
            row.Cells[0].AddParagraph(Company.BIC);
            row.Cells[1].AddParagraph(Company.IBAN);
            row.Cells[1].MergeRight = 1;

            table.AddRow();

            row1.Cells[2].MergeDown = 2;
            row1.Cells[2].Style     = "BottomInfo";
            row1.Cells[2].AddParagraph(Company.Name);
            if (Company.ContactPerson != null)
            {
                row1.Cells[2].AddParagraph(Company.ContactPerson);
            }
            row1.Cells[2].AddParagraph(Company.Address);
            row1.Cells[2].AddParagraph($"{Company.PostalCode} {Company.City}" + (Company.Country != null ? " / " + Company.Country : ""));

            row1.Cells[3].MergeDown  = 2;
            row1.Cells[3].MergeRight = 1;
            row1.Cells[3].Style      = "BottomInfo";
            if (Company.Phone != null)
            {
                row1.Cells[3].AddParagraph(Company.Phone);
            }
            if (Company.Email != null)
            {
                row1.Cells[3].AddParagraph(Company.Email);
            }
            if (Company.WebPage != null)
            {
                row1.Cells[3].AddParagraph(Company.WebPage);
            }
            row1.Cells[3].AddParagraph("Y-tunnus " + Company.CompanyID);

            table.AddRow().Height = "0.5cm";

            Unit tableHeight = 0;

            foreach (Row r in table.Rows)
            {
                tableHeight += r.Height;
            }

            textFrame.Height = tableHeight + section.PageSetup.BottomMargin;
        }