public App_History(App_WorkTicket workTicket, CI_Item item, JT_EquipmentAsset equipmentAsset,
                    JT_ServiceAgreementHeader serviceAgreementHeader, JT_ServiceAgreementDetail serviceAgreementDetail,
                    JT_Transaction transaction, JT_LaborText laborText)
 {
     _workTicket             = workTicket;
     _item                   = item;
     _equipmentAsset         = equipmentAsset;
     _serviceAgreementHeader = serviceAgreementHeader;
     if (serviceAgreementDetail == null)
     {
         _serviceAgreementDetail = new JT_ServiceAgreementDetail();
     }
     else
     {
         _serviceAgreementDetail = serviceAgreementDetail;
     }
     _transaction = transaction;
     if (laborText == null)
     {
         _laborText = new JT_LaborText();
     }
     else
     {
         _laborText = laborText;
     }
 }
 public App_History(App_WorkTicket workTicket, CI_Item item, JT_EquipmentAsset equipmentAsset,
                    JT_ServiceAgreementHeader serviceAgreementHeader, JT_ServiceAgreementDetail serviceAgreementDetail,
                    JT_TransactionHistory transactionHistory, JT_LaborText laborText)
 {
     _workTicket             = workTicket;
     _item                   = item;
     _equipmentAsset         = equipmentAsset;
     _serviceAgreementHeader = serviceAgreementHeader;
     _serviceAgreementDetail = serviceAgreementDetail;
     _transaction            = new JT_Transaction()
     {
         Comment         = transactionHistory.Comment,
         HoursWorked     = transactionHistory.HoursWorked,
         ItemCode        = transactionHistory.ItemCode,
         ItemCodeDesc    = transactionHistory.ItemCodeDesc,
         QuantityUsed    = transactionHistory.QuantityUsed,
         RecordType      = transactionHistory.RecordType,
         SalesOrderNo    = transactionHistory.SalesOrderNo,
         TransactionDate = transactionHistory.TransactionDate,
         WTNumber        = transactionHistory.WTNumber,
         WTStep          = transactionHistory.WTStep
     };
     _transactionHistory = transactionHistory;
     _laborText          = laborText;
 }
        public App_CurrentWorkTicket()
        {
            // empty
            _workTicket       = App.Database.RetrieveCurrentWorkTicket();
            _workTicketText   = App.Database.RetrieveTextFromCurrentWorkTicket();
            _salesOrderHeader = App.Database.RetrieveSalesOrderHeaderFromCurrentWorkTicket();
            _customer         = App.Database.RetrieveCustomerFromCurrentWorkTicket();
            _repairItem       = App.Database.RetrieveRepairItemFromCurrentWorkTicket();
            //_partsList = App.Database.RetrievePartsListFromCurrentWorkTicket();

            //_timeEntry = App.Database.
        }
