Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            double amount_to_deduct = 0;
            double total_amount     = totalAmount();

            frmEnterDiscount aeP = new frmEnterDiscount(this);

            aeP.ShowDialog();

            if (DiscountAmount > 0)
            {
                amount_to_deduct       = DiscountAmount;
                lblDiscountAmount.Text = DiscountAmount.ToString();
            }

            if (DiscountPercent > 0)
            {
                amount_to_deduct        = total_amount * (DiscountPercent / 100);
                lblDiscountAmount.Text  = amount_to_deduct.ToString();
                lblDiscountPercent.Text = DiscountPercent.ToString();
            }

            if (DiscountPercent <= 0 && DiscountAmount <= 0)
            {
                return;
            }

            dgw.Rows.Add(0, 1, "Discount", "Discount", Strings.FormatNumber(amount_to_deduct).ToString(), '0', cmbCustomerTax.Text, "-" + amount_to_deduct, "Remove");

            ComupteAmount();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            double Subtotal;
            double DiscountPercent;
            double DiscountAmount;
            double InvoiceTotal;

            Subtotal = double.Parse(txtSubtotal.Text);
            if (Subtotal >= 500)
            {
                DiscountPercent = 0.2;
            }
            else if (Subtotal >= 250 && Subtotal < 500)
            {
                DiscountPercent = 0.15;
            }
            else if (Subtotal >= 100 && Subtotal < 250)
            {
                DiscountPercent = 0.1;
            }
            else
            {
                DiscountPercent = 0.0;
            }
            DiscountAmount          = Subtotal * DiscountPercent;
            InvoiceTotal            = Subtotal - DiscountAmount;
            txtDiscountPercent.Text = DiscountPercent.ToString("p1"); //p1 means percentage
            txtDiscountAmount.Text  = "$" + DiscountAmount.ToString();
            txtTotal.Text           = "$" + InvoiceTotal.ToString();
            txtResult.Text          = "Dear Customer you have to pay: $" + InvoiceTotal.ToString();
        }
Esempio n. 3
0
        public Dictionary <string, string> Fetch()
        {
            Dictionary <string, string> res = new Dictionary <string, string>
            {
                { "date", Date.ToString("yyyy-MM-dd") },
                { "pourcentage_remise", DiscountPercent.ToString(CultureInfo.CurrentCulture) },
                { "salaries_id", Employee.Id.ToString() },
                { "clients_id", Customer == null ? "0" : Customer.Id.ToString() },
                { "moyen_de_paiements_id", Payment.Id.ToString() },
                { "estPaye", IsPaid ? "1" : "0" },
                { "montantPaye", PaidAmount.ToString(CultureInfo.InvariantCulture) }
            };

            return(res);
        }
Esempio n. 4
0
        /// <summary>
        /// Update all properties in the data table
        /// </summary>
        public void UpdateAllData()
        {
            var row = _dictofdata.Rows[0];

            row["Sistema"]                 = System;
            row["Licencia"]                = License;
            row["TipoCambio"]              = ExchangeRate.ToString();
            row["CantidadPesosCaja"]       = LastCashierAmountMxn.ToString();
            row["CantidadDolarCaja"]       = LastCashierAmountUsd.ToString();
            row["UltimoReciboNumero"]      = LastReceiptNumber.ToString();
            row["UltimoCorteZNumero"]      = LastCorteZNumber.ToString();
            row["UltimoTransaccionNumero"] = LastTransactionNumber.ToString();
            row["UltimoNumeroInterno"]     = LastInternalNumber.ToString();
            row["UltimoNumeroPedido"]      = LastOrderNumber.ToString();
            row["NombreImpresora"]         = PrinterName;
            row["NombreNegocio"]           = BusinessName;
            row["DireccionCalleFiscal"]    = FiscalStreetAddress;
            row["CiudadCodigoFiscal"]      = FiscalCityAndZipCode;
            row["RFC"]                   = FiscalNumber;
            row["NombreFiscal"]          = FiscalName;
            row["NumeroTelefono"]        = FiscalPhoneNumber;
            row["Email"]                 = FiscalEmail;
            row["RazonSocial"]           = FiscalType;
            row["Facebook"]              = Facebook;
            row["Instagram"]             = Instagram;
            row["Twitter"]               = Twitter;
            row["PaginaInternet"]        = Website;
            row["Comentarios"]           = Comments;
            row["MensajePie"]            = FooterMessage;
            row["LogoImagen"]            = LogoName;
            row["EmailSaliente"]         = EmailSender;
            row["EmailSalientePassword"] = EmailSenderPassword;
            row["EmailReportes"]         = EmailReports;
            row["EmailPedidos"]          = EmailOrders;
            row["DescuentoPorcentaje"]   = DiscountPercent.ToString();
            row["PuntosPorcentaje"]      = PointsPercent.ToString();
        }