Beispiel #1
0
 internal void ClearThroughCustom(Entities entities, ClearenceProcedure procedure, int sadConsignmentNumber, Action <Disposal> reCalculate)
 {
     CustomsStatus    = Linq.CustomsStatus.Started;
     CustomsProcedure = Entities.ToString(procedure);
     SadConsignmentNo = SADConsignment.DocumentNumber(entities, sadConsignmentNumber);
     reCalculate(this);
 }
Beispiel #2
0
        /// <summary>
        /// Exports the specified entities.
        /// </summary>
        /// <param name="entities">The entities.</param>
        /// <param name="quantity">The quantity.</param>
        /// <param name="closingBatch">if set to <c>true</c> the batch is to be closed.</param>
        /// <param name="invoiceContent">Content of the invoice.</param>
        /// <param name="sadConsignmentNumber">The sad consignment number.</param>
        /// <param name="reCalculate">The recalculate delegate is used to adjust VAT, duty and value for last started disposal.</param>
        /// <exception cref="ApplicationError">if any internal exception has to be cough.</exception>
        internal void Export(Entities entities, ref decimal quantity, bool closingBatch, InvoiceContent invoiceContent, int sadConsignmentNumber, Action <Disposal> reCalculate)
        {
            string _at = "Starting";

            try
            {
                if (!closingBatch)
                {
                    if (quantity < this.SettledQuantityDec)
                    {
                        _at = "_newDisposal";
                        Disposal _newDisposal = new Disposal(Disposal2IPRIndex, DisposalStatus.Value, this.SettledQuantityDec - quantity);
                        _newDisposal.Material   = this.Disposal2MaterialIndex;
                        this.SettledQuantityDec = quantity;
                        quantity = 0;
                        _at      = "InsertOnSubmit";
                        entities.Disposal.InsertOnSubmit(_newDisposal);
                        reCalculate = x => { };
                    }
                    else
                    {
                        quantity -= this.SettledQuantityDec;
                    }
                }
                _at = "ClearThroughCustom";
                this.ClearThroughCustom(invoiceContent, reCalculate);
                this.SadConsignmentNo = SADConsignment.DocumentNumber(entities, sadConsignmentNumber);
            }
            catch (Exception _ex)
            {
                throw new ApplicationError(@"CAS.SmartFactory.IPR.WebsiteModel.Linq.Disposal.Export", _at, _ex.Message, _ex);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Clears the through custom.
 /// </summary>
 /// <param name="entities">The entities.</param>
 /// <param name="sadConsignment">The _sad consignment.</param>
 /// <param name="trace">The trace action.</param>
 public void ClearThroughCustom(Entities entities, SADConsignment sadConsignment, NamedTraceLogger.TraceAction trace)
 {
     SADConsignmentLibraryIndex = sadConsignment;
     foreach (Disposal _Disposal in this.Disposal(entities))
     {
         _Disposal.ClearThroughCustom(entities, this.ClearenceProcedure.Value, this.SADDocumentNumber, _disposal => _disposal.Disposal2IPRIndex.RecalculateLastStarted(entities, _disposal, trace));
     }
     UpdateTitle(entities);
 }