Пример #1
0
        public SupplierInvoiceSplit RemoveSupplierFormInvoiceNumber(string InvoiceNumberWithSupplier, List <string> Suppliers)
        {
            SupplierInvoiceSplit ins    = new SupplierInvoiceSplit();
            SupplierRepository   suprep = new SupplierRepository();

            foreach (string supplier in Suppliers)
            {
                if (InvoiceNumberWithSupplier.Contains(supplier))
                {
                    InvoiceNumberWithSupplier = InvoiceNumberWithSupplier.Replace((" " + supplier), "");
                    ins.InvoiceNumber         = InvoiceNumberWithSupplier;
                    ins.SupplierId            = suprep.GetSupplier(supplier).SupplierID;
                }
            }

            return(ins);
        }
Пример #2
0
        public DateTime GetPaymentDate(int SupplierId, DateTime GRVDate)
        {
            if (GRVDate == null)
            {
                return(DateTime.MinValue);
            }
            else
            {
                Supplier sup = suprep.GetSupplier(SupplierId);

                /*
                 * Execpt for direct
                 * First Friday from GRV + Supplier Term
                 */

                // If paydate sunday = move to monday

                DateTime Ret = (sup.SupplierID == 0) ? DateTime.MinValue : GRVDate;
                Ret = (sup.FromFriday) ? GetFirstFriday(Ret).AddDays(checkInt(sup.Term)) : Ret.AddDays(checkInt(sup.Term));

                return(Ret);
            }
        }
        public SupplierInvoiceSplit RemoveSupplierFormInvoiceNumber(string InvoiceNumberWithSupplier, List<string> Suppliers)
        {
            SupplierInvoiceSplit ins = new SupplierInvoiceSplit();
            SupplierRepository suprep = new SupplierRepository();

            foreach(string supplier in Suppliers)
            {
                if(InvoiceNumberWithSupplier.Contains(supplier))
                {
                    InvoiceNumberWithSupplier = InvoiceNumberWithSupplier.Replace((" " + supplier), "");
                    ins.InvoiceNumber = InvoiceNumberWithSupplier;
                    ins.SupplierId = suprep.GetSupplier(supplier).SupplierID;
                }
            }

            return ins;
        }