예제 #1
0
        public IncomingCalculationParameters(PXGraph graph, FABookBalance bookBalance)
        {
            Graph       = graph;
            BookBalance = bookBalance;

            FixedAsset = SelectFrom <FixedAsset>
                         .Where <FixedAsset.assetID.IsEqual <@P.AsInt> >
                         .View
                         .Select(Graph, AssetID);

            Details = SelectFrom <FADetails>
                      .Where <FADetails.assetID.IsEqual <@P.AsInt> >
                      .View
                      .Select(Graph, AssetID);

            Method = SelectFrom <FADepreciationMethod>
                     .Where <FADepreciationMethod.methodID.IsEqual <@P.AsInt> >
                     .View
                     .Select(Graph, BookBalance.DepreciationMethodID);

            Precision = (int)SelectFrom <Currency>
                        .InnerJoin <Company>
                        .On <Company.baseCuryID.IsEqual <Currency.curyID> >
                        .View
                        .Select(Graph)
                        .RowCast <Currency>()
                        .FirstOrDefault()
                        .DecimalPlaces;

            // TODO: CollectAdditions() must be invoked after AC-156072 implementation
            Additions = CollectAdditionsFromHistory();
        }
예제 #2
0
        /// <summary>
        /// Set default values in FSEquipment from the Fixed Asset specified.
        /// </summary>
        public static void SetDefaultValuesFromFixedAsset(PXCache cacheFSEquipment, FSEquipment fsEquipmentRow, int?fixedAssetID)
        {
            if (fixedAssetID == null)
            {
                return;
            }

            FADetails faDetailsRow = PXSelect <FADetails,
                                               Where <
                                                   FADetails.assetID, Equal <Required <FADetails.assetID> > > >
                                     .Select(cacheFSEquipment.Graph, fixedAssetID);

            if (faDetailsRow != null)
            {
                cacheFSEquipment.SetValueExt <FSEquipment.purchDate>(fsEquipmentRow, faDetailsRow.ReceiptDate);
                cacheFSEquipment.SetValueExt <FSEquipment.registeredDate>(fsEquipmentRow, faDetailsRow.DepreciateFromDate);
                cacheFSEquipment.SetValueExt <FSEquipment.purchAmount>(fsEquipmentRow, faDetailsRow.AcquisitionCost);
                cacheFSEquipment.SetValueExt <FSEquipment.purchPONumber>(fsEquipmentRow, faDetailsRow.PONumber);
                cacheFSEquipment.SetValueExt <FSEquipment.propertyType>(fsEquipmentRow, faDetailsRow.PropertyType);
                cacheFSEquipment.SetValueExt <FSEquipment.serialNumber>(fsEquipmentRow, faDetailsRow.SerialNumber);
            }
        }