Exemplo n.º 1
0
        /// <summary>
        /// Конструктор для создания оплаты за производство
        /// </summary>
        /// <param name="productionOrder">Заказ</param>
        /// <param name="paymentDocumentNumber">Номер платежного документа</param>
        /// <param name="date">Дата оплаты</param>
        /// <param name="sumInCurrency">Сумма оплаты в валюте</param>
        /// <param name="currencyRate">Курс оплаты</param>
        /// <param name="form">Форма оплаты</param>
        public ProductionOrderPayment(ProductionOrder productionOrder, string paymentDocumentNumber, DateTime date, decimal sumInCurrency,
                                      CurrencyRate currencyRate, ProductionOrderPaymentForm form) : this(paymentDocumentNumber, date, sumInCurrency, currencyRate, form,
                                                                                                         ProductionOrderPaymentType.ProductionOrderProductionPayment)
        {
            ProductionOrder = productionOrder;
            ProductionOrder.AddPayment(this);

            ValidationUtils.Assert(!(currencyRate != null && productionOrder.Currency != currencyRate.Currency), "Курс оплаты не соответствует валюте заказа.");
        }
Exemplo n.º 2
0
        public ProductionOrderMaterialsPackage(ProductionOrder productionOrder, string name)
        {
            ProductionOrder = productionOrder;
            Name            = name;
            var date = DateTime.Now;

            CreationDate = LastChangeDate = date;
            documents    = new HashedSet <ProductionOrderMaterialsPackageDocument>();
        }
        public ProductionOrderCustomsDeclarationPayment(ProductionOrderCustomsDeclaration customsDeclaration, string paymentDocumentNumber, DateTime date,
                                                        decimal sumInCurrency, CurrencyRate currencyRate, ProductionOrderPaymentForm form) : base(paymentDocumentNumber, date, sumInCurrency, currencyRate, form,
                                                                                                                                                  ProductionOrderPaymentType.ProductionOrderCustomsDeclarationPayment)
        {
            ValidationUtils.NotNull(customsDeclaration, "Не указан таможенный лист.");
            CustomsDeclaration = customsDeclaration;
            CustomsDeclaration.AddPayment(this);

            ProductionOrder = CustomsDeclaration.ProductionOrder;
            ProductionOrder.AddPayment(this);
        }
        public ProductionOrderExtraExpensesSheetPayment(ProductionOrderExtraExpensesSheet extraExpensesSheet, string paymentDocumentNumber, DateTime date, decimal sumInCurrency,
                                                        CurrencyRate currencyRate, ProductionOrderPaymentForm form) : base(paymentDocumentNumber, date, sumInCurrency, currencyRate, form,
                                                                                                                           ProductionOrderPaymentType.ProductionOrderExtraExpensesSheetPayment)
        {
            ValidationUtils.NotNull(extraExpensesSheet, "Не указан лист дополнительных расходов.");
            ExtraExpensesSheet = extraExpensesSheet;
            ExtraExpensesSheet.AddPayment(this);

            ProductionOrder = ExtraExpensesSheet.ProductionOrder;
            ProductionOrder.AddPayment(this);

            ValidationUtils.Assert(!(currencyRate != null && extraExpensesSheet.Currency != currencyRate.Currency), "Курс не соответствует валюте листа дополнительных расходов.");
        }
Exemplo n.º 5
0
        public ProductionOrderTransportSheetPayment(ProductionOrderTransportSheet transportSheet, string paymentDocumentNumber, DateTime date, decimal sumInCurrency,
                                                    CurrencyRate currencyRate, ProductionOrderPaymentForm form) : base(paymentDocumentNumber, date, sumInCurrency, currencyRate, form,
                                                                                                                       ProductionOrderPaymentType.ProductionOrderTransportSheetPayment)
        {
            ValidationUtils.NotNull(transportSheet, "Не указан транспортный лист.");
            TransportSheet = transportSheet;
            TransportSheet.AddPayment(this);

            ProductionOrder = TransportSheet.ProductionOrder;
            ProductionOrder.AddPayment(this);

            ValidationUtils.Assert(!(currencyRate != null && transportSheet.Currency != currencyRate.Currency), "Курс не соответствует валюте транспортного листа.");
        }