Exemple #4
0
 public App_History(App_WorkTicket workTicket, CI_Item item, JT_EquipmentAsset equipmentAsset,
                    JT_ServiceAgreementHeader serviceAgreementHeader, JT_ServiceAgreementDetail serviceAgreementDetail,
                    JT_Transaction transaction, JT_LaborText laborText)
 {
     _workTicket             = workTicket;
     _item                   = item;
     _equipmentAsset         = equipmentAsset;
     _serviceAgreementHeader = serviceAgreementHeader;
     _serviceAgreementDetail = serviceAgreementDetail;
     _transaction            = transaction;
     _laborText              = laborText;
 }
        public App_RepairPart(JT_EquipmentAsset part, App_WorkTicket workTicket, CI_Item item)
        {
            _ciOptions           = App.Database.GetCIOptions();
            quantityFormatString = String.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInQty, "}");
            umFormatString       = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInUM, "}");
            costFormatString     = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInCost, "}");
            priceFormatString    = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInPrice, "}");

            _workTicket              = workTicket;
            _id                      = 0;
            _parentItemCode          = workTicket.DtlRepairItemCode;
            _partItemCode            = part.ItemCode;
            _partItemCodeDescription = item.ItemCodeDesc;
            _warehouse               = item.DefaultWarehouseCode;
            _problemCode             = workTicket.DtlProblemCode;
            _quantity                = 0.0;

            // dch rkl 12/02/2016 Get Item Unit Cost based on JT_Options.DefaultPartsCost
            _unitCost = GetItemUnitCost(item.LastTotalUnitCost, item.AverageUnitCost, item.StandardUnitCost);
            //_unitCost = (double)item.StandardUnitCost;

            _unitPrice = Convert.ToDouble(item.StandardUnitPrice);

            // dch rkl 02/03/2017 Use the sales unit of measure instead of the standard unit of measure
            //_unitOfMeasure = item.StandardUnitOfMeasure;
            _unitOfMeasure = item.SalesUnitOfMeasure;

            _comment      = string.Empty;
            _isChargeable = SetIsChargeable();
            _isPrintable  = (_isChargeable ? true : false);
            _isPurchased  = false;
            _isOverhead   = _workTicket.PartsCalculateOverheadDefault;

            // dch rkl 11/23/2016 Add Item Type
            _itemType = item.ItemType;

            // dch rkl 12/05/2016 Add Item Valuation
            _valuation = item.Valuation;

            // dch rkl 11/30/2016 add quantity required
            _quantityReqd = 0;

            // dch rkl 12/05/2016 add qty shipped
            _quantityShipped = 0;

            // dch rkl 01/13/2017 Add Extended Description
            _itemCodeDesc = "";

            // dch rkl 01/23/2017 Sales Order Line Key
            _soLineKey = "";
        }
        public App_RepairPart(CI_Item item, App_WorkTicket workTicket)
        {
            _workTicket = workTicket;

            _id                      = 0;
            _parentItemCode          = workTicket.DtlRepairItemCode;
            _partItemCode            = item.ItemCode;
            _partItemCodeDescription = item.ItemCodeDesc;
            _warehouse               = item.DefaultWarehouseCode;
            _problemCode             = _workTicket.DtlProblemCode;
            _quantity                = 0.0;
            _unitCost                = Convert.ToDouble(item.StandardUnitCost);
            _unitPrice               = Convert.ToDouble(item.StandardUnitPrice);
            _unitOfMeasure           = item.StandardUnitOfMeasure;
            _comment                 = string.Empty;
            _isChargeable            = SetIsChargeable();
            _isPrintable             = (_isChargeable ? true : false);
            _isPurchased             = false;
            _isOverhead              = _workTicket.PartsCalculateOverheadDefault;
        }
