Esempio n. 1
0
        protected override bool QtyColumnEvaluate(ref int row, double qtyValue)
        {
            if (!CheckQuantityLimitations(qtyValue, row, grid))
            {
                return(false);
            }

            StockTakingDetail detail = operation.Details [row];

            if (barcodeUsed)
            {
                StockTakingDetail detailWithSameItem = operation.Details.LastOrDefault(d => d != detail &&
                                                                                       d.PriceInDB.IsEqualTo(detail.PriceInDB) && d.PriceOutDB.IsEqualTo(detail.PriceOutDB) &&
                                                                                       d.ItemId == detail.ItemId && d.LotId == detail.LotId && Lot.CompareLots(d.Lot, detail.Lot));

                if (detailWithSameItem != null)
                {
                    double increment = operation.Details [row].QuantityIncrement;
                    detailWithSameItem.EnteredQuantity += increment * (codeQtty.IsZero() ? codeQtty = 1 : codeQtty);
                    DeleteGridRow(true, false);
                    --row;
                    return(true);
                }
            }
            detail.EnteredQuantity = qtyValue;
            return(true);
        }