示例#1
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);
            }
        }
示例#2
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);
 }