public static decimal GetInvoiceQuantity(string invoiceNo, string itemId, string unitId, string manufacturerId)
        {
            ReceiptInvoice invoice = new ReceiptInvoice();
            var            query   = HCMIS.Repository.Queries.ReceiptInvoice.SelectGetInvoiceQuantity(invoiceNo, itemId, unitId, manufacturerId);

            invoice.LoadFromRawSql(query);
            if (invoice.RowCount == 0)
            {
                return(0);
            }

            return((decimal)invoice.GetColumn("Quantity"));
        }
示例#2
0
        public static List <int> GetDeletedIDsAfter(long LastVersion)
        {
            BLL.ReceiptInvoice v = new BLL.ReceiptInvoice();
            v.LoadDeletedIDs(LastVersion);
            List <int> list = new List <int>();

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
        public static bool IsInvoiceElectronic(string invoiceNo)
        {
            ReceiptInvoice invoice = new ReceiptInvoice();
            var            query   = HCMIS.Repository.Queries.ReceiptInvoice.SelectIsInvoiceElectronic(invoiceNo);

            invoice.LoadFromRawSql(query);

            if (invoice.RowCount == 0)
            {
                return(false);
            }
            return((bool)invoice.GetColumn("IsElectronic"));
        }
        private bool IsFirstTabValid()
        {
            // check if the receive is being saved with a future date
            // it can receive date +1
            if (dtRecDate.Value > BLL.DateTimeHelper.ServerDateTime)
            {
                XtraMessageBox.Show("You cannot receive in a future date. please correct the date and try again.",
                    "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }

            if (!dxValidateAccount.Validate())
            {
                //XtraMessageBox.Show("Please select Account!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            //Check if Supplier is selected
            if (!srm && !beginningBalance)
            {
                if (BLL.Settings.IsCenter && !dxValidateReceiveInvoice.Validate())
                {
                    return false;
                }

            }

            if (dxValidatePassCode.Validate() && _isElectronic && !_isNonElectronicReceiveOnly)
            {

                if (standardRecType.Equals(StandardReceiptType.iGRVOnline) ||
                    deliveryNoteType == DeliveryNoteType.Automatic)
                {
                    if (dxValidatePassCode.Validate())
                    {
                        var receipt = new ReceiptInvoice();

                        receipt.GetPrintedDate(Convert.ToInt32(lkReceiptInvoice.EditValue));
                        var printedDate = (DateTime)receipt.GetColumn("PrintedDate");

                        try
                        {
                            var hourAndminute = printedDate.ToString("h:mm tt").Split(' ')[0].Replace(":", string.Empty);

                            if (hourAndminute != txtPassCode.Text)
                            {
                                XtraMessageBox.Show(
                                    "Value entered in the pass code is not correct.  Please enter the printed Hour and Minute from the STV .",
                                    "Pass Code Incorrect");
                                return false;
                            }
                        }
                        catch (FormatException ex)
                        {
                            XtraMessageBox.Show(
                                "Value format entered in the pass code is not correct.  Please use this format : mm/dd/yyyy",
                                "Pass Code Incorrect");
                            return false;
                        }
                    }

                    else
                    {
                        return false;
                    }
                }
            }

            return true;
        }
        public static bool IsInvoiceElectronic(string invoiceNo)
        {
            ReceiptInvoice invoice = new ReceiptInvoice();
            var query = HCMIS.Repository.Queries.ReceiptInvoice.SelectIsInvoiceElectronic(invoiceNo);
            invoice.LoadFromRawSql(query);

            if (invoice.RowCount == 0) return false;
            return (bool)invoice.GetColumn("IsElectronic");
        }
        public static decimal GetInvoiceQuantity(string invoiceNo, string itemId, string unitId, string manufacturerId)
        {
            ReceiptInvoice invoice = new ReceiptInvoice();
            var query = HCMIS.Repository.Queries.ReceiptInvoice.SelectGetInvoiceQuantity(invoiceNo, itemId, unitId, manufacturerId);
            invoice.LoadFromRawSql(query);
            if (invoice.RowCount == 0) return 0;

            return (decimal)invoice.GetColumn("Quantity");
        }
 public static List<int> GetDeletedIDsAfter(long LastVersion)
 {
     BLL.ReceiptInvoice v = new BLL.ReceiptInvoice();
     v.LoadDeletedIDs(LastVersion);
     List<int> list = new List<int>();
     while (!v.EOF)
     {
         list.Add((int)v.GetColumn("ID"));
         v.MoveNext();
     }
     return list;
 }