Exemple #7
0
 public App_Item(CI_Item item, IM_ItemWarehouse itemWarehouse, JT_EquipmentAsset equipmentAsset)
 {
     _item           = item;
     _itemWarehouse  = itemWarehouse;
     _equipmentAsset = equipmentAsset;
 }
        /// <summary>
        /// Contstructor for repair part objects using the transaction import detail records.
        /// </summary>
        /// <param name="importDetail">The JT_TransactionImportDetail record to use.</param>
        /// <param name="workTicket">The App_WorkTicket object associated with this part.</param>
        public App_RepairPart(JT_TransactionImportDetail importDetail, App_WorkTicket workTicket)
        {
            _ciOptions           = App.Database.GetCIOptions();
            quantityFormatString = String.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInQty, "}");
            umFormatString       = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInUM, "}");
            costFormatString     = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInCost, "}");
            priceFormatString    = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInPrice, "}");

            _workTicket = workTicket;

            _id                      = importDetail.ID;
            _parentItemCode          = workTicket.DtlRepairItemCode;
            _partItemCode            = importDetail.ItemCode;
            _partItemCodeDescription = importDetail.ItemCodeDesc;

            // dch rkl 11/22/2016
            CI_Item item = App.Database.GetItemFromDB(_partItemCode);

            if (_partItemCodeDescription == null)
            {
                if (item != null && item.ItemCodeDesc != null)
                {
                    _partItemCodeDescription = item.ItemCodeDesc;
                }
                else
                {
                    _partItemCodeDescription = "";
                }
            }

            // dch rkl 12/05/2016 Make sure part has a valuation value

            _warehouse     = importDetail.WarehouseCode;
            _problemCode   = importDetail.ProblemCode;
            _quantity      = importDetail.QuantityUsed;
            _unitCost      = importDetail.UnitCost;
            _unitPrice     = importDetail.UnitPrice;
            _unitOfMeasure = importDetail.UnitOfMeasure;
            _comment       = importDetail.CommentText;
            _lotSerialNo   = importDetail.LotSerialNo;
            _isChargeable  = (((importDetail.ChargePart != null) && (importDetail.ChargePart.Trim().ToUpper() == "Y")) ? true : false);
            _isPrintable   = (((importDetail.PrintPart != null) && (importDetail.PrintPart.Trim().ToUpper() == "Y")) ? true : false);
            _isPurchased   = (((importDetail.PurchasePart != null) && (importDetail.PurchasePart.Trim().ToUpper() == "Y")) ? true : false);
            _isOverhead    = (((importDetail.Overhead != null) && (importDetail.Overhead.Trim().ToUpper() == "Y")) ? true : false);

            // dch rkl 11/23/2016 Add Item Type
            if (item != null && item.ItemType != null)
            {
                _itemType = item.ItemType;
            }

            // dch rkl 12/05/2016 Add Item Valuation
            if (item != null && item.Valuation != null)
            {
                _valuation = item.Valuation;
            }

            // dch rkl 11/30/2016 add quantity required
            _quantityReqd = (decimal)importDetail.QuantityRequired;

            // dch rkl 12/05/2016 add qty shipped
            _quantityShipped = importDetail.QuantityCompleted;

            // dch rkl 01/13/2017 Add Extended Description
            if (importDetail.ItemCodeDesc != null)
            {
                _itemCodeDesc = importDetail.ItemCodeDesc;
            }
            else
            {
                _itemCodeDesc = "";
            }

            // dch rkl 01/23/2017 Sales Order Line Key
            _soLineKey = importDetail.SOLineKey;
        }
Exemple #9
0
        public App_RepairPart(CI_Item item, App_WorkTicket workTicket, string itemCode)
        {
            _ciOptions           = App.Database.GetCIOptions();
            quantityFormatString = String.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInQty, "}");
            umFormatString       = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInUM, "}");
            costFormatString     = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInCost, "}");
            priceFormatString    = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInPrice, "}");

            _workTicket = workTicket;

            _id             = 0;
            _parentItemCode = workTicket.DtlRepairItemCode;

            // dch rkl 10/31/2016 handle nulls
            if (item != null)
            {
                _partItemCode            = item.ItemCode;
                _partItemCodeDescription = item.ItemCodeDesc;
                _warehouse = item.DefaultWarehouseCode;

                // dch rkl 12/02/2016 Get Item Unit Cost based on JT_Options.DefaultPartsCost
                _unitCost = GetItemUnitCost(item.LastTotalUnitCost, item.AverageUnitCost, item.StandardUnitCost);
                //_unitCost = (double)item.StandardUnitCost;

                _unitPrice = Convert.ToDouble(item.StandardUnitPrice);

                // dch rkl 02/03/2017 Per Jeanne, Use the Sales Unit of Measure, not the Standard Unit of Measure
                //_unitOfMeasure = item.StandardUnitOfMeasure;
                _unitOfMeasure = item.SalesUnitOfMeasure;

                // dch rkl 11/23/2016 Add Item Type
                _itemType = item.ItemType;

                // dch rkl 12/05/2016 Add Item Valuation
                _valuation = item.Valuation;
            }
            else
            {
                _partItemCode            = "";
                _partItemCodeDescription = "";
                _warehouse     = "";
                _unitCost      = 0;
                _unitPrice     = 0;
                _unitOfMeasure = "";
                _itemType      = "";
                _valuation     = "";
            }

            _problemCode  = _workTicket.DtlProblemCode;
            _quantity     = 0.0;
            _comment      = string.Empty;
            _isChargeable = SetIsChargeable();
            _isPrintable  = (_isChargeable ? true : false);
            _isPurchased  = false;
            _isOverhead   = _workTicket.PartsCalculateOverheadDefault;

            //bk check existing sales order detail
            //bk use workticket item instead of item in case of null

            SO_SalesOrderDetail soDetail = App.Database.GetSalesOrderDetail(workTicket.SalesOrderNo, (item == null ? itemCode : item.ItemCode));

            if (soDetail != null)
            {
                _isChargeable = soDetail.JT158_WTChargePart == "Y" ? true : false;
                _isPrintable  = soDetail.JT158_WTPrintPart == "Y" ? true : false;
                _isPurchased  = soDetail.JT158_WTPurchase == "Y" ? true : false;
                _isOverhead   = soDetail.JT158_WTOverhead == "Y" ? true : false;
            }

            // dch rkl 11/30/2016 add quantity required
            _quantityReqd = 0;

            // dch rkl 12/05/2016 add qty shipped
            _quantityShipped = 0;

            // dch rkl 01/13/2017 Add Extended Description
            _itemCodeDesc = "";

            // dch rkl 01/23/2017 Sales Order Line Key
            _soLineKey = "";
        }
