コード例 #1
0
        public void UpdateDiscountFreightDeposit(long WBranchTransferID, decimal DiscountApplied, DiscountTypes DiscountType)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET " +
                             "DiscountApplied        =   @DiscountApplied, " +
                             "DiscountType           =   @DiscountType " +
                             "WHERE WBranchTransferID = @WBranchTransferID;";

                cmd.Parameters.AddWithValue("@DiscountApplied", DiscountApplied);
                cmd.Parameters.AddWithValue("@DiscountType", DiscountType.ToString("d"));
                cmd.Parameters.AddWithValue("@WBranchTransferID", WBranchTransferID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
コード例 #2
0
        public void UpdateDiscountFreightDeposit(long CreditMemoID, decimal DiscountApplied, DiscountTypes DiscountType)
        {
            try
            {
                string SQL = "UPDATE tblSOCreditMemo SET " +
                             "DiscountApplied        =   @DiscountApplied, " +
                             "DiscountType           =   @DiscountType " +
                             "WHERE CreditMemoID = @CreditMemoID;";



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                MySqlParameter prmDiscountApplied = new MySqlParameter("@DiscountApplied", MySqlDbType.Decimal);
                prmDiscountApplied.Value = DiscountApplied;
                cmd.Parameters.Add(prmDiscountApplied);

                MySqlParameter prmDiscountType = new MySqlParameter("@DiscountType", MySqlDbType.Int16);
                prmDiscountType.Value = Convert.ToInt16(DiscountType.ToString("d"));
                cmd.Parameters.Add(prmDiscountType);

                MySqlParameter prmCreditMemoID = new MySqlParameter("@CreditMemoID", MySqlDbType.Int64);
                prmCreditMemoID.Value = CreditMemoID;
                cmd.Parameters.Add(prmCreditMemoID);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
コード例 #3
0
        public void Refund(TransactionStatus RefundTransactionStatus, Int64 TransactionID, string ORNo, decimal ItemSold, decimal QuantitySold, decimal GrossSales, decimal SubTotal, decimal NetSales, decimal ItemsDiscount, decimal SNRItemsDiscount, decimal PWDItemsDiscount, decimal OtherItemsDiscount, decimal Discount, decimal SNRDiscount, decimal PWDDiscount, decimal OtherDiscount, decimal TransDiscount, DiscountTypes TransDiscountType, decimal VAT, decimal VATableAmount, decimal ZeroRatedSales, decimal NonVATableAmount, decimal VATExempt, decimal EVAT, decimal EVATableAmount, decimal NonEVATableAmount, decimal LocalTax, decimal AmountPaid, decimal CashPayment, decimal ChequePayment, decimal CreditCardPayment, decimal CreditPayment, decimal DebitPayment, decimal RewardPointsPayment, decimal RewardConvertedPayment, decimal BalanceAmount, decimal ChangeAmount, PaymentTypes PaymentType, string DiscountCode, string DiscountRemarks, decimal Charge, decimal ChargeAmount, string ChargeCode, string ChargeRemarks, Int64 CashierID, string CashierName)
		{
			try
			{
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

				string SQL = "UPDATE tblTransactions SET " +
                                "ORNo	            =	@ORNo, " +
								"TransactionStatus	=	@TransactionStatus, " +
                                "ItemSold		    =	@ItemSold, " +
                                "QuantitySold	    =	@QuantitySold, " +
                                "GrossSales		    =	@GrossSales, " +
                                "SubTotal			=	@SubTotal, " +
                                "NetSales			=	@NetSales, " +
								"ItemsDiscount		=	@ItemsDiscount, " +
                                "SNRItemsDiscount	=	@SNRItemsDiscount, " +
                                "PWDItemsDiscount	=	@PWDItemsDiscount, " +
                                "OtherItemsDiscount	=	@OtherItemsDiscount, " +
								"Discount			=	@Discount, " +
                                "SNRDiscount		=	@SNRDiscount, " +
                                "PWDDiscount		=	@PWDDiscount, " +
                                "OtherDiscount		=	@OtherDiscount, " +
								"TransDiscount		=	@TransDiscount, " +
								"TransDiscountType	=	@TransDiscType, " +
								"VAT				=	@VAT, " +
								"VATableAmount		=	@VATableAmount, " +
                                "ZeroRatedSales     =   @ZeroRatedSales, " +
                                "NonVATableAmount   =	@NonVATableAmount, " +
                                "VATExempt  		=	@VATExempt, " +
								"EVAT				=	@EVAT, " +
								"EVATableAmount		=	@EVATableAmount, " +
                                "NonEVATableAmount	=	@NonEVATableAmount, " +
								"LocalTax			=	@LocalTax, " +
								"AmountPaid			=	@AmountPaid, " +
								"CashPayment		=	@CashPayment, " +
								"ChequePayment		=	@ChequePayment, " +
								"CreditCardPayment	=	@CreditCardPayment, " +
								"CreditPayment		=	@CreditPayment, " +
								"DebitPayment		=	@DebitPayment, " +
								"RewardPointsPayment		=	@RewardPointsPayment, " +
								"RewardConvertedPayment		=	@RewardConvertedPayment, " +
								"BalanceAmount		=	@BalanceAmount, " +
								"ChangeAmount		=	@ChangeAmount, " +
								"DateClosed			=	NOW(), " +
								"PaymentType		=	@PaymentType, " +
								"DiscountCode		=	@DiscCode,  " +
								"DiscountRemarks	=	@DiscRemarks, " +
								"Charge				=	@Charge, " +
								"ChargeAmount		=	@ChargeAmount, " +
								"ChargeCode			=	@ChargeCode, " +
								"ChargeRemarks		=	@ChargeRemarks, " +
								"CashierID			=	@CashierID, " +
								"CashierName		=	@CashierName, " +
                                "LastModified		=	NOW() " +
							"WHERE TransactionID	=	@TransactionID;";

                cmd.Parameters.AddWithValue("ORNo", ORNo);
                cmd.Parameters.AddWithValue("TransactionStatus", RefundTransactionStatus.ToString("d"));
                cmd.Parameters.AddWithValue("ItemSold", ItemSold);
                cmd.Parameters.AddWithValue("QuantitySold", QuantitySold);
                cmd.Parameters.AddWithValue("GrossSales", GrossSales);
                cmd.Parameters.AddWithValue("SubTotal", SubTotal);
                cmd.Parameters.AddWithValue("NetSales", NetSales);
                cmd.Parameters.AddWithValue("ItemsDiscount", ItemsDiscount);
                cmd.Parameters.AddWithValue("SNRItemsDiscount", SNRItemsDiscount);
                cmd.Parameters.AddWithValue("PWDItemsDiscount", PWDItemsDiscount);
                cmd.Parameters.AddWithValue("OtherItemsDiscount", OtherItemsDiscount);
                cmd.Parameters.AddWithValue("Discount", Discount);
                cmd.Parameters.AddWithValue("SNRDiscount", SNRDiscount);
                cmd.Parameters.AddWithValue("PWDDiscount", PWDDiscount);
                cmd.Parameters.AddWithValue("OtherDiscount", OtherDiscount);
                cmd.Parameters.AddWithValue("TransDiscount", TransDiscount);
                cmd.Parameters.AddWithValue("TransDiscType", TransDiscountType.ToString("d"));
                cmd.Parameters.AddWithValue("VAT", VAT);
                cmd.Parameters.AddWithValue("VATableAmount", VATableAmount);
                cmd.Parameters.AddWithValue("ZeroRatedSales", ZeroRatedSales);
                cmd.Parameters.AddWithValue("NonVATableAmount", NonVATableAmount);
                cmd.Parameters.AddWithValue("VATExempt", VATExempt);
                cmd.Parameters.AddWithValue("EVAT", EVAT);
                cmd.Parameters.AddWithValue("EVATableAmount", EVATableAmount);
                cmd.Parameters.AddWithValue("NonEVATableAmount", NonEVATableAmount);
                cmd.Parameters.AddWithValue("LocalTax", LocalTax);
                cmd.Parameters.AddWithValue("AmountPaid", AmountPaid);
                cmd.Parameters.AddWithValue("CashPayment", CashPayment);
                cmd.Parameters.AddWithValue("ChequePayment", ChequePayment);
                cmd.Parameters.AddWithValue("CreditCardPayment", CreditCardPayment);
                cmd.Parameters.AddWithValue("CreditPayment", CreditPayment);
                cmd.Parameters.AddWithValue("DebitPayment", DebitPayment);
                cmd.Parameters.AddWithValue("RewardPointsPayment", RewardPointsPayment);
                cmd.Parameters.AddWithValue("RewardConvertedPayment", RewardConvertedPayment);
                cmd.Parameters.AddWithValue("BalanceAmount", BalanceAmount);
                cmd.Parameters.AddWithValue("ChangeAmount", ChangeAmount);
                cmd.Parameters.AddWithValue("PaymentType", PaymentType.ToString("d"));
                cmd.Parameters.AddWithValue("DiscCode", string.IsNullOrEmpty(DiscountCode) ? "" : DiscountCode);
                cmd.Parameters.AddWithValue("DiscRemarks", DiscountRemarks);
                cmd.Parameters.AddWithValue("Charge", Charge);
                cmd.Parameters.AddWithValue("ChargeAmount", ChargeAmount);
                cmd.Parameters.AddWithValue("ChargeCode", ChargeCode);
                cmd.Parameters.AddWithValue("ChargeRemarks", string.IsNullOrEmpty(ChargeRemarks) ? "" : ChargeRemarks);
                cmd.Parameters.AddWithValue("CashierID", CashierID);
                cmd.Parameters.AddWithValue("CashierName", CashierName);
                cmd.Parameters.AddWithValue("TransactionID", TransactionID);

                cmd.CommandText = SQL;
				base.ExecuteNonQuery(cmd);

				SalesTransactionItems clsSalesTransactionItems = new SalesTransactionItems(base.Connection, base.Transaction);
				clsSalesTransactionItems.RefundByTransaction(TransactionID);
			}

			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}
		}
コード例 #4
0
        public void UpdateSubTotal(Int64 TransactionID, decimal ItemSold, decimal QuantitySold, decimal GrossSales, decimal SubTotal, decimal NetSales, decimal ItemsDiscount, decimal SNRItemsDiscount, decimal PWDItemsDiscount, decimal OtherItemsDiscount, decimal Discount, decimal SNRDiscount, decimal PWDDiscount, decimal OtherDiscount, decimal TransDiscount, DiscountTypes TransDiscountType, decimal VAT, decimal VATableAmount, decimal ZeroRatedSales, decimal NonVATableAmount, decimal VATExempt, decimal EVAT, decimal EVATableAmount, decimal NonEVATableAmount, decimal LocalTax, string DiscountCode, string DiscountRemarks, decimal Charge, decimal ChargeAmount, string ChargeCode, string ChargeRemarks, ChargeTypes ChargeType)
		{
            // Sep 4, 2014 : Added VATableAmount, ZeroRatedSales, NonVATableAmount, VATExempt as per requirement of BIR
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

			    string SQL = "UPDATE tblTransactions SET " +
							    "TransactionStatus	=	@TransactionStatus, " +
                                "ItemSold		    =	@ItemSold, " +
                                "QuantitySold	    =	@QuantitySold, " +
                                "GrossSales		    =	@GrossSales, " +
                                "SubTotal			=	@SubTotal, " +
                                "NetSales			=	@NetSales, " +
							    "ItemsDiscount		=	@ItemsDiscount, " +
                                "SNRItemsDiscount	=	@SNRItemsDiscount, " +
                                "PWDItemsDiscount	=	@PWDItemsDiscount, " +
                                "OtherItemsDiscount =	@OtherItemsDiscount, " +
							    "Discount			=	@Discount, " +
                                "SNRDiscount		=	@SNRDiscount, " +
                                "PWDDiscount		=	@PWDDiscount, " +
                                "OtherDiscount		=	@OtherDiscount, " +
							    "TransDiscount		=	@TransDiscount, " +
							    "TransDiscountType	=	@TransDiscType, " +
							    "VAT				=	@VAT, " +
							    "VATableAmount		=	@VATableAmount, " +
                                "ZeroRatedSales     =   @ZeroRatedSales, " +
                                "NonVATableAmount	=	@NonVATableAmount, " +
                                "VATExempt		    =	@VATExempt, " +
							    "EVAT				=	@EVAT, " +
							    "EVATableAmount		=	@EVATableAmount, " +
                                "NonEVATableAmount	=	@NonEVATableAmount, " +
							    "LocalTax			=	@LocalTax, " +
							    "DateClosed			=	NOW(), " +
							    "DiscountCode		=	@DiscCode,  " +
							    "DiscountRemarks	=	@DiscRemarks, " +
							    "Charge				=	@Charge, " +
							    "ChargeAmount		=	@ChargeAmount, " +
							    "ChargeCode			=	@ChargeCode, " +
							    "ChargeRemarks		=	@ChargeRemarks, " +
                                "ChargeType		    =	@ChargeType, " +
                                "LastModified		=	NOW() " +
						    "WHERE TransactionID	=	@TransactionID;";


                cmd.Parameters.AddWithValue("@ItemSold", ItemSold);
                cmd.Parameters.AddWithValue("@QuantitySold", QuantitySold);
                cmd.Parameters.AddWithValue("@GrossSales", GrossSales);
                cmd.Parameters.AddWithValue("@SubTotal", SubTotal);
                cmd.Parameters.AddWithValue("@NetSales", NetSales);
                cmd.Parameters.AddWithValue("@ItemsDiscount", ItemsDiscount);
                cmd.Parameters.AddWithValue("@SNRItemsDiscount", SNRItemsDiscount);
                cmd.Parameters.AddWithValue("@PWDItemsDiscount", PWDItemsDiscount);
                cmd.Parameters.AddWithValue("@OtherItemsDiscount", OtherItemsDiscount);
                cmd.Parameters.AddWithValue("@Discount", Discount);
                cmd.Parameters.AddWithValue("@SNRDiscount", SNRDiscount);
                cmd.Parameters.AddWithValue("@PWDDiscount", PWDDiscount);
                cmd.Parameters.AddWithValue("@OtherDiscount", OtherDiscount);
                cmd.Parameters.AddWithValue("@TransDiscount", TransDiscount);
                cmd.Parameters.AddWithValue("@TransDiscType", TransDiscountType.ToString("d"));
                cmd.Parameters.AddWithValue("@VAT", VAT);
                cmd.Parameters.AddWithValue("@VATableAmount", VATableAmount);
                cmd.Parameters.AddWithValue("@ZeroRatedSales", ZeroRatedSales);
                cmd.Parameters.AddWithValue("@NonVATableAmount", NonVATableAmount);
                cmd.Parameters.AddWithValue("@VATExempt", VATExempt);
                cmd.Parameters.AddWithValue("@EVAT", EVAT);
                cmd.Parameters.AddWithValue("@EVATableAmount", EVATableAmount);
                cmd.Parameters.AddWithValue("@NonEVATableAmount", NonEVATableAmount);
                cmd.Parameters.AddWithValue("@LocalTax", LocalTax);
                cmd.Parameters.AddWithValue("@TransactionStatus", TransactionStatus.SuspendedOpen.ToString("d"));
                cmd.Parameters.AddWithValue("@DiscCode", DiscountCode);
                cmd.Parameters.AddWithValue("@DiscRemarks", DiscountRemarks);
                cmd.Parameters.AddWithValue("@Charge", Charge);
                cmd.Parameters.AddWithValue("@ChargeAmount", ChargeAmount);
                cmd.Parameters.AddWithValue("@ChargeCode", ChargeCode);
                cmd.Parameters.AddWithValue("@ChargeRemarks", ChargeRemarks);
                cmd.Parameters.AddWithValue("@ChargeType", ChargeType);
                cmd.Parameters.AddWithValue("@TransactionID", TransactionID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
		}
コード例 #5
0
ファイル: DebitMemo.cs プロジェクト: marioricci/erp-luma
        public void UpdateDiscountFreightDeposit(long DebitMemoID, decimal DiscountApplied, DiscountTypes DiscountType)
        {
            try
            {
                string SQL = "UPDATE tblPODebitMemo SET " +
                                "DiscountApplied        =   @DiscountApplied, " +
                                "DiscountType           =   @DiscountType " +
                            "WHERE DebitMemoID = @DebitMemoID;";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@DiscountApplied", DiscountApplied);
                cmd.Parameters.AddWithValue("@DiscountType", Convert.ToInt16(DiscountType.ToString("d")));
                cmd.Parameters.AddWithValue("@DebitMemoID", DebitMemoID);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
コード例 #6
0
ファイル: DebitMemo.cs プロジェクト: marioricci/erp-luma
        public void UpdateDiscount(long DebitMemoID, decimal DiscountApplied, DiscountTypes DiscountType, decimal Discount2Applied, DiscountTypes Discount2Type, decimal Discount3Applied, DiscountTypes Discount3Type)
        {
            try
            {
                string SQL = "UPDATE tblPODebitMemo SET " +
                                "DiscountApplied        =   @DiscountApplied, " +
                                "DiscountType           =   @DiscountType, " +
                                "Discount2Applied       =   @Discount2Applied, " +
                                "Discount2Type          =   @Discount2Type, " +
                                "Discount3Applied       =   @Discount3Applied, " +
                                "Discount3Type          =   @Discount3Type " +
                            "WHERE DebitMemoID = @DebitMemoID;";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                MySqlParameter prmDiscountApplied = new MySqlParameter("@DiscountApplied", MySqlDbType.Decimal);
                prmDiscountApplied.Value = DiscountApplied;
                cmd.Parameters.Add(prmDiscountApplied);

                MySqlParameter prmDiscountType = new MySqlParameter("@DiscountType", MySqlDbType.Int16);
                prmDiscountType.Value = Convert.ToInt16(DiscountType.ToString("d"));
                cmd.Parameters.Add(prmDiscountType);

                MySqlParameter prmDiscount2Applied = new MySqlParameter("@Discount2Applied", MySqlDbType.Decimal);
                prmDiscount2Applied.Value = Discount2Applied;
                cmd.Parameters.Add(prmDiscount2Applied);

                MySqlParameter prmDiscount2Type = new MySqlParameter("@Discount2Type", MySqlDbType.Int16);
                prmDiscount2Type.Value = Convert.ToInt16(Discount2Type.ToString("d"));
                cmd.Parameters.Add(prmDiscount2Type);

                MySqlParameter prmDiscount3Applied = new MySqlParameter("@Discount3Applied", MySqlDbType.Decimal);
                prmDiscount3Applied.Value = Discount3Applied;
                cmd.Parameters.Add(prmDiscount3Applied);

                MySqlParameter prmDiscount3Type = new MySqlParameter("@Discount3Type", MySqlDbType.Int16);
                prmDiscount3Type.Value = Convert.ToInt16(Discount3Type.ToString("d"));
                cmd.Parameters.Add(prmDiscount3Type);

                MySqlParameter prmDebitMemoID = new MySqlParameter("@DebitMemoID", MySqlDbType.Int64);
                prmDebitMemoID.Value = DebitMemoID;
                cmd.Parameters.Add(prmDebitMemoID);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
コード例 #7
0
        public void UpdateDiscountFreightDeposit(long WBranchTransferID, decimal DiscountApplied, DiscountTypes DiscountType)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET " +
                                "DiscountApplied        =   @DiscountApplied, " +
                                "DiscountType           =   @DiscountType " +
                            "WHERE WBranchTransferID = @WBranchTransferID;";

                cmd.Parameters.AddWithValue("@DiscountApplied", DiscountApplied);
                cmd.Parameters.AddWithValue("@DiscountType", DiscountType.ToString("d"));
                cmd.Parameters.AddWithValue("@WBranchTransferID", WBranchTransferID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
コード例 #8
0
ファイル: PO.cs プロジェクト: marioricci/erp-luma
        public void UpdateDiscount(long POID, decimal DiscountApplied, DiscountTypes DiscountType, decimal Discount2Applied, DiscountTypes Discount2Type, decimal Discount3Applied, DiscountTypes Discount3Type)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                
                string SQL = "UPDATE tblPO SET " +
                                "DiscountApplied        =   @DiscountApplied, " +
                                "DiscountType           =   @DiscountType, " +
                                "Discount2Applied       =   @Discount2Applied, " +
                                "Discount2Type          =   @Discount2Type, " +
                                "Discount3Applied       =   @Discount3Applied, " +
                                "Discount3Type          =   @Discount3Type " +
                            "WHERE POID = @POID;";

                cmd.Parameters.AddWithValue("@DiscountApplied", DiscountApplied);
                cmd.Parameters.AddWithValue("@DiscountType", Convert.ToInt16(DiscountType.ToString("d")));
                cmd.Parameters.AddWithValue("@Discount2Applied", Discount2Applied);
                cmd.Parameters.AddWithValue("@Discount2Type", Convert.ToInt16(Discount2Type.ToString("d")));
                cmd.Parameters.AddWithValue("@Discount3Applied", Discount3Applied);
                cmd.Parameters.AddWithValue("@Discount3Type", Convert.ToInt16(Discount3Type.ToString("d")));
                cmd.Parameters.AddWithValue("@POID", POID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }