Пример #1
0
        public Document(string number, DocumentTypeEnum type)
        {
            Number = number;
            Type   = type;

            Validate();
        }
Пример #2
0
 public IReportSaver CreateReportSaver(DocumentTypeEnum documentType)
 {
     return(documentType switch
     {
         DocumentTypeEnum.Excel => _serviceProvider.GetService <ExcelMonthReportSaver>() ?? throw new NullReferenceException(),
         _ => throw new ArgumentOutOfRangeException(nameof(documentType), documentType, null)
     });
        public RecentCalibrationsViewModel(Document document, CustomerContact customerContact)
        {
            if (document == null)
            {
                return;
            }

            UserId           = document.UserId;
            Created          = document.Created;
            DocumentId       = document.Id;
            CompanyName      = document.CompanyName;
            DocumentTypeEnum = DocumentTypeHelper.Parse(document);
            DocumentType     = DocumentTypeEnum.AsDisplayString();
            DocumentIcon     = DocumentType.Replace(" ", "");
            Expiration       = document.InspectionDate.GetValueOrDefault().Date.AddYears(2);
            Registration     = document.RegistrationNumber;
            Technician       = document.Technician;
            Customer         = document.CustomerContact;
            DepotName        = document.DepotName;

            if (customerContact != null)
            {
                PrimaryEmailAddress   = customerContact.Email;
                SecondaryEmailAddress = customerContact.SecondaryEmail;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentDetail" /> class.
 /// </summary>
 /// <param name="accountHolderCode">The code of account holder, to which the document applies. (required).</param>
 /// <param name="bankAccountUUID">The unique ID of the Bank Account to which the document applies. &gt;Required if the documentType is &#x60;BANK_STATEMENT&#x60; (i.e., a document is being submitted in order to verify a bank account).  &gt;Refer to the [Onboarding and verification](https://docs.adyen.com/marketpay/onboarding-and-verification) section for details on when a document should be submitted in order to verify a bank account..</param>
 /// <param name="description">Description of the document..</param>
 /// <param name="documentType">The type of a document. Permitted values: * &#x60;BANK_STATEMENT&#x60; denotes an image containing a bank statement or other document proving ownership of a specific bank account. * &#x60;PASSPORT&#x60; denotes an image containing the identity page(s) of a passport. * &#x60;ID_CARD_FRONT&#x60; denotes an image containing only the front of the ID card. In order for a document to be usable, both the &#x60;ID_CARD_FRONT&#x60; and &#x60;ID_CARD_BACK&#x60; must be submitted. * &#x60;ID_CARD_BACK&#x60; denotes an image containing only the back of the ID card. In order for a document to be usable, both the &#x60;ID_CARD_FRONT&#x60; and &#x60;ID_CARD_BACK&#x60; must be submitted. * &#x60;DRIVING_LICENCE_FRONT&#x60; denotes an image containing only the front of the driving licence. In order for a document to be usable, both the &#x60;DRIVING_LICENCE_FRONT&#x60; and &#x60;DRIVING_LICENCE_BACK&#x60; must be submitted. * &#x60;DRIVING_LICENCE_BACK&#x60; denotes an image containing only the back of the driving licence. In order for a document to be usable, both the &#x60;DRIVING_LICENCE_FRONT&#x60; and &#x60;DRIVING_LICENCE_FRONT&#x60; must be submitted.  &gt;Please refer to [Verification checks](https://docs.adyen.com/marketpay/onboarding-and-verification/verification-checks) for details on when each document type should be submitted. (required).</param>
 /// <param name="filename">Filename of the document. (required).</param>
 /// <param name="shareholderCode">The code of the shareholder, to which the document applies. &gt;Required if the account holder referred to by the &#x60;accountHolderCode&#x60; has a &#x60;legalEntity&#x60; of type &#x60;Business&#x60; and the &#x60;documentType&#x60; is either &#x60;PASSPORT&#x60;, &#x60;ID_CARD_FRONT&#x60;, &#x60;ID_CARD_BACK&#x60;, &#x60;DRIVING_LICENCE_FRONT&#x60;, &#x60;DRIVING_LICENCE_BACK&#x60; (i.e. a document is being submitted in order to verify a shareholder).  &gt;Refer to the [Onboarding and verification](https://docs.adyen.com/marketpay/onboarding-and-verification) section for details on when a document should be submitted in order to verify a shareholder..</param>
 public DocumentDetail(string accountHolderCode = default(string), string bankAccountUUID = default(string), string description = default(string), DocumentTypeEnum documentType = default(DocumentTypeEnum), string filename = default(string), string shareholderCode = default(string))
 {
     // to ensure "accountHolderCode" is required (not null)
     if (accountHolderCode == null)
     {
         throw new InvalidDataException("accountHolderCode is a required property for DocumentDetail and cannot be null");
     }
     else
     {
         this.AccountHolderCode = accountHolderCode;
     }
     // to ensure "documentType" is required (not null)
     if (documentType == null)
     {
         throw new InvalidDataException("documentType is a required property for DocumentDetail and cannot be null");
     }
     else
     {
         this.DocumentType = documentType;
     }
     // to ensure "filename" is required (not null)
     if (filename == null)
     {
         throw new InvalidDataException("filename is a required property for DocumentDetail and cannot be null");
     }
     else
     {
         this.Filename = filename;
     }
     this.DocumentType    = documentType;
     this.Filename        = filename;
     this.BankAccountUUID = bankAccountUUID;
     this.Description     = description;
     this.ShareholderCode = shareholderCode;
 }
Пример #5
0
        public GeneratedDocumentDomain Generate(string inputContent, string fileName,
                                                DocumentTypeEnum inputDocType, DocumentTypeEnum outputDocTypeDomain, Nullable <int> templateVersionId)
        {
            DocumentTypeDomain inputType  = _documentTypeRepository.GetByName(inputDocType.ToString("g"));
            DocumentTypeDomain outputType = _documentTypeRepository.GetByName(outputDocTypeDomain.ToString("g"));

            return(Generate(inputContent, fileName, inputType, outputType, templateVersionId));
        }
Пример #6
0
 // Helper method for readability
 // Returns true if input == expectedInput AND output == expectedOutput
 private bool CompareDocTypes(DocumentTypeDomain inputDocType, DocumentTypeDomain outputDocTypeDomain,
                              DocumentTypeEnum expectedInput, DocumentTypeEnum expectedOutput)
 {
     // "g" means that the conversion of enum to string will be the most intuitive one
     // For example, if the enum value is MyValue then ToString("g") will return "MyValue"
     return(string.Equals(inputDocType.Name, expectedInput.ToString("g"), StringComparison.CurrentCultureIgnoreCase) &&
            string.Equals(outputDocTypeDomain.Name, expectedOutput.ToString("g"), StringComparison.CurrentCultureIgnoreCase));
 }
Пример #7
0
        public DocumentModel GetDocument(DocumentTypeEnum type)
        {
            if (Documents == null)
            {
                return(null);
            }

            return(Documents.Where(d => d.DocumentTypeId == (int)type).FirstOrDefault());
        }
Пример #8
0
        public Document(string numero, DocumentTypeEnum tipo)
        {
            if (tipo == DocumentTypeEnum.CPF)
            {
                setCpf(numero);
            }

            Numero = numero;
            Tipo   = tipo;
        }
Пример #9
0
        public void setCpf(string numero)
        {
            if (!ValidaCPF(numero))
            {
                showError(DocumentTypeEnum.CPF);
            }

            Numero = numero;
            Tipo   = DocumentTypeEnum.CPF;
        }
 public static string formatForDocument(DocumentTypeEnum documentType)
 {
     string format = String.Empty;
     if (documentType.Equals(DocumentTypeEnum.DNI))
         format = "##\\.###\\.###";
     else if (documentType.Equals(DocumentTypeEnum.CUIL))
         format = "##-########-#";
     else if (documentType.Equals(DocumentTypeEnum.CUIT))
         format = "##-########-#";
     return format;
 }
 public static string maskForDocument(DocumentTypeEnum documentType)
 {
     string format = String.Empty;
     if (documentType.Equals(DocumentTypeEnum.DNI))
         format = "00\\.000\\.000";
     else if (documentType.Equals(DocumentTypeEnum.CUIL))
         format = "00-00000000-0";
     else if (documentType.Equals(DocumentTypeEnum.CUIT))
         format = "00-00000000-0";
     return format;
 }
Пример #12
0
        internal static DocumentTypeEnum TransGetType(string DocumentId)
        {
            DocumentTypeEnum transType = DocumentTypeEnum.dcTypeNone;
            string           transDoc  = DocumentId;

            if (RTLAPIEngine.SystemSettings.WorkstationInfo.Document.IsInCollection(transDoc))
            {
                var doc = RTLAPIEngine.SystemSettings.WorkstationInfo.Document[transDoc];
                transType = doc.TransDocType;
            }
            return(transType);
        }
Пример #13
0
        public static bool IsAssemblyDocument(DocumentTypeEnum activeDocumentType)
        {
            if (activeDocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
Пример #14
0
        public static DocumentGenerator GetGenerator(DocumentTypeEnum documentType)
        {
            switch (documentType)
            {
            case DocumentTypeEnum.Invoice:
                return(new InvoiceGenerator());

            //case DocumentTypeEnum.InvoiceCorrection:
            //        return new InvoiceCorrectionGenereator();
            default:
                return(null);
            }
        }
Пример #15
0
        public GeneratedDocumentDomain ExportTemplate(int templateVersionId, DocumentTypeEnum outputDocType)
        {
            TemplateVersionDomain templateVersionDomain = _templateVersionManipulation.GetByVersionId(templateVersionId);

            if (templateVersionDomain == null)
            {
                throw new NsiArgumentNullException(TemplateManagementMessages.TemplateVersionInvalidId);
            }
            string name = _templateManipulation.GetTemplateNameById(templateVersionDomain.TemplateId);
            GeneratedDocumentDomain generatedDocumentDomain = _documentGenerator.Generate(templateVersionDomain.Content, name,
                                                                                          DocumentTypeEnum.Json, outputDocType, templateVersionId);

            return(generatedDocumentDomain);
        }
        public bool CopyAttachment(DocumentTypeEnum bookmark)
        {
            var res = false;

            switch (bookmark)
            {
            case (DocumentTypeEnum.Agreement): { res = CopyAgreement(); } break;

            case (DocumentTypeEnum.TechSpecs): { res = CopyTechSpecs(); } break;

            case (DocumentTypeEnum.Qualifications): { res = CopyQualificationsToBuffer(); } break;
            }

            return(res);
        }
Пример #17
0
        public BaseConverter(string fileName, DocumentTypeEnum resultType)
        {
            FileName = fileName;
            string newName;

            switch (resultType)
            {
            case DocumentTypeEnum.Csv:
                newName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".csv");
                Result  = new CsvDocumentType(newName);
                break;

            default:
                //TODO: Test purposes
                newName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".csv");
                Result  = new CsvDocumentType(newName);
                break;
            }
        }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Doc" /> class.
 /// </summary>
 /// <param name="name">A name for identifying your document. (required).</param>
 /// <param name="documentType">The type of document being created. (required).</param>
 /// <param name="documentContent">The HTML data to be transformed into a document. You must supply content using document_content or document_url.  (required).</param>
 /// <param name="documentUrl">The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. .</param>
 /// <param name="test">Enable test mode for this document. Test documents are not charged for but include a watermark. (default to true).</param>
 /// <param name="pipeline">Specify a specific version of the DocRaptor Pipeline to use.</param>
 /// <param name="strict">Force strict HTML validation..</param>
 /// <param name="ignoreResourceErrors">Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. (default to true).</param>
 /// <param name="ignoreConsoleMessages">Prevent console.log from stopping document rendering during JavaScript execution. (default to false).</param>
 /// <param name="tag">A field for storing a small amount of metadata with this document.</param>
 /// <param name="help">Request support help with this request if it succeeds. (default to false).</param>
 /// <param name="javascript">Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. (default to false).</param>
 /// <param name="referrer">Set HTTP referrer when generating this document..</param>
 /// <param name="callbackUrl">A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. .</param>
 /// <param name="hostedDownloadLimit">The number of times a hosted document can be downloaded.  If no limit is specified, the document will be available for an unlimited number of downloads..</param>
 /// <param name="hostedExpiresAt">The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00..</param>
 /// <param name="princeOptions">princeOptions.</param>
 public Doc(string name, DocumentTypeEnum documentType, string documentContent, string documentUrl = default(string), bool?test = true, string pipeline = default(string), StrictEnum?strict = default(StrictEnum?), bool?ignoreResourceErrors = true, bool?ignoreConsoleMessages = false, string tag = default(string), bool?help = false, bool?javascript = false, string referrer = default(string), string callbackUrl = default(string), int?hostedDownloadLimit = default(int?), string hostedExpiresAt = default(string), PrinceOptions princeOptions = default(PrinceOptions))
 {
     Name                  = name ?? throw new ArgumentNullException(nameof(name), "name is a required property for Doc and cannot be null");
     DocumentType          = documentType;
     DocumentContent       = documentContent ?? throw new ArgumentNullException(nameof(DocumentContent), "documentContent is a required property for Doc and cannot be null");
     DocumentUrl           = documentUrl;
     Test                  = test ?? true;
     Pipeline              = pipeline;
     Strict                = strict;
     IgnoreResourceErrors  = ignoreResourceErrors ?? true;
     IgnoreConsoleMessages = ignoreConsoleMessages ?? false;
     Tag                 = tag;
     Help                = help ?? false;
     Javascript          = javascript ?? false;
     Referrer            = referrer;
     CallbackUrl         = callbackUrl;
     HostedDownloadLimit = hostedDownloadLimit;
     HostedExpiresAt     = hostedExpiresAt;
     PrinceOptions       = princeOptions;
 }
        public CalibrationsDueViewModel(Document document)
        {
            if (document == null)
            {
                return;
            }

            UserId           = document.UserId;
            Created          = document.Created;
            DocumentId       = document.Id;
            DocumentTypeEnum = DocumentTypeHelper.Parse(document);
            DocumentType     = DocumentTypeEnum.AsDisplayString();
            DocumentIcon     = DocumentType.Replace(" ", "");
            Date             = document.InspectionDate.GetValueOrDefault();
            Expiration       = document.InspectionDate.GetValueOrDefault().AddYears(2);
            Registration     = document.RegistrationNumber;
            Technician       = document.Technician;
            Customer         = document.CustomerContact;
            DepotName        = document.DepotName;

            var tachographDocument = document as TachographDocument;

            VehicleManufacturer = tachographDocument != null ? tachographDocument.VehicleMake : string.Empty;
        }
 public List <DocumentRequisite> GetFilesInfo(int fileListId, DocumentTypeEnum documentType)
 {
     return(dataManager.GetFiles(fileListId, new List <int> {
         (int)documentType
     }));
 }
Пример #21
0
 public static DocumentType GetDocumentType(DocumentTypeEnum value, SeedsEntities database, MergeOption mergeOption = MergeOption.NoTracking)
 {
     return database.DocumentType.Execute(mergeOption).Single(t => t.ID == (short) value);
 }
Пример #22
0
 public VoucherBuilder WithCreditDocumentType()
 {
     this.documentType = DocumentTypeEnum.Cr;
     return this;
 }
Пример #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Doc" /> class.
 /// </summary>
 /// <param name="name">A name for identifying your document. (required).</param>
 /// <param name="documentType">The type of document being created. (required).</param>
 /// <param name="documentContent">The HTML data to be transformed into a document. You must supply content using document_content or document_url.  (required).</param>
 /// <param name="documentUrl">The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. .</param>
 /// <param name="test">Enable test mode for this document. Test documents are not charged for but include a watermark. (default to true).</param>
 /// <param name="pipeline">Specify a specific verison of the DocRaptor Pipeline to use..</param>
 /// <param name="strict">Force strict HTML validation..</param>
 /// <param name="ignoreResourceErrors">Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. (default to true).</param>
 /// <param name="ignoreConsoleMessages">Prevent console.log from stopping document rendering during JavaScript execution. (default to false).</param>
 /// <param name="tag">A field for storing a small amount of metadata with this document..</param>
 /// <param name="help">Request support help with this request if it succeeds. (default to false).</param>
 /// <param name="javascript">Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. (default to false).</param>
 /// <param name="referrer">Set HTTP referrer when generating this document..</param>
 /// <param name="callbackUrl">A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. .</param>
 /// <param name="hostedDownloadLimit">The number of times a hosted document can be downloaded.  If no limit is specified, the document will be available for an unlimited number of downloads..</param>
 /// <param name="hostedExpiresAt">The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00..</param>
 /// <param name="princeOptions">princeOptions.</param>
 public Doc(string name = default(string), DocumentTypeEnum documentType = default(DocumentTypeEnum), string documentContent = default(string), string documentUrl = default(string), bool?test = true, string pipeline = default(string), StrictEnum?strict = default(StrictEnum?), bool?ignoreResourceErrors = true, bool?ignoreConsoleMessages = false, string tag = default(string), bool?help = false, bool?javascript = false, string referrer = default(string), string callbackUrl = default(string), int?hostedDownloadLimit = default(int?), string hostedExpiresAt = default(string), PrinceOptions princeOptions = default(PrinceOptions))
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for Doc and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "documentType" is required (not null)
     if (documentType == null)
     {
         throw new InvalidDataException("documentType is a required property for Doc and cannot be null");
     }
     else
     {
         this.DocumentType = documentType;
     }
     // to ensure "documentContent" is required (not null)
     if (documentContent == null)
     {
         throw new InvalidDataException("documentContent is a required property for Doc and cannot be null");
     }
     else
     {
         this.DocumentContent = documentContent;
     }
     this.DocumentUrl = documentUrl;
     // use default value if no "test" provided
     if (test == null)
     {
         this.Test = true;
     }
     else
     {
         this.Test = test;
     }
     this.Pipeline = pipeline;
     this.Strict   = strict;
     // use default value if no "ignoreResourceErrors" provided
     if (ignoreResourceErrors == null)
     {
         this.IgnoreResourceErrors = true;
     }
     else
     {
         this.IgnoreResourceErrors = ignoreResourceErrors;
     }
     // use default value if no "ignoreConsoleMessages" provided
     if (ignoreConsoleMessages == null)
     {
         this.IgnoreConsoleMessages = false;
     }
     else
     {
         this.IgnoreConsoleMessages = ignoreConsoleMessages;
     }
     this.Tag = tag;
     // use default value if no "help" provided
     if (help == null)
     {
         this.Help = false;
     }
     else
     {
         this.Help = help;
     }
     // use default value if no "javascript" provided
     if (javascript == null)
     {
         this.Javascript = false;
     }
     else
     {
         this.Javascript = javascript;
     }
     this.Referrer            = referrer;
     this.CallbackUrl         = callbackUrl;
     this.HostedDownloadLimit = hostedDownloadLimit;
     this.HostedExpiresAt     = hostedExpiresAt;
     this.PrinceOptions       = princeOptions;
 }
 public BinaryConverter(string fileName, DocumentTypeEnum resultType) : base(fileName, resultType)
 {
 }
Пример #25
0
 public VoucherBuilder()
 {
     this.documentType = DocumentTypeEnum.Dr;
 }
Пример #26
0
 private void showError(DocumentTypeEnum type)
 {
     throw new ArgumentException(type.ToString() + " Inválido");
 }
Пример #27
0
 protected Descriptor(
     DescriptorType descriptorType,
     Type type,
     string header,
     GetGolumnsDelegate getColumns,
     CreateEditorDelegate createEditor,
     DocumentTypeEnum? documentType = null,
     RefBookTypeEnum? refBookType = null,
     ReportTypeEnum? reportType = null)
 {
     this.descriptorType = descriptorType;
     this.type = type;
     this.header = header;
     this.getColumns = getColumns;
     this.createEditor = createEditor;
     if (documentType.HasValue)
     {
         this.documentType = documentType.Value;
     }
     if (refBookType.HasValue)
     {
         this.refBookType = refBookType.Value;
     }
     if (reportType.HasValue)
     {
         this.reportType = reportType.Value;
     }
 }
Пример #28
0
 private string InternalGetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType)
 {
     return ApplicationInstance.GetTemplateFile( documentType,  systemOfMeasure,  draftingStandard,  documentSubType);
 }
Пример #29
0
 public string GetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType)
 {
     return InternalGetTemplateFile( documentType,  systemOfMeasure,  draftingStandard,  documentSubType);
 }
Пример #30
0
 private string InternalGetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType)
 {
     return(ApplicationInstance.GetTemplateFile(documentType, systemOfMeasure, draftingStandard, documentSubType));
 }
Пример #31
0
 public string GetTemplateFile(DocumentTypeEnum documentType, SystemOfMeasureEnum systemOfMeasure, DraftingStandardEnum draftingStandard, Object documentSubType)
 {
     return(InternalGetTemplateFile(documentType, systemOfMeasure, draftingStandard, documentSubType));
 }
 public CreateDocumentRequestBuilder WithDocumentType(DocumentTypeEnum documentType)
 {
     _documentType = documentType;
     return this;
 }
Пример #33
0
 public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None)
 {
     _type = type;
     _kind = kind;
 }
        private CompleteRiskAssessmentReviewRequest CreateCompleteRiskAssessmentReviewRequest(CompleteReviewViewModel viewModel,
            RiskAssessmentDto riskAssessment, string newFileName, long documentLibraryId, DocumentTypeEnum documentTypeEnum)
        {
            var completeRiskAssessmentReviewRequest = new CompleteRiskAssessmentReviewRequestBuilder()
                .WithClientId(CurrentUser.CompanyId)
                .WithUserId(CurrentUser.UserId)
                .WithCompleteReview_completeReviewViewModel(viewModel);

            if (documentLibraryId != default(long))
            {
                var requestBuilder = new CreateDocumentRequestBuilder()
                    .WithCompanyId(CurrentUser.CompanyId)
                    .WithDocumentOriginTypeId(DocumentOriginType.TaskCompleted)
                    .WithDocumentType(documentTypeEnum)
                    .WithFilename(newFileName)
                    .WithDocumentLibraryId(documentLibraryId);

                if (riskAssessment.RiskAssessmentSite != null)
                    requestBuilder.WithSiteId(riskAssessment.RiskAssessmentSite.Id);

                var createDocumentRequest = requestBuilder.Build();

                completeRiskAssessmentReviewRequest.WithCreateDocumentRequest(createDocumentRequest);
            }

            return completeRiskAssessmentReviewRequest.Build();
        }
Пример #35
0
 public AdminSupportedFile(string fileExtension, bool containsModel, DocumentTypeEnum documentType)
 {
     this.FileExtension = fileExtension;
     this.ContainsModel = containsModel;
     this.DocumentType  = documentType;
 }
Пример #36
0
        private static void ItemTransactionSaveSaleWithReturnOfReturnable()
        {
            string transDoc    = "FS";
            string transSerial = "1";
            double PartyID     = 1;

            var currency             = APIEngine.SystemSettings.BaseCurrency;
            var ItemTransaction      = new S50cBL18.BSOItemTransaction();
            DocumentTypeEnum DocType = DocumentTypeEnum.dcTypeSale;
            var NewTransDocNumber    = APIEngine.DSOCache.DocumentProvider.GetNewDocNumber(transSerial, transDoc);

//-------------------------------------------------------------
// *** Header
//-------------------------------------------------------------
            // Motor do documento
            ItemTransaction.Transaction.TransDocType   = DocType;
            ItemTransaction.Transaction.TransDocNumber = NewTransDocNumber.DocNumber;
            ItemTransaction.PermissionsType            = FrontOfficePermissionEnum.foPermByUser;
            ItemTransaction.InitNewTransaction(transDoc, transSerial);
            // Motor dos detalhes (linhas)
            var bsoItemTransDetail = new S50cBL18.BSOItemTransactionDetail();

            bsoItemTransDetail.PermissionsType       = FrontOfficePermissionEnum.foPermByUser;
            bsoItemTransDetail.TransactionType       = ItemTransaction.Transaction.TransDocType;
            bsoItemTransDetail.UserPermissions       = APIEngine.SystemSettings.User;
            ItemTransaction.BSOItemTransactionDetail = bsoItemTransDetail;
            //

            ItemTransaction.PartyID = PartyID;
            ItemTransaction.TransactionTaxIncluded = true;
            ItemTransaction.createDate             = DateTime.Now;
            ItemTransaction.CreateTime             = new DateTime(DateTime.Now.TimeOfDay.Ticks);
            ItemTransaction.ActualDeliveryDate     = DateTime.Now;
            ItemTransaction.BaseCurrency           = currency.CurrencyID;
            ItemTransaction.BaseCurrencyExchange   = currency.BuyExchange;
            ItemTransaction.Transaction.Comments   = "Returnable Packaging";
            //-------------------------------------------------------------
            // *** Header
            //-------------------------------------------------------------


            //-------------------------------------------------------------
            // *** DETAILS
            //-------------------------------------------------------------
            if (ItemTransaction.Transaction.Details == null)
            {
                ItemTransaction.Transaction.Details = new S50cBO18.ItemTransactionDetailList();
            }

            //Add Line_1: art1 type normal
            var StockTransactionDetail = AddItemDetail(ItemTransaction, 1, "Bacalhau", 1, 33);

            ItemTransaction.AddDetail(StockTransactionDetail, true);

            ////Add Line_2: Enter customer returnables ,Customer input value is negative
            StockTransactionDetail = AddItemDetail(ItemTransaction, 1, "TARAS", -3, 0.30);
            ItemTransaction.AddDetail(StockTransactionDetail, true);


//-------------------------------------------------------------
// *** DETAILS
//-------------------------------------------------------------

//-------------------------------------------------------------
// *** SAVE DOCUMENT
//-------------------------------------------------------------
            //*** SAVE only if document have Lines
            if (ItemTransaction.Transaction.Details.Count > 0)
            {
                try {
                    //Ensure Till is open
                    ItemTransaction.EnsureOpenTill(ItemTransaction.Transaction.Till.TillID);
                    //Calculate
                    ItemTransaction.Calculate(true, true);
                    //Save Document
                    ItemTransaction.SaveDocument(false, false);
                    //Console.Error.Write(ItemTransaction.Transaction.TransactionID.ToString());
                }
                catch (Exception ex) {
                    Console.Error.Write(ex.Message);
                }
            }
//-------------------------------------------------------------
// *** SAVE DOCUMENT
//-------------------------------------------------------------
        }
Пример #37
0
 public DocumentModel(DocumentTypeEnum docType, int id)
 {
     this.ConsolidatedActIds = new List <int>();
     this.DocType            = docType;
     this.DocId = id;
 }
 public IExistingDocumentsViewModelFactory WithDefaultDocumentType(DocumentTypeEnum defaultDocumentType)
 {
     _defaultDocumentType = defaultDocumentType;
     return this;
 }
Пример #39
0
 public Document(string fileName, DocumentTypeEnum documentType)
 {
     FileName  = fileName;
     DocType   = documentType;
     isDeleted = false;
 }
Пример #40
0
 public Process(string inputPath, DocumentTypeEnum baseType, DocumentTypeEnum resultType)
 {
     InputDirectory = inputPath;
     ResultType     = resultType;
     BaseType       = baseType;
 }
Пример #41
0
 public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None)
 {
     _type = type;
     _kind = kind;
 }
Пример #42
0
        public async Task <string> GetDocumentNumber(DocumentTypeEnum documentType, int customerDivisionId)
        {
            var query = _customerDivisionDocumentSettingRepo.FindByCondition(ds => ds.DivisionId == customerDivisionId)
                        .Include(dt => dt.DocumentType)
                        .Include(ns => ns.DocumentNumberSequence)
                        .Include(d => d.Division).ThenInclude(c => c.Customer);

            var divisionDocumentSetting = query.FirstOrDefault(t => t.DocumentType.Type == documentType);
            // DivisionDocumentSetting muss immer gesetzt werden. Am Anfang mit Defaultwerte.
            var documentNumberSequence = divisionDocumentSetting?.DocumentNumberSequence;
            var documentNumber         = string.Empty;

            documentNumber += $"{documentNumberSequence.Prefix}{documentNumberSequence.SeparatorAfterPrefix}";

            if (documentNumberSequence.CanAddDocumentTypeShortName)
            {
                documentNumber += divisionDocumentSetting.DocumentType.ShortName;
            }

            var paddingCustomerNumber = string.Empty;

            if (documentNumberSequence.CanAddPaddingForCustomerNumber)
            {
                for (int i = 0; i < documentNumberSequence.PaddingLengthForCustomerNumber - 5; i++)
                {
                    paddingCustomerNumber += '0';
                }
            }

            documentNumber +=
                $"{paddingCustomerNumber}{divisionDocumentSetting.Division.Customer.RefErpCustomerNumber}{documentNumberSequence.PostfixForCustomerNumber}{documentNumberSequence.Separator}";

            if (documentNumberSequence.CanAddDivisionShortName)
            {
                documentNumber += divisionDocumentSetting.Division.ShortName;
            }

            documentNumber += documentNumberSequence.Separator;

            bool retrySave;

            do
            {
                var paddingCounter = string.Empty;
                var nextCounter    = documentNumberSequence.Counter + 1;
                var counterLength  = nextCounter.ToString().Length;
                if (documentNumberSequence.CanAddPaddingForCounter && counterLength < documentNumberSequence.PaddingLengthForCounter)
                {
                    for (int i = 0; i < documentNumberSequence.PaddingLengthForCounter - counterLength; i++)
                    {
                        paddingCounter += '0';
                    }
                }

                ++documentNumberSequence.Counter;
                retrySave = false;

                try
                {
                    _documentNumberSequenceRepo.Save();
                    documentNumber += $"{paddingCounter}{documentNumberSequence.Counter}";
                }
                catch (DbUpdateConcurrencyException e)
                {
                    retrySave = true;
                    await e.Entries.Single().ReloadAsync();
                }
            } while (retrySave);

            return(documentNumber);
        }
 public IDocumentsViewModelFactory WithDocumentDefaultType(DocumentTypeEnum documentType)
 {
     _documentType = documentType;
     return this;
 }