Example #1
0
        public void Anull()
        {
            foreach (purchase_return purchase_return in base.purchase_return.Local)
            {
                if (purchase_return.IsSelected && purchase_return.Error == null)
                {
                    List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                    Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                    payment_schedualList = _Payment.revert_Schedual(purchase_return);

                    Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                    List <item_movement> item_movementList = new List <item_movement>();
                    item_movementList = _Stock.revert_Stock(this, App.Names.PurchaseReturn, purchase_return.id_purchase_return);

                    if (payment_schedualList != null && payment_schedualList.Count > 0)
                    {
                        base.payment_schedual.RemoveRange(payment_schedualList);
                    }
                    if (item_movementList != null && item_movementList.Count > 0)
                    {
                        base.item_movement.RemoveRange(item_movementList);
                    }
                }
            }
        }
Example #2
0
        public void Anull()
        {
            foreach (sales_return sales_return in base.sales_return.Local)
            {
                if (sales_return.IsSelected && sales_return.Error == null)
                {
                    List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                    Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                    payment_schedualList = _Payment.revert_Schedual(sales_return);

                    Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                    List <item_movement> item_movementList = new List <item_movement>();
                    item_movementList = _Stock.revert_Stock(this, App.Names.SalesReturn, sales_return);

                    if (payment_schedualList != null && payment_schedualList.Count > 0)
                    {
                        base.payment_schedual.RemoveRange(payment_schedualList);
                    }
                    if (item_movementList != null && item_movementList.Count > 0)
                    {
                        base.item_movement.RemoveRange(item_movementList);
                    }

                    sales_return.status = Status.Documents_General.Annulled;
                    SaveChanges();
                }
            }
        }
Example #3
0
        public void Anull()
        {
            foreach (purchase_invoice purchase_invoice in base.purchase_invoice.Local)
            {
                if (purchase_invoice.IsSelected && purchase_invoice.Error == null)
                {
                    int count = purchase_invoice.purchase_invoice_detail.Where(x => x.purchase_return_detail == null).Count();
                    if (purchase_invoice.accounting_journal == null && count > 0)
                    {
                        List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                        Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                        payment_schedualList = _Payment.revert_Schedual(purchase_invoice);

                        Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                        List <item_movement> item_movementList = new List <item_movement>();
                        item_movementList = _Stock.revert_Stock(this, App.Names.PurchaseInvoice, purchase_invoice);

                        if (payment_schedualList != null && payment_schedualList.Count > 0)
                        {
                            base.payment_schedual.RemoveRange(payment_schedualList);
                        }

                        if (item_movementList != null && item_movementList.Count > 0)
                        {
                            //base.item_movement.RemoveRange(item_movementList);
                        }

                        purchase_invoice.status = Status.Documents_General.Annulled;
                        SaveChanges();
                    }
                }
            }
        }
Example #4
0
        public bool Annull()
        {
            NumberOfRecords = 0;
            foreach (sales_order sales_order in base.sales_order.Local)
            {
                if (sales_order.IsSelected && sales_order.Error == null)
                {
                    SaveChanges();

                    if (sales_order.status == Status.Documents_General.Approved)
                    {
                        if (sales_order.sales_invoice == null || sales_order.sales_invoice.Count == 0)
                        {
                            List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                            Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                            payment_schedualList = _Payment.revert_Schedual(sales_order);

                            Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                            List <item_movement> item_movementList = new List <item_movement>();
                            item_movementList = _Stock.revert_Stock(this, App.Names.SalesOrder, sales_order.id_sales_order);

                            if (payment_schedualList != null && payment_schedualList.Count > 0)
                            {
                                base.payment_schedual.RemoveRange(payment_schedualList);
                            }

                            if (item_movementList != null && item_movementList.Count > 0)
                            {
                                base.item_movement.RemoveRange(item_movementList);
                            }

                            sales_order.status = Status.Documents_General.Annulled;
                            SaveChanges();
                        }
                    }
                }

                NumberOfRecords       += 1;
                sales_order.IsSelected = false;
            }
            return(true);
        }
Example #5
0
        public bool Anull()
        {
            NumberOfRecords = 0;
            foreach (purchase_order purchase_order in base.purchase_order.Local)
            {
                if (purchase_order.IsSelected && purchase_order.Error == null)
                {
                    if (purchase_order.purchase_invoice.Count() == 0)
                    {
                        List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                        Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                        payment_schedualList = _Payment.revert_Schedual(purchase_order);

                        Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                        List <item_movement> item_movementList = new List <item_movement>();
                        item_movementList = _Stock.revert_Stock(this, App.Names.PurchaseOrder, purchase_order.id_purchase_order);

                        if (payment_schedualList != null && payment_schedualList.Count > 0)
                        {
                            base.payment_schedual.RemoveRange(payment_schedualList);
                        }

                        if (item_movementList != null && item_movementList.Count > 0)
                        {
                            base.item_movement.RemoveRange(item_movementList);
                        }

                        purchase_order.status = Status.Documents_General.Annulled;
                        SaveChanges();

                        //Clean Up
                        purchase_order.IsSelected = false;
                        NumberOfRecords          += 1;
                    }
                }
            }
            return(true);
        }
Example #6
0
        public void Anull()
        {
            SaveChanges();

            foreach (sales_invoice sales_invoice in base.sales_invoice.Local)
            {
                if (sales_invoice.IsSelected && sales_invoice.Error == null)
                {
                    if (sales_invoice.sales_invoice_detail.Where(x => x.sales_return_detail == null).Count() > 0
                        &&
                        sales_invoice.is_accounted == false)
                    {
                        List <payment_schedual> payment_schedualList = new List <payment_schedual>();
                        Brillo.Logic.Payment    _Payment             = new Brillo.Logic.Payment();
                        payment_schedualList = _Payment.revert_Schedual(sales_invoice);

                        Brillo.Logic.Stock   _Stock            = new Brillo.Logic.Stock();
                        List <item_movement> item_movementList = new List <item_movement>();
                        item_movementList = _Stock.revert_Stock(this, App.Names.SalesInvoice, sales_invoice);

                        if (payment_schedualList != null && payment_schedualList.Count > 0)
                        {
                            payment_schedual.RemoveRange(payment_schedualList);
                        }

                        if (item_movementList != null && item_movementList.Count > 0)
                        {
                            item_movement.RemoveRange(item_movementList);
                        }

                        sales_invoice.status = Status.Documents_General.Annulled;
                        SaveChanges();
                    }
                }
            }
        }