Example #1
0
        static double getStockDocLineAmount(DataRow docLine)
        {
            double        amount      = 0;
            ConstBool     isCancelled = (ConstBool)(short)ToolCell.isNull(docLine[TableSTLINE.CANCELLED], (short)ConstBool.yes);
            ConstLineType lineType    = (ConstLineType)(short)ToolCell.isNull(docLine[TableSTLINE.LINETYPE], (short)ConstLineType.undef);


            if (isCancelled == ConstBool.not && (lineType == ConstLineType.material || lineType == ConstLineType.promotion))
            {
                amount = (double)ToolCell.isNull(docLine[TableSTLINE.AMOUNT], 0.0);
                ConstIOCode ioCode = (ConstIOCode)(short)ToolCell.isNull(docLine[TableSTLINE.IOCODE], (short)0);
                switch (ioCode)
                {
                case ConstIOCode.input:
                case ConstIOCode.inputFromWarehouse:
                    amount = +amount;
                    break;

                case ConstIOCode.output:
                case ConstIOCode.outputFromWarehouse:
                    amount = -amount;
                    break;

                default:
                    amount = 0;
                    break;
                }
            }
            return(amount);
        }
Example #2
0
        double getFix(object lref, DataRow lRow, DataRowVersion vers)
        {
            double fix = 0;

            if ((string)lref == (string)lRow[TableSTLINE.STOCKREF, vers])
            {
                ConstBool isCancelled = (ConstBool)(short)ToolCell.isNull(lRow[TableSTLINE.CANCELLED, vers], (short)ConstBool.yes);
                if (isCancelled == ConstBool.not)
                {
                    ConstLineType lineType = (ConstLineType)(short)ToolCell.isNull(lRow[TableSTLINE.LINETYPE, vers], (short)ConstLineType.undef);
                    double        amount   = (double)ToolCell.isNull(lRow[TableSTLINE.AMOUNT, vers], (double)0.0);
                    ConstIOCode   ioCode   = (ConstIOCode)(short)ToolCell.isNull(lRow[TableSTLINE.IOCODE, vers], (short)0);
                    if (lineType == ConstLineType.material || lineType == ConstLineType.promotion)
                    {
                        fix += (amount * getIOSign(ioCode));
                    }
                }
            }
            return(fix);
        }
Example #3
0
 public void Visit(ConstBool constBool)
 {
     result.Push(BuiltIns.Bool);
 }
Example #4
0
 public void Visit(ConstBool constBool)
 {
 }
Example #5
0
 public void Visit(ConstBool constBool)
 {
     result.Push(constBool);
 }