예제 #1
0
        /// <summary>
        /// Получение перечня упаковочных работ.
        /// </summary>
        public ArrayList GetPackingWorks()
        {
            ArrayList PackingWorksList = new ArrayList();

            // Если прибор гарантийный и гарантия не аннулирована, не включаем стоимость упаковки в калькуляцию
            if ((this.WarrantyRepair) && (!this.VoidWarranty))
            {
                return(PackingWorksList);
            }

            string BlockName           = "";
            string BlockNameID         = "";
            string WorksType           = "Упаковка и накладные расходы";
            string WorksTypeID         = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorksType);
            int    Amount              = 1;
            bool   Improvement         = false;
            bool   VoidWarranty        = this.VoidWarranty;
            bool   DoubleCost          = false;
            string DescriptionOfReason = this.DescriptionOfReason;
            bool   RefusalToRepair     = this.RefusalToRepair;

            CalculationItem NewItem = new CalculationItem(Card, DeviceName, DeviceItemID, BlockName, BlockNameID, WorksType, WorksTypeID, Improvement, Amount, true, VoidWarranty, DoubleCost,
                                                          DescriptionOfReason, RefusalToRepair);

            PackingWorksList.Add(NewItem);

            return(PackingWorksList);
        }
예제 #2
0
        /// <summary>
        /// Получение перечня ремонтных работ.
        /// </summary>
        public ArrayList GetRepairWorks()
        {
            ArrayList RepairWorksList = new ArrayList();

            // Если прибор гарантийный и гарантия не аннулирована, не включаем ремонтные работы в калькуляцию
            if ((this.WarrantyRepair) && (!this.VoidWarranty))
            {
                return(RepairWorksList);
            }

            // Если клиент отказался от ремонта, то не включаем ремонтные работы в калькуляцию
            //if (this.RefusalToRepair)
            //{ return RepairWorksList; }

            CardData    SCard       = Card.CardScript.Session.CardManager.GetCardData(new Guid(this.ServiceCardID));
            SectionData RepairWorks = SCard.Sections[RefServiceCard.RepairWorks.ID.ToGuid()];

            if ((RepairWorks != null) && (RepairWorks.Rows.Count > 0))
            {
                RowDataCollection RowDescriptions = SCard.Sections[RefServiceCard.DescriptionOfFault.ID.ToGuid()].Rows;
                foreach (RowData Row in RepairWorks.Rows)
                {
                    if (Row.GetString(RefServiceCard.RepairWorks.NegotiationResult) != "Не выполнять")
                    {
                        RowData Description = null;
                        foreach (RowData RowDescription in RowDescriptions)
                        {
                            if (RowDescription.GetGuid(RefServiceCard.DescriptionOfFault.Id) == Row.GetGuid(RefServiceCard.RepairWorks.ParentTableRowId))
                            {
                                Description = RowDescription;
                            }
                        }

                        string BlockName           = Description.GetString(RefServiceCard.DescriptionOfFault.BlockOfDevice);
                        string BlockNameID         = Description.GetString(RefServiceCard.DescriptionOfFault.BlockOfDeviceID);
                        string WorksType           = Row.GetString(RefServiceCard.RepairWorks.WorksType);
                        string WorksTypeID         = Row.GetString(RefServiceCard.RepairWorks.WorksTypeID);
                        int    Amount              = this.DoubleCost == true ? (int)Row.GetDecimal(RefServiceCard.RepairWorks.Amount) * 2 : (int)Row.GetDecimal(RefServiceCard.RepairWorks.Amount);
                        bool   Improvement         = (bool)Row.GetBoolean(RefServiceCard.RepairWorks.Revision);
                        bool   VoidWarranty        = this.VoidWarranty;
                        bool   DoubleCost          = this.DoubleCost;
                        string DescriptionOfReason = this.DescriptionOfReason;
                        bool   RefusalToRepair     = this.RefusalToRepair;


                        CalculationItem NewItem = new CalculationItem(Card, DeviceName, DeviceItemID, BlockName, BlockNameID, WorksType, WorksTypeID, Improvement, Amount, true, VoidWarranty, DoubleCost,
                                                                      DescriptionOfReason, RefusalToRepair);
                        RepairWorksList.Add(NewItem);
                    }
                }
            }
            return(RepairWorksList);
        }
예제 #3
0
        /// <summary>
        /// Получение перечня калибровочных работ.
        /// </summary>
        public ArrayList GetCalibrateWorks()
        {
            ArrayList CalibrateWorksList = new ArrayList();

            // Если прибор гарантийный и гарантия не аннулирована, не включаем калибровку в калькуляцию
            if ((this.WarrantyRepair) && (!this.VoidWarranty))
            {
                return(CalibrateWorksList);
            }

            /* Калибровка прибора */
            string WorkName = "";

            if (this.OnlyAccessories)
            {
                WorkName = "Диагностика комплектующих";
            }
            else
            {
                WorkName = "Калибровка " + this.DeviceType;
                if (this.GetAge() > 10)
                {
                    WorkName = WorkName + " (старше 10 лет)";
                }
            }

            string CalibWorkID         = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorkName);
            string BlockName           = "";
            string BlockNameID         = "";
            string WorksType           = WorkName;
            string WorksTypeID         = CalibWorkID;
            int    Amount              = 1;
            bool   Improvement         = false;
            bool   VoidWarranty        = this.VoidWarranty;
            bool   DoubleCost          = false;
            string DescriptionOfReason = this.DescriptionOfReason;
            bool   RefusalToRepair     = this.RefusalToRepair;

            CalculationItem NewItem = new CalculationItem(Card, DeviceName, DevicePassportID, BlockName, BlockNameID, WorksType, WorksTypeID, Improvement, Amount, true, VoidWarranty, DoubleCost,
                                                          DescriptionOfReason, RefusalToRepair);

            CalibrateWorksList.Add(NewItem);

            /* Калибровочные работы для дополнительных изделий */
            foreach (AdditionalWare CurrentWare in AdditionalWaresList)
            {
                WorkName = "Калибровка " + CurrentWare.TypeName;
                if (CurrentWare.GetAge() > 10)
                {
                    WorkName = WorkName + " (старше 10 лет)";
                }
                CalibWorkID = ServicesCard.GetItemID(ApplicationCard.UniversalCard, WorkName);

                string WaresBlockName           = "";
                string WaresBlockNameID         = "";
                string WaresWorksType           = WorkName;
                string WaresWorksTypeID         = CalibWorkID;
                int    WaresWorkAmount          = 1;
                bool   WaresImprovement         = false;
                bool   WaresVoidWarranty        = this.VoidWarranty;
                bool   WaresDoubleCost          = false;
                string WaresDescriptionOfReason = this.DescriptionOfReason;
                bool   WaresRefusalToRepair     = this.RefusalToRepair;

                CalculationItem NewWaresItem = new CalculationItem(Card, DeviceName, DevicePassportID, WaresBlockName, WaresBlockNameID, WaresWorksType, WaresWorksTypeID, WaresImprovement, WaresWorkAmount,
                                                                   true, WaresVoidWarranty, WaresDoubleCost, WaresDescriptionOfReason, WaresRefusalToRepair);
                CalibrateWorksList.Add(NewWaresItem);
            }
            return(CalibrateWorksList);
        }