示例#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);
        }
示例#2
0
 public static short[] translateForMaterial(ConstDocTypeMaterial docType, ConstLineType lineType)
 {
     lock (mutex)
     {
         short[] res = null;
         initTable();
         DataRow row = table.Rows.Find(new object[] { docType, lineType });
         if (row != null)
         {
             res    = new short[2];
             res[0] = (short)row[glTrCode];
             res[1] = (short)row[glType];
         }
         return(res);
     }
 }
示例#3
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);
        }
示例#4
0
 public virtual void setLineType(ConstLineType lineType)
 {
     throw new MyException.MyExceptionInner(MessageCollection.T_MSG_ERROR_UNDEF);
 }
示例#5
0
 public override void setLineType(ConstLineType lineType)
 {
     setLine(TableSTLINE.LINETYPE, (short)lineType);
 }