Exemplo n.º 6
0
        /// <summary>
        /// Конструктор
        /// </summary>
        /// <param name="task">Задача</param>
        /// <param name="creationDate">Дата совершения изменений</param>
        /// <param name="createdBy">Пользователь, внесший изменения в исполнение задачи</param>
        internal TaskHistoryItem(Task task, DateTime creationDate, User createdBy,
                                 bool isContractorChanged, Contractor contractor, bool isDeadLineChanged, DateTime?deadLine, bool isDealChanged, Deal deal,
                                 bool isDeletionDateChanged, DateTime?deletionDate, bool isDescriptionChanged, string description, bool isExecutedByChanged, User executedBy,
                                 bool isFactualCompletionDateChanged, DateTime?factualCompletionDate, bool isFactualSpentTimeChanged, int?factualSpentTime, bool isTaskPriorityChanged,
                                 TaskPriority taskPriority, bool isProductionOrderChanged, ProductionOrder productionOrder, bool isStartDateChanged, DateTime?startDate, bool isTopicChanged,
                                 string topic, bool isTaskTypeChanged, TaskType taskType, bool isTaskExecutionStateChanged, TaskExecutionState taskExecutionState, TaskExecutionItem taskExecutionItem)
            : base(creationDate, createdBy)
        {
            ValidationUtils.NotNull(task, "Необходимо указать задачу, к которой относится история.");
            ValidationUtils.NotNull(description, "Описание не может быть null.");

            Task = task;

            IsContractorChanged = isContractorChanged;
            Contractor          = contractor;
            IsDeadLineChanged   = isDeadLineChanged;
            Deadline            = deadLine;
            IsDealChanged       = isDealChanged;
            Deal = deal;
            IsDeletionDateChanged          = isDeletionDateChanged;
            DeletionDate                   = deletionDate;
            IsDescriptionChanged           = isDescriptionChanged;
            Description                    = description;
            IsExecutedByChanged            = isExecutedByChanged;
            ExecutedBy                     = executedBy;
            IsFactualCompletionDateChanged = isFactualCompletionDateChanged;
            FactualCompletionDate          = factualCompletionDate;
            IsFactualSpentTimeChanged      = isFactualSpentTimeChanged;
            FactualSpentTime               = factualSpentTime;
            IsTaskPriorityChanged          = isTaskPriorityChanged;
            TaskPriority                   = taskPriority;
            IsProductionOrderChanged       = isProductionOrderChanged;
            ProductionOrder                = productionOrder;
            IsStartDateChanged             = isStartDateChanged;
            StartDate                   = startDate;
            IsTopicChanged              = isTopicChanged;
            Topic                       = topic;
            IsTaskTypeChanged           = isTaskTypeChanged;
            TaskType                    = taskType;
            IsTaskExecutionStateChanged = isTaskExecutionStateChanged;
            TaskExecutionState          = taskExecutionState;
            TaskExecutionItem           = taskExecutionItem;
        }
        public ProductionOrderPlannedPayment(ProductionOrder productionOrder, DateTime startDate, DateTime endDate, decimal sumInCurrency,
                                             Currency currency, CurrencyRate currencyRate, string purpose, ProductionOrderPaymentType purposeType)
        {
            CreationDate = DateTime.Now;

            payments = new HashedSet <ProductionOrderPayment>();

            ValidationUtils.Assert(sumInCurrency > 0, "Сумма оплаты должна быть больше нуля.");
            ValidationUtils.NotNull(currency, "Не указана валюта.");

            StartDate = startDate;
            EndDate   = endDate;
            CheckDates();

            SumInCurrency = sumInCurrency;
            Currency      = currency;
            CurrencyRate  = currencyRate;
            Purpose       = purpose;
            PaymentType   = purposeType;

            ProductionOrder = productionOrder;
            ProductionOrder.AddPlannedPayment(this);
        }