public TenderType()
 {
     this.tenderedProjectField         = new ObservableCollection <TenderedProjectType>();
     this.originatorCustomerPartyField = new CustomerPartyType();
     this.contractingPartyField        = new ContractingPartyType();
     this.subcontractorPartyField      = new ObservableCollection <PartyType>();
     this.tendererQualificationDocumentReferenceField = new DocumentReferenceType();
     this.tendererPartyField     = new PartyType();
     this.signatureField         = new ObservableCollection <SignatureType>();
     this.documentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.validityPeriodField    = new PeriodType();
     this.noteField             = new ObservableCollection <NoteType>();
     this.contractNameField     = new ObservableCollection <ContractNameType>();
     this.issueTimeField        = new IssueTimeType();
     this.issueDateField        = new IssueDateType();
     this.contractFolderIDField = new ContractFolderIDType();
     this.tenderTypeCodeField   = new TenderTypeCodeType();
     this.uUIDField             = new UUIDType();
     this.copyIndicatorField    = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #2
0
 public UtilityStatementType()
 {
     this.subscriberConsumptionField       = new ObservableCollection <SubscriberConsumptionType>();
     this.mainOnAccountPaymentField        = new ObservableCollection <OnAccountPaymentType>();
     this.subscriberPartyField             = new PartyType();
     this.customerPartyField               = new CustomerPartyType();
     this.receiverPartyField               = new PartyType();
     this.senderPartyField                 = new PartyType();
     this.signatureField                   = new ObservableCollection <SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.parentDocumentReferenceField     = new DocumentReferenceType();
     this.accountingCostField              = new AccountingCostType();
     this.accountingCostCodeField          = new AccountingCostCodeType();
     this.documentCurrencyCodeField        = new DocumentCurrencyCodeType();
     this.noteField = new ObservableCollection <NoteType>();
     this.utilityStatementTypeCodeField = new UtilityStatementTypeCodeType();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
 public CallForTendersType()
 {
     this.procurementProjectLotField   = new ObservableCollection <ProcurementProjectLotType>();
     this.procurementProjectField      = new ProcurementProjectType();
     this.tenderingProcessField        = new TenderingProcessType();
     this.tenderingTermsField          = new TenderingTermsType();
     this.receiverPartyField           = new PartyType();
     this.originatorCustomerPartyField = new ObservableCollection <CustomerPartyType>();
     this.contractingPartyField        = new ContractingPartyType();
     this.signatureField = new ObservableCollection <SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.technicalDocumentReferenceField  = new DocumentReferenceType();
     this.legalDocumentReferenceField      = new DocumentReferenceType();
     this.previousVersionIDField           = new PreviousVersionIDType();
     this.versionIDField        = new VersionIDType();
     this.noteField             = new ObservableCollection <NoteType>();
     this.issueTimeField        = new IssueTimeType();
     this.issueDateField        = new IssueDateType();
     this.approvalDateField     = new ApprovalDateType();
     this.contractFolderIDField = new ContractFolderIDType();
     this.uUIDField             = new UUIDType();
     this.copyIndicatorField    = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
 public QuotationType()
 {
     this.quotationLineField                        = new ObservableCollection <QuotationLineType>();
     this.quotedMonetaryTotalField                  = new MonetaryTotalType();
     this.taxTotalField                             = new ObservableCollection <TaxTotalType>();
     this.destinationCountryField                   = new CountryType();
     this.allowanceChargeField                      = new ObservableCollection <AllowanceChargeType>();
     this.transactionConditionsField                = new TransactionConditionsType();
     this.paymentMeansField                         = new PaymentMeansType();
     this.deliveryTermsField                        = new DeliveryTermsType();
     this.deliveryField                             = new ObservableCollection <DeliveryType>();
     this.originatorCustomerPartyField              = new CustomerPartyType();
     this.buyerCustomerPartyField                   = new CustomerPartyType();
     this.sellerSupplierPartyField                  = new SupplierPartyType();
     this.signatureField                            = new ObservableCollection <SignatureType>();
     this.contractField                             = new ObservableCollection <ContractType>();
     this.additionalDocumentReferenceField          = new ObservableCollection <DocumentReferenceType>();
     this.requestForQuotationDocumentReferenceField = new DocumentReferenceType();
     this.validityPeriodField                       = new PeriodType();
     this.lineCountNumericField                     = new LineCountNumericType();
     this.pricingCurrencyCodeField                  = new PricingCurrencyCodeType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
        private void addAdinationalDocRefXslt()
        {
            var idRef = new DocumentReferenceType();

            idRef.ID = new IDType {
                Value = Guid.NewGuid().ToString()
            };
            idRef.IssueDate    = baseInvoiceUBL.IssueDate;
            idRef.DocumentType = new DocumentTypeType {
                Value = nameof(EI.DocumentType.XSLT)
            };
            idRef.Attachment = new AttachmentType();
            idRef.Attachment.EmbeddedDocumentBinaryObject = new EmbeddedDocumentBinaryObjectType();

            idRef.Attachment.EmbeddedDocumentBinaryObject.characterSetCode = "UTF-8";
            idRef.Attachment.EmbeddedDocumentBinaryObject.encodingCode     = "Base64";
            idRef.Attachment.EmbeddedDocumentBinaryObject.filename         = baseInvoiceUBL.ID.Value.ToString() + ".xslt";
            idRef.Attachment.EmbeddedDocumentBinaryObject.mimeCode         = "application/xml";
            //invoice olusturuldugunda xslt invoice olarak verılecegı ıcın
            idRef.Attachment.EmbeddedDocumentBinaryObject.Value = Convert.FromBase64String(Xslt.xsltGibInvoice);



            docRefList.Add(idRef);
            baseInvoiceUBL.AdditionalDocumentReference = docRefList.ToArray();
        }
 public TransportationStatusRequestType()
 {
     this.requestedStatusPeriodField   = new ObservableCollection <PeriodType>();
     this.requestedStatusLocationField = new ObservableCollection <LocationType1>();
     this.signatureField         = new ObservableCollection <SignatureType>();
     this.documentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.consignmentField       = new ObservableCollection <ConsignmentType>();
     this.transportExecutionPlanDocumentReferenceField = new DocumentReferenceType();
     this.receiverPartyField = new PartyType();
     this.senderPartyField   = new PartyType();
     this.transportationStatusTypeCodeField = new TransportationStatusTypeCodeType();
     this.otherInstructionField             = new OtherInstructionType();
     this.shippingOrderIDField   = new ShippingOrderIDType();
     this.noteField              = new ObservableCollection <NoteType>();
     this.descriptionField       = new ObservableCollection <DescriptionType>();
     this.nameField              = new NameType1();
     this.issueTimeField         = new IssueTimeType();
     this.issueDateField         = new IssueDateType();
     this.uUIDField              = new UUIDType();
     this.carrierAssignedIDField = new CarrierAssignedIDType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
 public RequestForQuotationType()
 {
     this.requestForQuotationLineField = new ObservableCollection <RequestForQuotationLineType>();
     this.contractField                    = new ObservableCollection <ContractType>();
     this.destinationCountryField          = new CountryType();
     this.deliveryTermsField               = new ObservableCollection <DeliveryTermsType>();
     this.deliveryField                    = new ObservableCollection <DeliveryType>();
     this.buyerCustomerPartyField          = new CustomerPartyType();
     this.sellerSupplierPartyField         = new SupplierPartyType();
     this.originatorCustomerPartyField     = new CustomerPartyType();
     this.signatureField                   = new ObservableCollection <SignatureType>();
     this.additionalDocumentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.catalogueDocumentReferenceField  = new DocumentReferenceType();
     this.requestedValidityPeriodField     = new PeriodType();
     this.lineCountNumericField            = new LineCountNumericType();
     this.pricingCurrencyCodeField         = new PricingCurrencyCodeType();
     this.noteField = new ObservableCollection <NoteType>();
     this.submissionDueDateField = new SubmissionDueDateType();
     this.issueTimeField         = new IssueTimeType();
     this.issueDateField         = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
 public ReceiptAdviceType()
 {
     this._receiptLine                 = new List <ReceiptLineType>();
     this._shipment                    = new ShipmentType();
     this._sellerSupplierParty         = new SupplierPartyType();
     this._buyerCustomerParty          = new CustomerPartyType();
     this._despatchSupplierParty       = new SupplierPartyType();
     this._deliveryCustomerParty       = new CustomerPartyType();
     this._signature                   = new List <SignatureType>();
     this._additionalDocumentReference = new List <DocumentReferenceType>();
     this._despatchDocumentReference   = new DocumentReferenceType();
     this._orderReference              = new List <OrderReferenceType>();
     this._lineCountNumeric            = new LineCountNumericType();
     this._note = new List <NoteType>();
     this._receiptAdviceTypeCode = new ReceiptAdviceTypeCodeType();
     this._issueTime             = new IssueTimeType();
     this._issueDate             = new IssueDateType();
     this._uUID            = new UUIDType();
     this._copyIndicator   = new CopyIndicatorType();
     this._id              = new IDType();
     this._profileID       = new ProfileIDType();
     this._customizationID = new CustomizationIDType();
     this._uBLVersionID    = new UBLVersionIDType();
     this._uBLExtensions   = new List <UBLExtensionType>();
 }
Beispiel #9
0
 public OrderType()
 {
     this.orderLineField = new ObservableCollection <OrderLineType>();
     this.anticipatedMonetaryTotalField = new MonetaryTotalType();
     this.taxTotalField                     = new ObservableCollection <TaxTotalType>();
     this.destinationCountryField           = new CountryType();
     this.paymentExchangeRateField          = new ExchangeRateType();
     this.pricingExchangeRateField          = new ExchangeRateType();
     this.taxExchangeRateField              = new ExchangeRateType();
     this.allowanceChargeField              = new ObservableCollection <AllowanceChargeType>();
     this.transactionConditionsField        = new TransactionConditionsType();
     this.paymentTermsField                 = new ObservableCollection <PaymentTermsType>();
     this.paymentMeansField                 = new ObservableCollection <PaymentMeansType>();
     this.deliveryTermsField                = new ObservableCollection <DeliveryTermsType>();
     this.deliveryField                     = new ObservableCollection <DeliveryType>();
     this.accountingCustomerPartyField      = new CustomerPartyType();
     this.freightForwarderPartyField        = new PartyType();
     this.originatorCustomerPartyField      = new CustomerPartyType();
     this.sellerSupplierPartyField          = new SupplierPartyType();
     this.buyerCustomerPartyField           = new CustomerPartyType();
     this.signatureField                    = new ObservableCollection <SignatureType>();
     this.projectReferenceField             = new ObservableCollection <ProjectReferenceType>();
     this.contractField                     = new ObservableCollection <ContractType>();
     this.additionalDocumentReferenceField  = new ObservableCollection <DocumentReferenceType>();
     this.catalogueReferenceField           = new CatalogueReferenceType();
     this.originatorDocumentReferenceField  = new DocumentReferenceType();
     this.orderDocumentReferenceField       = new ObservableCollection <DocumentReferenceType>();
     this.quotationDocumentReferenceField   = new DocumentReferenceType();
     this.validityPeriodField               = new ObservableCollection <PeriodType>();
     this.lineCountNumericField             = new LineCountNumericType();
     this.accountingCostField               = new AccountingCostType();
     this.accountingCostCodeField           = new AccountingCostCodeType();
     this.customerReferenceField            = new CustomerReferenceType();
     this.taxCurrencyCodeField              = new TaxCurrencyCodeType();
     this.pricingCurrencyCodeField          = new PricingCurrencyCodeType();
     this.documentCurrencyCodeField         = new DocumentCurrencyCodeType();
     this.requestedInvoiceCurrencyCodeField = new RequestedInvoiceCurrencyCodeType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.orderTypeCodeField      = new OrderTypeCodeType();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.salesOrderIDField       = new SalesOrderIDType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #10
0
        private DataTable FnTablaReferenciadoDebitNote(DebitNoteType ocomprobante)
        {
            DataTable dtSustento = new DataTable();

            dtSustento.Columns.Add(new DataColumn("DocumentoReferenciado", typeof(string)));
            dtSustento.Columns.Add(new DataColumn("TipoDocumentoReferenciado", typeof(string)));
            dtSustento.Columns.Add(new DataColumn("Sustento", typeof(string)));


            DataRow fila;

            fila = dtSustento.NewRow();


            if (ocomprobante.BillingReference != null)
            {
                foreach (BillingReferenceType oreferencia in ocomprobante.BillingReference)
                {
                    DocumentReferenceType oDocument = oreferencia.InvoiceDocumentReference;

                    fila["DocumentoReferenciado"] = FnValidarNulo(oDocument.ID.Value.ToString());

                    if (oDocument.DocumentTypeCode.Value.ToString() == "01")
                    {
                        fila["TipoDocumentoReferenciado"] = "Factura";
                    }
                    else if (oDocument.DocumentTypeCode.Value.ToString() == "03")
                    {
                        fila["TipoDocumentoReferenciado"] = "Boleta";
                    }
                }
            }

            if (ocomprobante.DiscrepancyResponse != null)
            {
                foreach (ResponseType oreferencia in ocomprobante.DiscrepancyResponse)
                {
                    DescriptionType[] oDocument = oreferencia.Description;
                    string            sustento  = "";
                    foreach (DescriptionType valor in oDocument)
                    {
                        sustento += valor.Value.ToString() + Environment.NewLine;
                    }
                    fila["Sustento"] = sustento;
                }
            }

            dtSustento.Rows.Add(fila);

            return(dtSustento);
        }
Beispiel #11
0
        public DocumentReferenceType[] getAdditionalDocumentReferenceType()
        {
            DocumentReferenceType[] DRT = null;
            int n = 0;

            for (int i = 1; i < (VD.re + 1); ++i)
            {
                if (Interface.ContainsKey("RefTpoDoc" + i))
                {
                    if (Interface["RefTpoDoc" + i] != "09" && Interface["RefTpoDoc" + i] != "105")
                    {
                        n++;
                    }
                }
            }

            if (n == 0)
            {
                return(DRT);
            }
            else
            {
                DRT = new DocumentReferenceType[n];
                int j = 0;
                for (int i = 1; i < (VD.re + 1); ++i)
                {
                    if (Interface.ContainsKey("RefTpoDoc" + i))
                    {
                        if (Interface["RefTpoDoc" + i] != "09" && Interface["RefTpoDoc" + i] != "105")
                        {
                            DRT[j] = new DocumentReferenceType()
                            {
                                ID = new IDType()
                                {
                                    Value = Interface["RefID" + i]
                                },
                                DocumentTypeCode = new DocumentTypeCodeType()
                                {
                                    Value = Interface["RefTpoDoc" + i]
                                }
                            };
                            j++;
                        }
                    }
                }
            }
            return(DRT);
        }
        /// <summary>
        /// Fatura AdditionalDocumentReference alanlarını ekleme
        /// </summary>
        public void PutAdditionalDocumentReference(DocumentReferenceType documentRef)
        {
            DocRefList.Clear();
            if (BaseUBL.AdditionalDocumentReference == null)
            {
                BaseUBL.AdditionalDocumentReference = new DocumentReferenceType[0];
            }

            DocRefList.AddRange(BaseUBL.AdditionalDocumentReference);

            documentRef.IssueDate = BaseUBL.IssueDate;

            DocRefList.Add(documentRef);

            BaseUBL.AdditionalDocumentReference = DocRefList.ToArray();
        }
 public DocumentStatusRequestType()
 {
     this.receiverPartyField = new PartyType();
     this.senderPartyField   = new PartyType();
     this.signatureField     = new ObservableCollection <SignatureType>();
     this.requestedDocumentReferenceField = new DocumentReferenceType();
     this.trackingIDField         = new TrackingIDType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
        public void addAdditionalDocumentReference(string documentType, string docTypeCode)
        {
            var arcRef = new DocumentReferenceType();

            arcRef.ID = new IDType {
                Value = Guid.NewGuid().ToString()
            };
            arcRef.IssueDate    = baseInvoiceUBL.IssueDate;
            arcRef.DocumentType = new DocumentTypeType {
                Value = documentType
            };
            arcRef.DocumentTypeCode = new DocumentTypeCodeType {
                Value = docTypeCode
            };

            docRefList.Add(arcRef);

            baseInvoiceUBL.AdditionalDocumentReference = docRefList.ToArray();
        }
        /// <summary>
        ///  Fatura ID otomatik oluşacak ise bu alanı göndermelisiniz.
        /// </summary>
        public void SetCustInvIdDocumentReference()
        {
            var idRef = new DocumentReferenceType()
            {
                ID = new IDType {
                    Value = Guid.NewGuid().ToString()
                },

                IssueDate = BaseUBL.IssueDate,

                DocumentTypeCode = new DocumentTypeCodeType {
                    Value = "CUST_INV_ID"
                }
            };


            DocRefList.Add(idRef);
            BaseUBL.AdditionalDocumentReference = DocRefList.ToArray();
        }
        private static byte[] XSLT_EmbeddedDocumentBinaryObject(InvoiceType invoice)
        {
            byte[] r = null;
            if ((invoice.AdditionalDocumentReference != null) && (invoice.AdditionalDocumentReference.Length > 0))
            {
                DocumentReferenceType doc       = invoice.AdditionalDocumentReference[0];
                AttachmentType        attacment = doc.Attachment;
                if ((attacment != null) && (attacment.EmbeddedDocumentBinaryObject != null))
                {
                    string fileName = attacment.EmbeddedDocumentBinaryObject.filename;
                    if (Path.GetExtension(fileName) == ".xslt")
                    {
                        return(attacment.EmbeddedDocumentBinaryObject.Value);
                    }
                }
            }

            return(r);
        }
Beispiel #17
0
 public TransportExecutionPlanType()
 {
     this.consignmentField             = new ObservableCollection <ConsignmentType>();
     this.transportExecutionTermsField = new TransportExecutionTermsType();
     this.atLocationField                                     = new LocationType1();
     this.toLocationField                                     = new LocationType1();
     this.fromLocationField                                   = new LocationType1();
     this.serviceEndTimePeriodField                           = new PeriodType();
     this.serviceStartTimePeriodField                         = new PeriodType();
     this.additionalTransportationServiceField                = new ObservableCollection <TransportationServiceType>();
     this.mainTransportationServiceField                      = new TransportationServiceType();
     this.validityPeriodField                                 = new ObservableCollection <PeriodType>();
     this.transportUserResponseRequiredPeriodField            = new ObservableCollection <PeriodType>();
     this.transportServiceProviderResponseRequiredPeriodField = new PeriodType();
     this.transportContractField                              = new ContractType();
     this.additionalDocumentReferenceField                    = new ObservableCollection <DocumentReferenceType>();
     this.transportServiceDescriptionDocumentReferenceField   = new DocumentReferenceType();
     this.transportExecutionPlanDocumentReferenceField        = new DocumentReferenceType();
     this.transportExecutionPlanRequestDocumentReferenceField = new DocumentReferenceType();
     this.signatureField   = new ObservableCollection <SignatureType>();
     this.billToPartyField = new PartyType();
     this.transportServiceProviderPartyField = new PartyType();
     this.transportUserPartyField            = new PartyType();
     this.receiverPartyField = new PartyType();
     this.senderPartyField   = new PartyType();
     this.transportServiceProviderRemarksField = new ObservableCollection <TransportServiceProviderRemarksType>();
     this.transportUserRemarksField            = new ObservableCollection <TransportUserRemarksType>();
     this.noteField = new ObservableCollection <NoteType>();
     this.documentStatusReasonDescriptionField = new ObservableCollection <DocumentStatusReasonDescriptionType>();
     this.documentStatusReasonCodeField        = new DocumentStatusReasonCodeType();
     this.documentStatusCodeField = new DocumentStatusCodeType();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.versionIDField          = new VersionIDType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #18
0
 public TendererQualificationResponseType()
 {
     this.signatureField                   = new ObservableCollection <SignatureType>();
     this.appealTermsField                 = new AppealTermsType();
     this.qualificationResolutionField     = new ObservableCollection <QualificationResolutionType>();
     this.resolutionDocumentReferenceField = new DocumentReferenceType();
     this.receiverPartyField               = new PartyType();
     this.senderPartyField                 = new PartyType();
     this.noteField             = new ObservableCollection <NoteType>();
     this.issueTimeField        = new IssueTimeType();
     this.issueDateField        = new IssueDateType();
     this.contractNameField     = new ObservableCollection <ContractNameType>();
     this.contractFolderIDField = new ContractFolderIDType();
     this.uUIDField             = new UUIDType();
     this.copyIndicatorField    = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #19
0
 public TransportProgressStatusType()
 {
     this.transportScheduleField = new ObservableCollection <TransportScheduleType>();
     this.transportMeansField    = new TransportMeansType();
     this.transportProgressStatusRequestDocumentReferenceField = new DocumentReferenceType();
     this.sourceIssuerPartyField        = new PartyType();
     this.receiverPartyField            = new PartyType();
     this.senderPartyField              = new PartyType();
     this.signatureField                = new ObservableCollection <SignatureType>();
     this.statusAvailableIndicatorField = new StatusAvailableIndicatorType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #20
0
 public UnawardedNotificationType()
 {
     this.appealTermsField  = new AppealTermsType();
     this.tenderResultField = new ObservableCollection <TenderResultType>();
     this.additionalDocumentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.minutesDocumentReferenceField    = new DocumentReferenceType();
     this.receiverPartyField    = new PartyType();
     this.senderPartyField      = new PartyType();
     this.signatureField        = new ObservableCollection <SignatureType>();
     this.noteField             = new ObservableCollection <NoteType>();
     this.contractNameField     = new ObservableCollection <ContractNameType>();
     this.issueTimeField        = new IssueTimeType();
     this.issueDateField        = new IssueDateType();
     this.contractFolderIDField = new ContractFolderIDType();
     this.uUIDField             = new UUIDType();
     this.copyIndicatorField    = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #21
0
 public OrderCancellationType()
 {
     this.originatorCustomerPartyField = new CustomerPartyType();
     this.sellerSupplierPartyField     = new SupplierPartyType();
     this.buyerCustomerPartyField      = new CustomerPartyType();
     this.signatureField = new ObservableCollection <SignatureType>();
     this.contractField  = new ObservableCollection <ContractType>();
     this.additionalDocumentReferenceField = new ObservableCollection <DocumentReferenceType>();
     this.originatorDocumentReferenceField = new DocumentReferenceType();
     this.orderReferenceField   = new ObservableCollection <OrderReferenceType>();
     this.cancellationNoteField = new ObservableCollection <CancellationNoteType>();
     this.noteField             = new ObservableCollection <NoteType>();
     this.issueTimeField        = new IssueTimeType();
     this.issueDateField        = new IssueDateType();
     this.uUIDField             = new UUIDType();
     this.copyIndicatorField    = new CopyIndicatorType();
     this.idField = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
 public TransportServiceDescriptionType()
 {
     this.transportationServiceField         = new ObservableCollection <TransportationServiceType>();
     this.validityPeriodField                = new PeriodType();
     this.serviceChargePaymentTermsField     = new PaymentTermsType();
     this.transportServiceProviderPartyField = new PartyType();
     this.transportServiceDescriptionRequestDocumentReferenceField = new DocumentReferenceType();
     this.receiverPartyField      = new PartyType();
     this.senderPartyField        = new PartyType();
     this.signatureField          = new ObservableCollection <SignatureType>();
     this.responseCodeField       = new ResponseCodeType();
     this.serviceNameField        = new ServiceNameType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Beispiel #23
0
        private DocumentReferenceType[] XsltEkle()
        {
            string Dosya = "";

            byte[] fileByteArray4;
            if (intNStokId > 0)
            {
                //Dosya = Convert.ToString(SqlProcess.SelectIslemiYap("Select @p1=XsltYolu From Xslt Where Type=2", DBNAME));
                fileByteArray4 = File.ReadAllBytes(Dosya);
            }

            else
            {
                //Dosya = Convert.ToString(SqlProcess.SelectIslemiYap("Select @p1=XsltYolu From Xslt Where Type=3", DBNAME));
                fileByteArray4 = File.ReadAllBytes(Dosya);
            }

            DocumentReferenceType[] Drt;

            Drt = new DocumentReferenceType[]
            {
                new DocumentReferenceType()
                {
                    ID = new IDType {
                        Value = "0100"
                    },
                    IssueDate        = issueDate,
                    DocumentTypeCode = new DocumentTypeCodeType {
                        Value = "OUTPUT_TYPE"
                    }
                },


                new DocumentReferenceType()     //efatura dan farklı olarak sadece bu alan eklenmiştir.
                {
                    ID = new IDType {
                        Value = "ELEKTRONIK"
                    },
                    IssueDate        = issueDate,
                    DocumentTypeCode = new DocumentTypeCodeType {
                        Value = "EREPSENDT"
                    }
                },

                new DocumentReferenceType()
                {
                    ID = new IDType {
                        Value = "99"
                    },
                    IssueDate        = issueDate,
                    DocumentTypeCode = new DocumentTypeCodeType {
                        Value = "TRANSPORT_TYPE"
                    }
                },

                new DocumentReferenceType()
                {
                    ID = new IDType {
                        Value = GuidId
                    },

                    IssueDate        = issueDate,
                    DocumentTypeCode = new DocumentTypeCodeType {
                        Value = "XSLT"
                    },
                    DocumentType = new DocumentTypeType {
                        Value = "XSLT"
                    },

                    Attachment = new AttachmentType
                    {
                        EmbeddedDocumentBinaryObject = new EmbeddedDocumentBinaryObjectType
                        {
                            characterSetCode = "UTF-8",
                            encodingCode     = "Base64",
                            mimeCode         = "application/xml",
                            filename         = Dosya.Replace("C:\\ProgramData\\", ""),
                            Value            = fileByteArray4
                        }
                    }
                }
            };



            return(Drt);
        }
Beispiel #24
0
        void LlenarCabecera(En_ComprobanteElectronico Comprobante, ref DebitNoteType debitNote)
        {
            UBLExtensionType uBLExtensionType = new UBLExtensionType()
            {
                // Se crea un tag temporal llamado "Borrar", esto porque no he conseguido crear el tag
                // ext:ExtensionContent con un valor vacío
                ExtensionContent = new XmlDocument().CreateElement("Borrar")
            };

            UBLExtensionType[] ublExtensions = { uBLExtensionType };
            debitNote.UBLExtensions = ublExtensions;
            //Serie y Numero
            debitNote.ID = new IDType
            {
                Value = Comprobante.SerieNumero.Trim()
            };

            debitNote.UBLVersionID = new UBLVersionIDType
            {
                Value = "2.1"
            };

            debitNote.IssueDate = new IssueDateType
            {
                Value = Comprobante.FechaEmision
            };
            debitNote.IssueTime = new IssueTimeType
            {
                Value = Comprobante.HoraEmision
            };

            debitNote.DocumentCurrencyCode = new DocumentCurrencyCodeType
            {
                listAgencyName = "United Nations Economic Commission for Europe",
                listID         = "ISO 4217 Alpha",
                listName       = "Currency",
                Value          = Comprobante.Moneda.Trim()
            };

            List <NoteType> oListaNota = new List <NoteType>();

            foreach (En_Leyenda oNote in Comprobante.Leyenda)
            {
                NoteType oNota = new NoteType
                {
                    Value            = oNote.Valor,
                    languageLocaleID = oNote.Codigo
                };
                oListaNota.Add(oNota);
            }
            ;

            debitNote.Note = oListaNota.ToArray();



            debitNote.CustomizationID = new CustomizationIDType
            {
                Value = "2.0"
            };



            List <DocumentReferenceType> oListadocumento = new List <DocumentReferenceType>();

            foreach (En_DocumentoReferencia oreferen in Comprobante.DocumentoReferenciaDespacho)
            {
                DocumentReferenceType odocumento = new DocumentReferenceType
                {
                    ID = new IDType
                    {
                        Value = oreferen.SerieNumero.Trim()
                    },
                    IssueDate = new IssueDateType
                    {
                        Value = oreferen.Fecha.Trim()
                    },
                    DocumentTypeCode = new DocumentTypeCodeType
                    {
                        Value          = oreferen.TipoDocumento.Trim(),
                        listAgencyName = "PE:SUNAT",
                        listName       = "SUNAT:Identificador de guía relacionada",
                        listURI        = "urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo12"
                    }
                };
                oListadocumento.Add(odocumento);
            }
            ;
            debitNote.DespatchDocumentReference = oListadocumento.ToArray();
        }
Beispiel #25
0
        private string XmlCreate()
        {
            InvoiceType res = new InvoiceType();

            res
            .With(io =>
            {
                #region Invoice
                io.UBLVersionID.Value    = "2.1";
                io.CustomizationID.Value = "TR1.2";
                io.ProfileID.Value       = "TEMELFATURA";
                io.InvoiceTypeCode.Value = "SATIS";
                io.ID.Value                   = "HKN0000000000001";
                io.UUID.Value                 = Guid.NewGuid().ToString();
                io.IssueDate.Value            = DateTime.Now;
                io.IssueTime.Value            = DateTime.Now;
                io.DocumentCurrencyCode.Value = "TRY";
                io.LineCountNumeric.Value     = 1;

                io.Note           = new List <NoteType>();
                NoteType oNewNote = new NoteType();
                oNewNote.Value    = "Test Dip Not";
                io.Note.Add(oNewNote);

                //xslt base64 formatında gömme
                io.AdditionalDocumentReference = new List <DocumentReferenceType>();

                DocumentReferenceType oNewAdd = new DocumentReferenceType();
                oNewAdd.ID.Value        = io.UUID.Value;
                oNewAdd.IssueDate.Value = DateTime.Now;
                oNewAdd.Attachment      = new AttachmentType();
                oNewAdd.Attachment
                .With(att =>
                {
                    att.EmbeddedDocumentBinaryObject                  = new EmbeddedDocumentBinaryObjectType();
                    att.EmbeddedDocumentBinaryObject.filename         = io.UUID.Value + ".xslt";
                    att.EmbeddedDocumentBinaryObject.characterSetCode = "UTF-8";
                    att.EmbeddedDocumentBinaryObject.encodingCode     = "Base64";
                    att.EmbeddedDocumentBinaryObject.mimeCode         = "application/xml";
                    att.EmbeddedDocumentBinaryObject.Value            = System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(System.Windows.Forms.Application.StartupPath + "/general.xslt"));
                });
                io.AdditionalDocumentReference.Add(oNewAdd);

                //irsaliye bilgilerini ekleme
                io.DespatchDocumentReference  = new List <DocumentReferenceType>();
                DocumentReferenceType onewSip = new DocumentReferenceType();
                onewSip.ID.Value        = "A859552";
                onewSip.IssueDate.Value = DateTime.Now;
                io.DespatchDocumentReference.Add(onewSip);

                //Sipariş bilgilerini ekleme
                io.OrderReference                 = new OrderReferenceType();
                io.OrderReference.ID.Value        = "32123";
                io.OrderReference.IssueDate.Value = DateTime.Now;
                #endregion

                #region Signature
                //io.Signature = new List<SignatureType>();
                //SignatureType oSig = new SignatureType();
                //oSig
                //    .With(sg =>
                //    {
                //        sg.ID = new IDType();
                //        sg.ID.schemeID = "VKN_TCKN";
                //        sg.ID.Value = "1288331521";

                //        sg.SignatoryParty = new PartyType();
                //        sg.SignatoryParty
                //            .With(sp =>
                //            {
                //                sp.PartyIdentification = new List<PartyIdentificationType>();

                //                PartyIdentificationType oPartyIdent = new PartyIdentificationType();
                //                oPartyIdent.ID = new IDType();
                //                oPartyIdent.ID.schemeID = "VKN";
                //                oPartyIdent.ID.Value = oSirket.RegisterNumber;
                //                sp.PartyIdentification.Add(oPartyIdent);

                //                sp.PostalAddress = new AddressType();
                //                sp.PostalAddress
                //                    .With(pa =>
                //                    {
                //                        pa.StreetName = new StreetNameType();
                //                        pa.StreetName.Value = oSirket.Address;

                //                        //pa.BuildingNumber = new BuildingNumberType();
                //                        //pa.BuildingNumber.Value = "21";

                //                        pa.CitySubdivisionName = new CitySubdivisionNameType();
                //                        pa.CitySubdivisionName.Value = oSirket.District;

                //                        pa.CityName = new CityNameType();
                //                        pa.CityName.Value = oSirket.City;

                //                        //pa.PostalZone = new PostalZoneType();
                //                        //pa.PostalZone.Value = "34100";

                //                        pa.Country = new CountryType();
                //                        pa.Country.Name.Value = oSirket.Country;
                //                    });
                //            });

                //        sg.DigitalSignatureAttachment = new AttachmentType();
                //        sg.DigitalSignatureAttachment.ExternalReference = new ExternalReferenceType();
                //        sg.DigitalSignatureAttachment.ExternalReference.URI.Value = "#Signature";
                //    });

                //io.Signature.Add(oSig);
                #endregion

                #region AccountingSupplierParty
                io.AccountingSupplierParty = new SupplierPartyType();
                io.AccountingSupplierParty
                .With(asp =>
                {
                    asp.Party = new PartyType();
                    asp.Party
                    .With(pp =>
                    {
                        pp.WebsiteURI          = new WebsiteURIType();
                        pp.WebsiteURI.Value    = "www.hakanuçar.com.tr";
                        pp.PartyIdentification = new List <PartyIdentificationType>();
                        pp.PartyIdentification.Add(
                            new PartyIdentificationType
                        {
                            ID = new IDType {
                                schemeID = "VKN", Value = "1234567801"
                            }
                        }
                            );
                        //Firma diğer bilgiler
                        pp.PartyIdentification.Add(
                            new PartyIdentificationType
                        {
                            ID = new IDType {
                                schemeID = "MERSISNO", Value = "4235234"
                            }
                        }
                            );

                        pp.PartyName            = new PartyNameType();
                        pp.PartyName.Name.Value = "Hakan UÇAR Bilgi İşlem";
                        pp.PostalAddress        = new AddressType();
                        pp.PostalAddress
                        .With(pa =>
                        {
                            pa.ID       = new IDType();
                            pa.ID.Value = "1234567801";

                            pa.StreetName       = new StreetNameType();
                            pa.StreetName.Value = "KOZYATAĞI";

                            //pa.BuildingNumber = new BuildingNumberType();
                            //pa.BuildingNumber.Value = "21";

                            pa.CitySubdivisionName       = new CitySubdivisionNameType();
                            pa.CitySubdivisionName.Value = "Beşiktaş";

                            pa.CityName       = new CityNameType();
                            pa.CityName.Value = "İstanbul";

                            //pa.PostalZone = new PostalZoneType();
                            //pa.PostalZone.Value = "341000";

                            pa.Country            = new CountryType();
                            pa.Country.Name.Value = "Türkiye";
                        });

                        pp.PartyTaxScheme                      = new PartyTaxSchemeType();
                        pp.PartyTaxScheme.TaxScheme            = new TaxSchemeType();
                        pp.PartyTaxScheme.TaxScheme.Name       = new NameType1();
                        pp.PartyTaxScheme.TaxScheme.Name.Value = "KOZYATAĞI";

                        pp.Contact = new ContactType();
                        pp.Contact
                        .With(co =>
                        {
                            co.Name       = new NameType1();
                            co.Name.Value = "Hakan UÇAR";

                            co.Telephone       = new TelephoneType();
                            co.Telephone.Value = "0592 558 5588";

                            co.Telefax       = new TelefaxType();
                            co.Telefax.Value = "0592 558 5588";

                            co.ElectronicMail       = new ElectronicMailType();
                            co.ElectronicMail.Value = "*****@*****.**";
                        });
                    });
                });
                #endregion

                #region AccountingCustomerParty
                io.AccountingCustomerParty = new CustomerPartyType();
                string Senaryo             = "0";
                switch (Senaryo)
                {
                //Temel Fatura
                case "0":
                    {
                        #region customerinf
                        io.AccountingCustomerParty
                        .With(cus =>
                        {
                            cus.Party = new PartyType();
                            cus.Party
                            .With(cusp =>
                            {
                                cusp.WebsiteURI       = new WebsiteURIType();
                                cusp.WebsiteURI.Value = "www.hakanuçar.com.tr";

                                cusp.PartyIdentification = new List <PartyIdentificationType>();

                                PartyIdentificationType pi = new PartyIdentificationType();
                                pi.ID          = new IDType();
                                pi.ID.schemeID = "VKN";
                                pi.ID.Value    = "1234567801";
                                cusp.PartyIdentification.Add(pi);

                                cusp.PartyName            = new PartyNameType();
                                cusp.PartyName.Name.Value = "Hakan UÇAR bilgi İşlem";

                                cusp.PostalAddress = new AddressType();
                                cusp.PostalAddress
                                .With(cupa =>
                                {
                                    cupa.ID       = new IDType();
                                    cupa.ID.Value = "1234567801";

                                    cupa.StreetName       = new StreetNameType();
                                    cupa.StreetName.Value = "Kadıköy";

                                    cupa.CityName       = new CityNameType();
                                    cupa.CityName.Value = "İstanbul";

                                    cupa.CitySubdivisionName       = new CitySubdivisionNameType();
                                    cupa.CitySubdivisionName.Value = "Kadıköy";

                                    cupa.Country            = new CountryType();
                                    cupa.Country.Name.Value = "Türkiye";

                                    cupa.PostalZone       = new PostalZoneType();
                                    cupa.PostalZone.Value = "34000";
                                });

                                cusp.Contact = new ContactType();
                                cusp.Contact
                                .With(cuc =>
                                {
                                    cuc.Name       = new NameType1();
                                    cuc.Name.Value = "Hakan UÇAR";

                                    cuc.Telephone       = new TelephoneType();
                                    cuc.Telephone.Value = "0555 55 55 55";

                                    cuc.Telefax       = new TelefaxType();
                                    cuc.Telefax.Value = "0555 55 55 55";

                                    cuc.ElectronicMail       = new ElectronicMailType();
                                    cuc.ElectronicMail.Value = "*****@*****.**";
                                });
                            });
                        });
                        #endregion
                    }
                    break;

                //Ticari Fatura
                case "1":
                    {
                        #region customerinf
                        io.AccountingCustomerParty
                        .With(cus =>
                        {
                            cus.Party = new PartyType();
                            cus.Party
                            .With(cusp =>
                            {
                                cusp.WebsiteURI       = new WebsiteURIType();
                                cusp.WebsiteURI.Value = "www.hakanuçar.com.tr";

                                cusp.PartyIdentification = new List <PartyIdentificationType>();

                                PartyIdentificationType pi = new PartyIdentificationType();
                                pi.ID          = new IDType();
                                pi.ID.schemeID = "VKN";
                                pi.ID.Value    = "1234567801";
                                cusp.PartyIdentification.Add(pi);

                                cusp.PartyName            = new PartyNameType();
                                cusp.PartyName.Name.Value = "Hakan UÇAR bilgi İşlem";

                                cusp.PostalAddress = new AddressType();
                                cusp.PostalAddress
                                .With(cupa =>
                                {
                                    cupa.ID       = new IDType();
                                    cupa.ID.Value = "1234567801";

                                    cupa.StreetName       = new StreetNameType();
                                    cupa.StreetName.Value = "Kadıköy";

                                    cupa.CityName       = new CityNameType();
                                    cupa.CityName.Value = "İstanbul";

                                    cupa.CitySubdivisionName       = new CitySubdivisionNameType();
                                    cupa.CitySubdivisionName.Value = "Kadıköy";

                                    cupa.Country            = new CountryType();
                                    cupa.Country.Name.Value = "Türkiye";

                                    cupa.PostalZone       = new PostalZoneType();
                                    cupa.PostalZone.Value = "34000";
                                });

                                cusp.Contact = new ContactType();
                                cusp.Contact
                                .With(cuc =>
                                {
                                    cuc.Name       = new NameType1();
                                    cuc.Name.Value = "Hakan UÇAR";

                                    cuc.Telephone       = new TelephoneType();
                                    cuc.Telephone.Value = "0555 55 55 55";

                                    cuc.Telefax       = new TelefaxType();
                                    cuc.Telefax.Value = "0555 55 55 55";

                                    cuc.ElectronicMail       = new ElectronicMailType();
                                    cuc.ElectronicMail.Value = "*****@*****.**";
                                });
                            });
                        });
                        #endregion
                    }
                    break;

                //İhracat
                case "2":
                    {
                        #region ExportCustomerInfo
                        io.AccountingCustomerParty
                        .With(cus =>
                        {
                            cus.Party = new PartyType();
                            cus.Party
                            .With(cusp =>
                            {
                                cusp.WebsiteURI       = new WebsiteURIType();
                                cusp.WebsiteURI.Value = "";

                                cusp.PartyIdentification = new List <PartyIdentificationType>();

                                PartyIdentificationType pi = new PartyIdentificationType();
                                pi.ID          = new IDType();
                                pi.ID.schemeID = "VKN";
                                pi.ID.Value    = "1460415308";
                                cusp.PartyIdentification.Add(pi);

                                cusp.PartyName            = new PartyNameType();
                                cusp.PartyName.Name.Value = "Gümrük ve Ticaret Bakanlığı Gümrükler Genel Müdürlüğü- Bilgi İşlem Dairesi Başkanlığı";

                                cusp.PostalAddress = new AddressType();
                                cusp.PostalAddress
                                .With(cupa =>
                                {
                                    //cupa.ID = new IDType();
                                    //cupa.ID.Value = grd.DataTable.GetValue("Vergi No", grdRowIndex).ToString();

                                    //cupa.StreetName = new StreetNameType();
                                    //cupa.StreetName.Value = grd.DataTable.GetValue("Adres", grdRowIndex).ToString();

                                    cupa.CityName       = new CityNameType();
                                    cupa.CityName.Value = "Ankara";

                                    //cupa.CitySubdivisionName = new CitySubdivisionNameType();
                                    //cupa.CitySubdivisionName.Value = grd.DataTable.GetValue("İlçe", grdRowIndex).ToString();

                                    cupa.Country            = new CountryType();
                                    cupa.Country.Name.Value = "Türkiye";
                                });


                                cusp.PartyTaxScheme                      = new PartyTaxSchemeType();
                                cusp.PartyTaxScheme.TaxScheme            = new TaxSchemeType();
                                cusp.PartyTaxScheme.TaxScheme.Name       = new NameType1();
                                cusp.PartyTaxScheme.TaxScheme.Name.Value = "Ulus";
                            });
                        });
                        #endregion
                    }
                    break;

                //Yolcu Beraber Fatura
                case "3":
                    {
                        #region TaxFreeInfo
                        //oInvoice.TaxFreeInfo = new TaxFreeInfo();
                        //oInvoice.TaxFreeInfo
                        //    .With(txfi =>
                        //    {
                        //        txfi.TouristInfo = new TouristInfo(); //Turistin bilgilerinin girileceği alandır.
                        //        txfi.TouristInfo
                        //            .With(ti =>
                        //            {
                        //                ti.Name = ""; //Bu alan turistin ad bilgisi girilir.
                        //                ti.SurName = ""; //Bu alan turistin soyad bilgisi girilir.
                        //                ti.PassportNo = ""; //Bu alan turistin pasaport numarası bilgisi girilir.
                        //                ti.PassportDate = DateTime.Now; //Bu alan turistin pasaport tarihi bilgisi girilir.
                        //                ti.CountryCode = ""; //Bu alan turistin ülke kodu bilgisi girilir.(örn:TR)
                        //                ti.FinancialAccountInfo = new FinancialAccountInfo(); //Bu alana turistin banka hesap bilgileri girilir.
                        //                ti.FinancialAccountInfo
                        //                    .With(fa =>
                        //                    {
                        //                        fa.BankName = ""; //Bu alan Banka Adı bilgisi girilir.
                        //                        fa.BranchName = ""; //Bu alan Banka Şube Adı bilgisi girilir.
                        //                        fa.CurrencyCode = ""; //Bu alan Para Birimi bilgisi girilir.
                        //                        fa.ID = ""; //Bu alan Banka Hesap Numarası bilgisi girilir.
                        //                        fa.PaymentNote = ""; //Bu alan Ödeme Notu bilgisi girilir.
                        //                    });
                        //                ti.AddressInfo = new AddressInfo(); //Bu alan turistin adres bilgileri girilir.
                        //                ti.AddressInfo
                        //                    .With(ai =>
                        //                    {
                        //                        ai.Address = "";
                        //                        ai.City = "";
                        //                        ai.Country = "";
                        //                        ai.District = "";
                        //                        ai.Fax = "";
                        //                        ai.Mail = "";
                        //                        ai.Phone = "";
                        //                        ai.PostalCode = "";
                        //                        ai.WebSite = "";
                        //                    });
                        //            });

                        //        txfi.TaxRepresentativeInfo = new TaxRepresentativeInfo(); //Aracı kurum bilgilerinin girileceği alandır.
                        //        txfi.TaxRepresentativeInfo
                        //            .With(tri =>
                        //            {
                        //                tri.RegisterNumber = ""; //Bu alana Aracı Kurumun Vergi Kimlik Numarası girilir.
                        //                tri.Alias = ""; //Bu alana Aracı Kurumun Etiket bilgisi girilir.
                        //                tri.Address = new AddressInfo();//Bu alan turistin adres bilgileri girilir
                        //                tri.Address
                        //                    .With(ai =>
                        //                    {
                        //                        ai.Address = "";
                        //                        ai.City = "";
                        //                        ai.Country = "";
                        //                        ai.District = "";
                        //                        ai.Fax = "";
                        //                        ai.Mail = "";
                        //                        ai.Phone = "";
                        //                        ai.PostalCode = "";
                        //                        ai.WebSite = "";
                        //                    });
                        //            });
                        //    });
                        #endregion
                    }
                    break;

                //EArşiv Fatura
                case "4":
                    {
                        #region customerinf
                        //oInvoice.CustomerInfo = new PartyInfo();
                        //oInvoice.CustomerInfo.Address = grd.DataTable.GetValue("Adres", grdRowIndex).ToString();
                        //oInvoice.CustomerInfo.City = grd.DataTable.GetValue("İl", grdRowIndex).ToString();//"İstanbul";
                        //oInvoice.CustomerInfo.Country = grd.DataTable.GetValue("Ülke", grdRowIndex).ToString();//"Türkiye";
                        //oInvoice.CustomerInfo.District = grd.DataTable.GetValue("İlçe", grdRowIndex).ToString();//"Ataşehir";
                        //oInvoice.CustomerInfo.Fax = grd.DataTable.GetValue("Fax", grdRowIndex).ToString();//"216 688 51 99";
                        //oInvoice.CustomerInfo.Mail = grd.DataTable.GetValue("Email", grdRowIndex).ToString();//"*****@*****.**";
                        //oInvoice.CustomerInfo.Name = grd.DataTable.GetValue("Muhatap Adı", grdRowIndex).ToString();//"NES Bilgi Teknolojileri";
                        //oInvoice.CustomerInfo.Phone = grd.DataTable.GetValue("Telefon", grdRowIndex).ToString();// "216 688 51 00";
                        //oInvoice.CustomerInfo.RegisterNumber = grd.DataTable.GetValue("Vergi No", grdRowIndex).ToString();// "1234567801";
                        //oInvoice.CustomerInfo.TaxOffice = grd.DataTable.GetValue("Vergi Dairesi", grdRowIndex).ToString();// "KOZYATAĞI";
                        //oInvoice.CustomerInfo.WebSite = grd.DataTable.GetValue("Web Sitesi", grdRowIndex).ToString();// "https://nesbilgi.com.tr/";
                        //oInvoice.CustomerInfo.ReceiverAlias = grd.DataTable.GetValue("Alıcı Posta Etiketi", grdRowIndex).ToString();// "urn:mail:[email protected]";/
                        #endregion
                    }
                    break;

                default:
                    break;
                }

                #endregion

                if (Senaryo == "2")
                {
                    #region BuyerCustomerParty
                    io.BuyerCustomerParty = new CustomerPartyType();
                    io.BuyerCustomerParty
                    .With(cus =>
                    {
                        cus.Party = new PartyType();
                        cus.Party
                        .With(cusp =>
                        {
                            cusp.WebsiteURI       = new WebsiteURIType();
                            cusp.WebsiteURI.Value = "www.hakanucar.com.tr";

                            cusp.PartyIdentification = new List <PartyIdentificationType>();

                            PartyIdentificationType pi = new PartyIdentificationType();
                            pi.ID          = new IDType();
                            pi.ID.schemeID = "VKN";
                            pi.ID.Value    = "1234567801";
                            cusp.PartyIdentification.Add(pi);

                            cusp.PartyName            = new PartyNameType();
                            cusp.PartyName.Name.Value = "Hakan UÇAR Bilişim";

                            cusp.PostalAddress = new AddressType();
                            cusp.PostalAddress
                            .With(cupa =>
                            {
                                cupa.ID       = new IDType();
                                cupa.ID.Value = "1234567801";

                                cupa.StreetName       = new StreetNameType();
                                cupa.StreetName.Value = "Meçhul bir yer";

                                cupa.CityName       = new CityNameType();
                                cupa.CityName.Value = "İstanbul";

                                cupa.CitySubdivisionName       = new CitySubdivisionNameType();
                                cupa.CitySubdivisionName.Value = "Beşiktaş";

                                cupa.Country            = new CountryType();
                                cupa.Country.Name.Value = "Türkiye";

                                cupa.PostalZone       = new PostalZoneType();
                                cupa.PostalZone.Value = "34000";
                            });

                            cusp.Contact = new ContactType();
                            cusp.Contact
                            .With(cuc =>
                            {
                                cuc.Name       = new NameType1();
                                cuc.Name.Value = "Hakan UÇAR";

                                cuc.Telephone       = new TelephoneType();
                                cuc.Telephone.Value = "555 55 55 55";

                                cuc.Telefax       = new TelefaxType();
                                cuc.Telefax.Value = "555 55 55 55";

                                cuc.ElectronicMail       = new ElectronicMailType();
                                cuc.ElectronicMail.Value = "*****@*****.**";
                            });
                        });
                    });
                    #endregion
                }

                #region PaymentTerms
                //Ödeme Koşulu

                io.PaymentTerms            = new PaymentTermsType();
                io.PaymentTerms.Note       = new NoteType();
                io.PaymentTerms.Note.Value = "60 gün vadeli";
                #endregion

                #region TaxTotal
                //Vergiler
                io.TaxTotal = new List <TaxTotalType>();
                io.TaxTotal
                .With(tt =>
                {
                    TaxTotalType ott         = new TaxTotalType();
                    ott.TaxAmount            = new TaxAmountType();
                    ott.TaxAmount.currencyID = "TRY";
                    ott.TaxAmount.Value      = 180;

                    ott.TaxSubtotal = new List <TaxSubtotalType>();

                    TaxSubtotalType oSubt          = new TaxSubtotalType();
                    oSubt.TaxableAmount            = new TaxableAmountType();
                    oSubt.TaxableAmount.currencyID = "TRY";
                    oSubt.TaxableAmount.Value      = 1000;

                    oSubt.TaxAmount            = new TaxAmountType();
                    oSubt.TaxAmount.currencyID = "TRY";
                    oSubt.TaxAmount.Value      = 180;

                    oSubt.TaxCategory                             = new TaxCategoryType();
                    oSubt.TaxCategory.TaxScheme                   = new TaxSchemeType();
                    oSubt.TaxCategory.TaxScheme.TaxTypeCode       = new TaxTypeCodeType();
                    oSubt.TaxCategory.TaxScheme.TaxTypeCode.Value = "0015";

                    ott.TaxSubtotal.Add(oSubt);

                    tt.Add(ott);
                });
                #endregion

                #region InvoiceLine
                io.InvoiceLine = new List <InvoiceLineType>();

                InvoiceLineType il = new InvoiceLineType();

                il
                .With(iol =>
                {
                    //Sıra No
                    iol.ID       = new IDType();
                    iol.ID.Value = "1";

                    //Kalem Tanımı
                    iol.Item            = new ItemType();
                    iol.Item.Name       = new NameType1();
                    iol.Item.Name.Value = "HP X534 Yazıcı";

                    iol.Item.SellersItemIdentification          = new ItemIdentificationType();
                    iol.Item.SellersItemIdentification.ID.Value = "KLM0012";

                    //Kalem Miktarı
                    iol.InvoicedQuantity          = new InvoicedQuantityType();
                    iol.InvoicedQuantity.unitCode = "C62";
                    iol.InvoicedQuantity.Value    = 1;

                    //Kalem Birim Fiyatı
                    iol.Price                        = new PriceType();
                    iol.Price.PriceAmount            = new PriceAmountType();
                    iol.Price.PriceAmount.currencyID = "TRY";
                    iol.Price.PriceAmount.Value      = 1000;

                    iol.Note          = new List <NoteType>();
                    NoteType oKlmNote = new NoteType();
                    oNewNote.Value    = "Test kalem notu";
                    iol.Note.Add(oKlmNote);

                    //iskonto
                    //iol.AllowanceCharge = new List<AllowanceChargeType>();
                    //iol.AllowanceCharge
                    //    .With(all =>
                    //    {
                    //        AllowanceChargeType allc = new AllowanceChargeType();
                    //        allc.ChargeIndicator = new ChargeIndicatorType();
                    //        allc.ChargeIndicator.Value = false;
                    //        allc.MultiplierFactorNumeric = new MultiplierFactorNumericType();
                    //        allc.MultiplierFactorNumeric.Value = 0.0M;
                    //        allc.Amount = new AmountType2();
                    //        allc.Amount.currencyID = "TRY";
                    //        allc.Amount.Value = 0M;
                    //        allc.BaseAmount = new BaseAmountType();
                    //        allc.BaseAmount.currencyID = "TRY";
                    //        allc.BaseAmount.Value = ((decimal)Services.ObjectToDouble(fech.Item("Quantity").Value)) *
                    //                                ((decimal)Services.ObjectToDouble(fech.Item("Price").Value));
                    //        all.Add(allc);
                    //    });

                    if (Senaryo == "2")
                    {
                        iol.Delivery           = new List <DeliveryType>();
                        DeliveryType oDelivery = new DeliveryType();

                        oDelivery
                        .With(d =>
                        {
                            DeliveryTermsType dtt = new DeliveryTermsType();
                            dtt.ID.schemeID       = "INCOTERMS";
                            dtt.ID.Value          = "Teslim şartı";
                            d.DeliveryTerms.Add(dtt);

                            d.DeliveryAddress
                            .With(ai =>
                            {
                                ai.StreetName       = new StreetNameType();
                                ai.StreetName.Value = "Meçhul bir adres";

                                ai.CitySubdivisionName       = new CitySubdivisionNameType();
                                ai.CitySubdivisionName.Value = "Beşiktaş";

                                ai.CityName       = new CityNameType();
                                ai.CityName.Value = "İstanbul";

                                ai.Country            = new CountryType();
                                ai.Country.Name.Value = "Türkiye";
                            });

                            d.Shipment
                            .With(shp =>
                            {
                                shp.ID.Value                   = "Gümrük tarkip numarası";
                                GoodsItemType oGItem           = new GoodsItemType();
                                oGItem.RequiredCustomsID.Value = "GTIP";
                                shp.GoodsItem.Add(oGItem);

                                ShipmentStageType oState       = new ShipmentStageType();
                                oState.TransportModeCode.Value = "Gönderim şekli";
                                shp.ShipmentStage.Add(oState);

                                TransportHandlingUnitType othlu = new TransportHandlingUnitType();
                                PackageType op             = new PackageType();
                                op.ID.Value                = "Kab numarası";
                                op.Quantity.Value          = 1;   //paket adedi
                                op.PackagingTypeCode.Value = "Kabın cinsi";
                                othlu.ActualPackage.Add(op);
                                shp.TransportHandlingUnit.Add(othlu);

                                //di.PackageBrandName = fech.Item("U_PackageBrandName").Value.ToString() == "" ? grd.DataTable.GetValue("Kabın Markası", grdRowIndex).ToString() : fech.Item("U_PackageBrandName").Value.ToString(); //Bu alana Mal/Hizmetin bulunduğu Kabın Marka isim bilgisi girilir.
                            });
                        });

                        iol.Delivery.Add(oDelivery);
                    }

                    //Vergi Toplam
                    iol.TaxTotal = new TaxTotalType();
                    iol.TaxTotal
                    .With(tx =>
                    {
                        tx.TaxAmount            = new TaxAmountType();
                        tx.TaxAmount.currencyID = "TRY";
                        tx.TaxAmount.Value      = 180;


                        //Vergiler
                        tx.TaxSubtotal = new List <TaxSubtotalType>();
                        tx.TaxSubtotal
                        .With(txs =>
                        {
                            TaxSubtotalType sbt          = new TaxSubtotalType();
                            sbt.TaxableAmount            = new TaxableAmountType();
                            sbt.TaxableAmount.currencyID = "TRY";
                            sbt.TaxableAmount.Value      = 1000;
                            sbt.TaxAmount            = new TaxAmountType();
                            sbt.TaxAmount.currencyID = "TRY";
                            sbt.TaxAmount.Value      = 180;
                            sbt.Percent       = new PercentType1();
                            sbt.Percent.Value = 18;

                            sbt.TaxCategory                             = new TaxCategoryType();
                            sbt.TaxCategory.TaxScheme                   = new TaxSchemeType();
                            sbt.TaxCategory.TaxScheme.Name              = new NameType1();
                            sbt.TaxCategory.TaxScheme.Name.Value        = "KDV";
                            sbt.TaxCategory.TaxScheme.TaxTypeCode       = new TaxTypeCodeType();
                            sbt.TaxCategory.TaxScheme.TaxTypeCode.Value = "0015";

                            txs.Add(sbt);
                        });
                    });

                    //Kalem Mal Hizmet Tutarı
                    iol.LineExtensionAmount            = new LineExtensionAmountType();
                    iol.LineExtensionAmount.currencyID = "TRY";
                    iol.LineExtensionAmount.Value      = 1000;
                });



                io.InvoiceLine.Add(il);

                #endregion

                #region LegalMonetaryTotal
                io.LegalMonetaryTotal = new MonetaryTotalType();

                //Mal Hizmet Toplam Tutar
                io.LegalMonetaryTotal.LineExtensionAmount            = new LineExtensionAmountType();
                io.LegalMonetaryTotal.LineExtensionAmount.currencyID = "TRY";
                io.LegalMonetaryTotal.LineExtensionAmount.Value      = 1000;

                //Vergiler Hariç Tutar
                io.LegalMonetaryTotal.TaxExclusiveAmount            = new TaxExclusiveAmountType();
                io.LegalMonetaryTotal.TaxExclusiveAmount.currencyID = "TRY";
                io.LegalMonetaryTotal.TaxExclusiveAmount.Value      = 1000;

                //Vergiler Dahil Tutar
                io.LegalMonetaryTotal.TaxInclusiveAmount            = new TaxInclusiveAmountType();
                io.LegalMonetaryTotal.TaxInclusiveAmount.currencyID = "TRY";
                io.LegalMonetaryTotal.TaxInclusiveAmount.Value      = 1180;


                //iskonto
                io.LegalMonetaryTotal.AllowanceTotalAmount            = new AllowanceTotalAmountType();
                io.LegalMonetaryTotal.AllowanceTotalAmount.currencyID = "TRY";
                io.LegalMonetaryTotal.AllowanceTotalAmount.Value      = 0M;

                //Ödenecek Tutar
                io.LegalMonetaryTotal.PayableAmount            = new PayableAmountType();
                io.LegalMonetaryTotal.PayableAmount.currencyID = "TRY";
                io.LegalMonetaryTotal.PayableAmount.Value      = 1180;

                #endregion
            });

            return(UblTrSerialize.UblSerialize(res));
        }
        private SummaryDocumentsLineType GetLineRC(RBoletasDetalle det, int i, string typerc)
        {
            detOk  = false;
            HILT_s = new SummaryDocumentsLineType();

            try
            {
                #region alter js

                LineIDType LIT = new LineIDType();
                LIT.Value = (i + 1).ToString();

                HILT_s.LineID = LIT;

                //tipo de documento (03, 07, 08)
                DocumentTypeCodeType DTCT = new DocumentTypeCodeType();
                DTCT.Value = RBD[i].TPO_CPE;
                HILT_s.DocumentTypeCode = DTCT;

                #region condition code

                StatusType        StatusTP  = new StatusType();
                ConditionCodeType Condition = new ConditionCodeType();
                RBD[i].ConditionCode = 0;

                if (RBD[i].ConditionCode == 0)
                {
                    if (typerc != "ANS")
                    {
                        Condition.Value = "1";
                    }
                    else
                    {
                        Condition.Value = "3";
                        #region other
                        //switch (RBD[i].SYSTEM_STATUS)
                        //{
                        //    case "XGN":
                        //        {
                        //            //Condition.Value = "1";
                        //            break;
                        //        }
                        //    case "ANS":
                        //        {
                        //            Condition.Value = "3";
                        //            //var res = ADE.Extras.Common.Method.Methods.Instance.DateCompare(DateTime.Now.ToString("yyyy-MM-dd"), RBD[i].FEC_EMIS.ToString("yyyy-MM-dd"));
                        //            //if (res == 1)
                        //            //{ Condition.Value = "3"; }
                        //            //else
                        //            ////{ Condition.Value = "4"; }
                        //            //{ Condition.Value = "3"; }
                        //            break;
                        //        }
                        //}
                        #endregion
                    }
                    ListDocs.Add(new Extras.Common.Method.UtilClass()
                    {
                        NUM_CE = RBD[i].NUM_CPE, STATUS_RC_DOC = int.Parse(Condition.Value)
                    });
                }


                StatusTP.ConditionCode = Condition;
                HILT_s.Status          = new StatusType();
                HILT_s.Status          = StatusTP;
                #endregion

                //ID (xxxx-xxxxxxxx)
                IDType IdDocumentType = new IDType();
                IdDocumentType.Value = RBD[i].ID;
                HILT_s.ID            = new IDType();
                HILT_s.ID            = IdDocumentType;

                //added js
                AmountType1 TotAmount = new AmountType1();
                TotAmount.Value      = RBD[i].MTO_TOT;
                TotAmount.currencyID = CurrencyCodeContentType.PEN;
                TotAmount.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;
                HILT_s.TotalAmount   = TotAmount;//total documento

                CustomerPartyType CPT = new CustomerPartyType();
                CPT.CustomerAssignedAccountID       = new CustomerAssignedAccountIDType();
                CPT.CustomerAssignedAccountID.Value = RBD[i].CustomerAssignedAccountID;

                AdditionalAccountIDType   AAID  = new AdditionalAccountIDType();
                AdditionalAccountIDType[] AAIDs = new AdditionalAccountIDType[1];

                AAID.Value = RBD[i].AdditionalAccountID;
                AAIDs[0]   = AAID;

                CPT.AdditionalAccountID = AAIDs;

                HILT_s.AccountingCustomerParty = CPT;

                PaymentType[] billingPayment = new PaymentType[4];

                PaymentType       bp_item        = new PaymentType();
                InstructionIDType idInsType      = new InstructionIDType();
                PaidAmountType    paidAmountType = new PaidAmountType();

                #region START - IMPORTES

                // IMPORTES - GRAVADO
                var ImpGravado = Convert.ToDecimal(RBD[i].MTO_GRA, CultureInfo.CreateSpecificCulture("es-PE"));
                if (ImpGravado > 0)
                {
                    bp_item        = new PaymentType();
                    idInsType      = new InstructionIDType();
                    paidAmountType = new PaidAmountType();

                    idInsType.Value      = "01";
                    paidAmountType.Value = Convert.ToDecimal(RBD[i].MTO_GRA, CultureInfo.CreateSpecificCulture("es-PE"));
                    //paidAmountType.currencyID = CurrencyCodeContentType.PEN;
                    paidAmountType.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    bp_item.PaidAmount    = paidAmountType;
                    bp_item.InstructionID = idInsType;

                    billingPayment[0] = bp_item;
                }

                // IMPORTES - EXONERADOS
                var ImpExonerado = Convert.ToDecimal(RBD[i].MTO_EXO, CultureInfo.CreateSpecificCulture("es-PE"));
                if (ImpExonerado > 0)
                {
                    bp_item        = new PaymentType();
                    idInsType      = new InstructionIDType();
                    paidAmountType = new PaidAmountType();

                    idInsType.Value      = "02";
                    paidAmountType.Value = Convert.ToDecimal(RBD[i].MTO_EXO, CultureInfo.CreateSpecificCulture("es-PE"));
                    //paidAmountType.currencyID = CurrencyCodeContentType.PEN;
                    paidAmountType.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    bp_item.PaidAmount    = paidAmountType;
                    bp_item.InstructionID = idInsType;

                    billingPayment[1] = bp_item;
                }

                // IMPORTES - INAFECTO
                var ImpInafecto = Convert.ToDecimal(RBD[i].MTO_INA, CultureInfo.CreateSpecificCulture("es-PE"));
                if (ImpInafecto > 0)
                {
                    bp_item        = new PaymentType();
                    idInsType      = new InstructionIDType();
                    paidAmountType = new PaidAmountType();

                    idInsType.Value      = "03";
                    paidAmountType.Value = Convert.ToDecimal(RBD[i].MTO_INA, CultureInfo.CreateSpecificCulture("es-PE"));
                    //paidAmountType.currencyID = CurrencyCodeContentType.PEN;
                    paidAmountType.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    bp_item.PaidAmount    = paidAmountType;
                    bp_item.InstructionID = idInsType;

                    billingPayment[2] = bp_item;
                }

                // IMPORTES - GRATUITAS
                var ImpGratuitas = Convert.ToDecimal(RBD[i].MON_GRAT, CultureInfo.CreateSpecificCulture("es-PE"));
                if (ImpGratuitas > 0)
                {
                    bp_item        = new PaymentType();
                    idInsType      = new InstructionIDType();
                    paidAmountType = new PaidAmountType();

                    idInsType.Value      = "05";
                    paidAmountType.Value = Convert.ToDecimal(RBD[i].MON_GRAT, CultureInfo.CreateSpecificCulture("es-PE"));
                    //paidAmountType.currencyID = CurrencyCodeContentType.PEN;
                    paidAmountType.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    bp_item.PaidAmount    = paidAmountType;
                    bp_item.InstructionID = idInsType;

                    billingPayment[3] = bp_item;
                }

                HILT_s.BillingPayment = billingPayment;

                // IMPORTES - OTROS CARGOS
                var ImpOtroCargos = Convert.ToDecimal(RBD[i].MTO_OCA, CultureInfo.CreateSpecificCulture("es-PE"));
                if (ImpOtroCargos > 0)
                {
                    AllowanceChargeType[] allowCharge = new AllowanceChargeType[1];
                    AmountType1           AT1         = new AmountType1();

                    ChargeIndicatorType CIT = new ChargeIndicatorType();
                    CIT.Value = true;


                    allowCharge[0] = new AllowanceChargeType();
                    allowCharge[0].ChargeIndicator = new ChargeIndicatorType();

                    allowCharge[0].ChargeIndicator = CIT;

                    AT1       = null; AT1 = new AmountType1();
                    AT1.Value = Convert.ToDecimal(RBD[i].MTO_OCA, CultureInfo.CreateSpecificCulture("es-PE"));
                    //AT1.currencyID = CurrencyCodeContentType.PEN;
                    AT1.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    allowCharge[0].Amount = AT1;

                    HILT_s.AllowanceCharge    = new AllowanceChargeType[1];
                    HILT_s.AllowanceCharge[0] = new AllowanceChargeType();

                    HILT_s.AllowanceCharge[0] = allowCharge[0];
                }

                #endregion END IMPORTES

                #region START IMPUESTOS
                TaxTotalType[] TOTs;// = new TaxTotalType[3];
                TOTs = new TaxTotalType[3];

                TaxTotalType    TOT   = new TaxTotalType();
                TaxAmountType   TAT   = new TaxAmountType();
                TaxSubtotalType TST   = new TaxSubtotalType();
                TaxCategoryType TCT   = new TaxCategoryType();
                TaxSchemeType   TSchT = new TaxSchemeType();

                TaxSubtotalType[] TsTi;// = new TaxSubtotalType[3];


                IDType          IDsch    = new IDType();
                NameType1       nameType = new NameType1();
                TaxTypeCodeType tTCt     = new TaxTypeCodeType();


                //IMP IGV
                //var imp_igv = Convert.ToDecimal(RBD[i].IMP_IGV, CultureInfo.CreateSpecificCulture("es-PE"));
                //if (imp_igv > 0)
                //{
                TOT   = new TaxTotalType();
                TAT   = new TaxAmountType();
                TST   = new TaxSubtotalType();
                TCT   = new TaxCategoryType();
                TSchT = new TaxSchemeType();
                TsTi  = new TaxSubtotalType[1];

                //IDType IDsch = new IDType();
                //NameType1 nameType = new NameType1();
                //TaxTypeCodeType tTCt = new TaxTypeCodeType();

                IDsch    = new IDType();
                nameType = new NameType1();
                tTCt     = new TaxTypeCodeType();

                TAT.Value = Convert.ToDecimal(RBD[i].IMP_IGV, CultureInfo.CreateSpecificCulture("es-PE"));
                //TAT.currencyID = CurrencyCodeContentType.PEN;
                TAT.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                IDsch.Value    = "1000";
                nameType.Value = "IGV";
                tTCt.Value     = "VAT";

                TSchT.ID          = IDsch;
                TSchT.Name        = nameType;
                TSchT.TaxTypeCode = tTCt;
                TCT.TaxScheme     = TSchT;
                TST.TaxAmount     = TAT;
                TST.TaxCategory   = TCT;
                TOT.TaxAmount     = TAT;
                TsTi[0]           = TST;

                TOT.TaxSubtotal = TsTi;
                TOTs[0]         = TOT;

                //}

                //IMP ISC
                //var imp_isc = Convert.ToDecimal(RBD[i].IMP_ISC, CultureInfo.CreateSpecificCulture("es-PE"));
                //if (imp_isc > 0)
                //{
                TOT   = new TaxTotalType();
                TAT   = new TaxAmountType();
                TST   = new TaxSubtotalType();
                TCT   = new TaxCategoryType();
                TSchT = new TaxSchemeType();
                TsTi  = new TaxSubtotalType[1];

                //IDType IDsch = new IDType();
                //NameType1 nameType = new NameType1();
                //TaxTypeCodeType tTCt = new TaxTypeCodeType();

                IDsch    = new IDType();
                nameType = new NameType1();
                tTCt     = new TaxTypeCodeType();

                TAT.Value = Convert.ToDecimal(RBD[i].IMP_ISC, CultureInfo.CreateSpecificCulture("es-PE"));
                //TAT.currencyID = CurrencyCodeContentType.PEN;
                TAT.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                IDsch.Value    = "2000";
                nameType.Value = "ISC";
                tTCt.Value     = "EXC";

                TSchT.ID          = IDsch;
                TSchT.Name        = nameType;
                TSchT.TaxTypeCode = tTCt;
                TCT.TaxScheme     = TSchT;
                TST.TaxAmount     = TAT;
                TST.TaxCategory   = TCT;
                TOT.TaxAmount     = TAT;
                TsTi[0]           = TST;

                TOT.TaxSubtotal = TsTi;
                TOTs[1]         = TOT;

                //}

                //IMP OTH
                var imp_oth = Convert.ToDecimal(RBD[i].IMP_OTH, CultureInfo.CreateSpecificCulture("es-PE"));
                if (imp_oth > 0)
                {
                    TOT   = new TaxTotalType();
                    TAT   = new TaxAmountType();
                    TST   = new TaxSubtotalType();
                    TCT   = new TaxCategoryType();
                    TSchT = new TaxSchemeType();
                    TsTi  = new TaxSubtotalType[1];

                    //IDType IDsch = new IDType();
                    //NameType1 nameType = new NameType1();
                    //TaxTypeCodeType tTCt = new TaxTypeCodeType();

                    IDsch    = new IDType();
                    nameType = new NameType1();
                    tTCt     = new TaxTypeCodeType();

                    TAT.Value = Convert.ToDecimal(RBD[i].IMP_OTH, CultureInfo.CreateSpecificCulture("es-PE"));
                    //TAT.currencyID = CurrencyCodeContentType.PEN;
                    TAT.currencyID = RBD[i].MONEDA.ToUpper() == "USD" ? CurrencyCodeContentType.USD : CurrencyCodeContentType.PEN;

                    IDsch.Value    = "9999";
                    nameType.Value = "OTROS";
                    tTCt.Value     = "OTH";

                    TSchT.ID          = IDsch;
                    TSchT.Name        = nameType;
                    TSchT.TaxTypeCode = tTCt;
                    TCT.TaxScheme     = TSchT;
                    TST.TaxAmount     = TAT;
                    TST.TaxCategory   = TCT;
                    TOT.TaxAmount     = TAT;
                    TsTi[0]           = TST;

                    TOT.TaxSubtotal = TsTi;
                    TOTs[2]         = TOT;
                }

                HILT_s.TaxTotal = TOTs;

                #endregion END IMPUESTOS

                #region IF NOTE CREDI OR NOTE DEBIT
                if (RBD[i].TPO_CPE.Contains("07") || RBD[i].TPO_CPE.Contains("08"))
                {
                    string[] array_tpodoc_afec = RBD[i].TPO_DOC_AFEC.Split(',');
                    string[] array_nrodoc_afec = RBD[i].NRO_DOC_AFEC.Split(',');
                    if (array_tpodoc_afec.Length == array_nrodoc_afec.Length)
                    {
                        BillingReferenceType[] BRs    = new BillingReferenceType[array_nrodoc_afec.Length];
                        BillingReferenceType   BR     = new BillingReferenceType();
                        DocumentReferenceType  docRef = new DocumentReferenceType();
                        for (int af = 0; af < array_tpodoc_afec.Length; af++)
                        {
                            BR     = new BillingReferenceType();
                            docRef = new DocumentReferenceType();

                            IDType idref = new IDType();
                            idref.Value = array_nrodoc_afec[af];

                            DocumentTypeCodeType doctyperef = new DocumentTypeCodeType();
                            doctyperef.Value = array_tpodoc_afec[af];

                            docRef.ID = idref;
                            docRef.DocumentTypeCode = doctyperef;

                            BR.InvoiceDocumentReference = docRef;
                            BRs[af] = BR;
                        }
                        HILT_s.BillingReference = BRs;
                    }
                }
                #endregion

                //MILT[i] = HILT;


                #endregion
                detOk = true;
            }
            catch (Exception ex)
            {
                detOk = false;
            }
            return(HILT_s);
        }