Exemple #10
0
        public App_RepairPart(JT_ServiceEquipmentParts part, App_WorkTicket workTicket, CI_Item item)
        {
            _ciOptions           = App.Database.GetCIOptions();
            quantityFormatString = String.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInQty, "}");
            umFormatString       = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInUM, "}");
            costFormatString     = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInCost, "}");
            priceFormatString    = string.Concat("{0:F", _ciOptions.NumberOfDecimalPlacesInPrice, "}");

            _workTicket              = workTicket;
            _id                      = 0;
            _parentItemCode          = workTicket.DtlRepairItemCode;
            _partItemCode            = part.ItemCode;
            _partItemCodeDescription = item.ItemCodeDesc;
            _warehouse               = item.DefaultWarehouseCode;
            _problemCode             = part.ProblemCode;
            _quantity                = part.Quantity;

            // dch rkl 12/02/2016 Get Item Unit Cost based on JT_Options.DefaultPartsCost
            _unitCost = GetItemUnitCost(item.LastTotalUnitCost, item.AverageUnitCost, item.StandardUnitCost);
            //_unitCost = (double)item.StandardUnitCost;

            _unitPrice = (double)item.StandardUnitPrice;

            // dch rkl 02/03/2017 Use the sales unit of measure instead of the standard unit of measure
            //_unitOfMeasure = item.StandardUnitOfMeasure;
            _unitOfMeasure = item.SalesUnitOfMeasure;

            _comment      = "";
            _isChargeable = part.IsChargeable;
            _isPrintable  = part.IsPrintable;
            _isPurchased  = part.IsPurchased;
            _isOverhead   = part.IsOverhead;

            //bk check existing sales order detail
            SO_SalesOrderDetail soDetail = App.Database.GetSalesOrderDetail(workTicket.SalesOrderNo, item.ItemCode);

            if (soDetail != null)
            {
                _isChargeable = soDetail.JT158_WTChargePart == "Y" ? true : false;
                _isPrintable  = soDetail.JT158_WTPrintPart == "Y" ? true : false;
                _isPurchased  = soDetail.JT158_WTPurchase == "Y" ? true : false;
                _isOverhead   = soDetail.JT158_WTOverhead == "Y" ? true : false;
            }

            // dch rkl 11/23/2016 Add Item Type
            _itemType = item.ItemType;

            // dch rkl 12/05/2016 Add Item Valuation
            _valuation = item.Valuation;

            // dch rkl 11/30/2016 add quantity required
            _quantityReqd = 0;

            // dch rkl 12/05/2016 add qty shipped
            _quantityShipped = 0;

            // dch rkl 01/13/2017 Add Extended Description
            _itemCodeDesc = "";

            // dch rkl 01/23/2017 Sales Order Line Key
            _soLineKey = "";
        }
 public App_RepairItem(CI_Item repairItem, JT_EquipmentAsset equipmentAsset)
 {
     _repairItem     = repairItem;
     _equipmentAsset = equipmentAsset;
 }