From c06010385d86767e6cdcd25cef6b4f874eb9a07c Mon Sep 17 00:00:00 2001 From: Jose Antonio Medina Date: Fri, 20 Mar 2026 16:27:27 -0600 Subject: [PATCH 1/4] Added lading examples by value and reference --- .../BillOfLadingReferenceForm.Designer.cs | 416 +++ .../BillOfLadingReferenceForm.cs | 3029 ++++++++++++++++ .../BillOfLadingValueForm.Designer.cs | 416 +++ .../BillOfLadingValueForm.cs | 3119 +++++++++++++++++ .../FiscalApi.Samples.NetFramework.csproj | 16 +- FiscalApi.Samples.NetFramework/Form1.cs | 4 +- .../InvoiceReferenceForm.cs | 3 +- .../InvoiceValueForm.cs | 3 +- 8 files changed, 7000 insertions(+), 6 deletions(-) create mode 100644 FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs create mode 100644 FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs create mode 100644 FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs create mode 100644 FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs new file mode 100644 index 0000000..036d63a --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs @@ -0,0 +1,416 @@ +namespace FiscalApi.Samples.NetFramework +{ + partial class BillOfLadingReferenceForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.button7 = new System.Windows.Forms.Button(); + this.button8 = new System.Windows.Forms.Button(); + this.button9 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.button12 = new System.Windows.Forms.Button(); + this.button13 = new System.Windows.Forms.Button(); + this.button14 = new System.Windows.Forms.Button(); + this.button15 = new System.Windows.Forms.Button(); + this.button16 = new System.Windows.Forms.Button(); + this.button17 = new System.Windows.Forms.Button(); + this.button18 = new System.Windows.Forms.Button(); + this.button19 = new System.Windows.Forms.Button(); + this.button20 = new System.Windows.Forms.Button(); + this.button21 = new System.Windows.Forms.Button(); + this.button22 = new System.Windows.Forms.Button(); + this.button23 = new System.Windows.Forms.Button(); + this.button24 = new System.Windows.Forms.Button(); + this.button25 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.button2); + this.groupBox1.Controls.Add(this.button3); + this.groupBox1.Controls.Add(this.button4); + this.groupBox1.Controls.Add(this.button5); + this.groupBox1.Controls.Add(this.button6); + this.groupBox1.Controls.Add(this.button7); + this.groupBox1.Controls.Add(this.button8); + this.groupBox1.Controls.Add(this.button9); + this.groupBox1.Controls.Add(this.button10); + this.groupBox1.Controls.Add(this.button11); + this.groupBox1.Controls.Add(this.button12); + this.groupBox1.Controls.Add(this.button13); + this.groupBox1.Controls.Add(this.button14); + this.groupBox1.Controls.Add(this.button15); + this.groupBox1.Controls.Add(this.button16); + this.groupBox1.Controls.Add(this.button17); + this.groupBox1.Controls.Add(this.button18); + this.groupBox1.Controls.Add(this.button19); + this.groupBox1.Controls.Add(this.button20); + this.groupBox1.Controls.Add(this.button21); + this.groupBox1.Controls.Add(this.button22); + this.groupBox1.Controls.Add(this.button23); + this.groupBox1.Controls.Add(this.button24); + this.groupBox1.Controls.Add(this.button25); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Size = new System.Drawing.Size(995, 430); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Carta Porte"; + // + // button1 - Factura ingreso autotransporte nacional + // + this.button1.Location = new System.Drawing.Point(5, 21); + this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(189, 60); + this.button1.TabIndex = 1; + this.button1.Text = "Factura ingreso autotransporte nacional"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 - Factura ingreso autotransporte nacional con impuestos + // + this.button2.Location = new System.Drawing.Point(203, 21); + this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(189, 60); + this.button2.TabIndex = 2; + this.button2.Text = "Factura ingreso autotransporte nacional con impuestos"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 - Factura ingreso autotransporte extranjero + // + this.button3.Location = new System.Drawing.Point(401, 21); + this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(189, 60); + this.button3.TabIndex = 3; + this.button3.Text = "Factura ingreso autotransporte extranjero"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 - Factura ingreso autotransporte internacional aduanero + // + this.button4.Location = new System.Drawing.Point(599, 21); + this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(189, 60); + this.button4.TabIndex = 4; + this.button4.Text = "Factura ingreso autotransporte internacional aduanero"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button5 - Factura ingreso transporte ferroviario nacional + // + this.button5.Location = new System.Drawing.Point(797, 21); + this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(189, 60); + this.button5.TabIndex = 5; + this.button5.Text = "Factura ingreso transporte ferroviario nacional"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 - Factura ingreso transporte ferroviario extranjero + // + this.button6.Location = new System.Drawing.Point(5, 89); + this.button6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(189, 60); + this.button6.TabIndex = 6; + this.button6.Text = "Factura ingreso transporte ferroviario extranjero"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // button7 - Factura ingreso transporte ferroviario internacional aduanero + // + this.button7.Location = new System.Drawing.Point(203, 89); + this.button7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(189, 60); + this.button7.TabIndex = 7; + this.button7.Text = "Factura ingresdo transporte ferrovirario internacional aduanero"; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // button8 - Factura ingreso transporte aereo nacional + // + this.button8.Location = new System.Drawing.Point(401, 89); + this.button8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(189, 60); + this.button8.TabIndex = 8; + this.button8.Text = "Factura ingreso transporte aereo nacional"; + this.button8.UseVisualStyleBackColor = true; + this.button8.Click += new System.EventHandler(this.button8_Click); + // + // button9 - Factura ingreso transporte aereo extranjero + // + this.button9.Location = new System.Drawing.Point(599, 89); + this.button9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(189, 60); + this.button9.TabIndex = 9; + this.button9.Text = "Factura ingreso transporte aereo extranjero"; + this.button9.UseVisualStyleBackColor = true; + this.button9.Click += new System.EventHandler(this.button9_Click); + // + // button10 - Factura ingreso transporte aereo internacional aduanero + // + this.button10.Location = new System.Drawing.Point(797, 89); + this.button10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(189, 60); + this.button10.TabIndex = 10; + this.button10.Text = "Factura ingreso transporte aereo internacional aduanero"; + this.button10.UseVisualStyleBackColor = true; + this.button10.Click += new System.EventHandler(this.button10_Click); + // + // button11 - Factura ingreso transporte maritimo nacional + // + this.button11.Location = new System.Drawing.Point(5, 157); + this.button11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(189, 60); + this.button11.TabIndex = 11; + this.button11.Text = "Factura ingreso transporte maritimo nacional"; + this.button11.UseVisualStyleBackColor = true; + this.button11.Click += new System.EventHandler(this.button11_Click); + // + // button12 - Factura ingreso transporte maritimo extranjero + // + this.button12.Location = new System.Drawing.Point(203, 157); + this.button12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(189, 60); + this.button12.TabIndex = 12; + this.button12.Text = "Factura ingreso transporte maritimo extranjero"; + this.button12.UseVisualStyleBackColor = true; + this.button12.Click += new System.EventHandler(this.button12_Click); + // + // button13 - Factura ingreso transporte maritimo internacional aduanero + // + this.button13.Location = new System.Drawing.Point(401, 157); + this.button13.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(189, 60); + this.button13.TabIndex = 13; + this.button13.Text = "Factura ingreso transporte maritimo internacional aduanero"; + this.button13.UseVisualStyleBackColor = true; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // button14 - Factura traslado autotransporte nacional + // + this.button14.Location = new System.Drawing.Point(599, 157); + this.button14.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(189, 60); + this.button14.TabIndex = 14; + this.button14.Text = "Factura traslado autotransporte nacional"; + this.button14.UseVisualStyleBackColor = true; + this.button14.Click += new System.EventHandler(this.button14_Click); + // + // button15 - Factura traslado autotransporte extranjero + // + this.button15.Location = new System.Drawing.Point(797, 157); + this.button15.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(189, 60); + this.button15.TabIndex = 15; + this.button15.Text = "Factura traslado autotransporte extranjero"; + this.button15.UseVisualStyleBackColor = true; + this.button15.Click += new System.EventHandler(this.button15_Click); + // + // button16 - Factura traslado autotransporte internacional aduanero + // + this.button16.Location = new System.Drawing.Point(5, 225); + this.button16.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(189, 60); + this.button16.TabIndex = 16; + this.button16.Text = "Factura traslado autotransporte internacional aduanero"; + this.button16.UseVisualStyleBackColor = true; + this.button16.Click += new System.EventHandler(this.button16_Click); + // + // button17 - Factura traslado transporte ferroviario nacional + // + this.button17.Location = new System.Drawing.Point(203, 225); + this.button17.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(189, 60); + this.button17.TabIndex = 17; + this.button17.Text = "Factura traslado transporte ferroviario nacional"; + this.button17.UseVisualStyleBackColor = true; + this.button17.Click += new System.EventHandler(this.button17_Click); + // + // button18 - Factura traslado transporte ferroviario extranjero + // + this.button18.Location = new System.Drawing.Point(401, 225); + this.button18.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button18.Name = "button18"; + this.button18.Size = new System.Drawing.Size(189, 60); + this.button18.TabIndex = 18; + this.button18.Text = "Factura traslado transporte ferroviario extranjero"; + this.button18.UseVisualStyleBackColor = true; + this.button18.Click += new System.EventHandler(this.button18_Click); + // + // button19 - Factura traslado transporte ferroviario internacional aduanero + // + this.button19.Location = new System.Drawing.Point(599, 225); + this.button19.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button19.Name = "button19"; + this.button19.Size = new System.Drawing.Size(189, 60); + this.button19.TabIndex = 19; + this.button19.Text = "Factura traslado transporte ferroviario inernacional aduanero"; + this.button19.UseVisualStyleBackColor = true; + this.button19.Click += new System.EventHandler(this.button19_Click); + // + // button20 - Factura traslado transporte aereo nacional + // + this.button20.Location = new System.Drawing.Point(797, 225); + this.button20.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button20.Name = "button20"; + this.button20.Size = new System.Drawing.Size(189, 60); + this.button20.TabIndex = 20; + this.button20.Text = "Factura traslado transporte aereo nacional"; + this.button20.UseVisualStyleBackColor = true; + this.button20.Click += new System.EventHandler(this.button20_Click); + // + // button21 - Factura traslado transporte aereo extranjero + // + this.button21.Location = new System.Drawing.Point(5, 293); + this.button21.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button21.Name = "button21"; + this.button21.Size = new System.Drawing.Size(189, 60); + this.button21.TabIndex = 21; + this.button21.Text = "Factura traslado transporte aereo extranjero"; + this.button21.UseVisualStyleBackColor = true; + this.button21.Click += new System.EventHandler(this.button21_Click); + // + // button22 - Factura traslado transporte aereo internacional aduanero + // + this.button22.Location = new System.Drawing.Point(203, 293); + this.button22.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button22.Name = "button22"; + this.button22.Size = new System.Drawing.Size(189, 60); + this.button22.TabIndex = 22; + this.button22.Text = "Factura traslado transporte aereo internacional aduanero"; + this.button22.UseVisualStyleBackColor = true; + this.button22.Click += new System.EventHandler(this.button22_Click); + // + // button23 - Factura traslado transporte maritimo nacional + // + this.button23.Location = new System.Drawing.Point(401, 293); + this.button23.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button23.Name = "button23"; + this.button23.Size = new System.Drawing.Size(189, 60); + this.button23.TabIndex = 23; + this.button23.Text = "Factura traslado transporte maritimo nacional"; + this.button23.UseVisualStyleBackColor = true; + this.button23.Click += new System.EventHandler(this.button23_Click); + // + // button24 - Factura traslado transporte maritimo extranjero + // + this.button24.Location = new System.Drawing.Point(599, 293); + this.button24.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button24.Name = "button24"; + this.button24.Size = new System.Drawing.Size(189, 60); + this.button24.TabIndex = 24; + this.button24.Text = "Factura traslado transporte maritimo extranjero"; + this.button24.UseVisualStyleBackColor = true; + this.button24.Click += new System.EventHandler(this.button24_Click); + // + // button25 - Factura traslado transporte maritimo internacional aduanero + // + this.button25.Location = new System.Drawing.Point(797, 293); + this.button25.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button25.Name = "button25"; + this.button25.Size = new System.Drawing.Size(189, 60); + this.button25.TabIndex = 25; + this.button25.Text = "Factura traslado transporte maritimo internacional aduanero"; + this.button25.UseVisualStyleBackColor = true; + this.button25.Click += new System.EventHandler(this.button25_Click); + // + // BillOfLadingReferenceForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1019, 454); + this.Controls.Add(this.groupBox1); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Name = "BillOfLadingReferenceForm"; + this.Text = "BillOfLadingReferenceForm"; + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button button13; + private System.Windows.Forms.Button button14; + private System.Windows.Forms.Button button15; + private System.Windows.Forms.Button button16; + private System.Windows.Forms.Button button17; + private System.Windows.Forms.Button button18; + private System.Windows.Forms.Button button19; + private System.Windows.Forms.Button button20; + private System.Windows.Forms.Button button21; + private System.Windows.Forms.Button button22; + private System.Windows.Forms.Button button23; + private System.Windows.Forms.Button button24; + private System.Windows.Forms.Button button25; + } +} \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs new file mode 100644 index 0000000..c5a8347 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs @@ -0,0 +1,3029 @@ +using Fiscalapi.Common; +using Fiscalapi.Models; +using Fiscalapi.Models.BillOfLading; +using Fiscalapi.Services; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiscalApi.Samples.NetFramework +{ + public partial class BillOfLadingReferenceForm : Form + { + private FiscalapiSettings _settings; + public BillOfLadingReferenceForm(FiscalapiSettings settings) + { + InitializeComponent(); + _settings = settings; + } + + private string _certEscuelaKemper = "MIIFsDCCA5igAwIBAgIUMzAwMDEwMDAwMDA1MDAwMDM0MTYwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWxpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQUNBTjERMA8GA1UELRMIMi41LjQuNDUxJTAjBgkqhkiG9w0BCQITFnJlc3BvbnNhYmxlOiBBQ0RNQS1TQVQwHhcNMjMwNTE4MTE0MzUxWhcNMjcwNTE4MTE0MzUxWjCB1zEnMCUGA1UEAxMeRVNDVUVMQSBLRU1QRVIgVVJHQVRFIFNBIERFIENWMScwJQYDVQQpEx5FU0NVRUxBIEtFTVBFUiBVUkdBVEUgU0EgREUgQ1YxJzAlBgNVBAoTHkVTQ1VFTEEgS0VNUEVSIFVSR0FURSBTQSBERSBDVjElMCMGA1UELRMcRUtVOTAwMzE3M0M5IC8gVkFEQTgwMDkyN0RKMzEeMBwGA1UEBRMVIC8gVkFEQTgwMDkyN0hTUlNSTDA1MRMwEQYDVQQLEwpTdWN1cnNhbCAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmecO6n2GS0zL025gbHGQVxznPDICoXzR2uUngz4DqxVUC/w9cE6FxSiXm2ap8Gcjg7wmcZfm85EBaxCx/0J2u5CqnhzIoGCdhBPuhWQnIh5TLgj/X6uNquwZkKChbNe9aeFirU/JbyN7Egia9oKH9KZUsodiM/pWAH00PCtoKJ9OBcSHMq8Rqa3KKoBcfkg1ZrgueffwRLws9yOcRWLb02sDOPzGIm/jEFicVYt2Hw1qdRE5xmTZ7AGG0UHs+unkGjpCVeJ+BEBn0JPLWVvDKHZAQMj6s5Bku35+d/MyATkpOPsGT/VTnsouxekDfikJD1f7A1ZpJbqDpkJnss3vQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAFaUgj5PqgvJigNMgtrdXZnbPfVBbukAbW4OGnUhNrA7SRAAfv2BSGk16PI0nBOr7qF2mItmBnjgEwk+DTv8Zr7w5qp7vleC6dIsZFNJoa6ZndrE/f7KO1CYruLXr5gwEkIyGfJ9NwyIagvHHMszzyHiSZIA850fWtbqtythpAliJ2jF35M5pNS+YTkRB+T6L/c6m00ymN3q9lT1rB03YywxrLreRSFZOSrbwWfg34EJbHfbFXpCSVYdJRfiVdvHnewN0r5fUlPtR9stQHyuqewzdkyb5jTTw02D2cUfL57vlPStBj7SEi3uOWvLrsiDnnCIxRMYJ2UA2ktDKHk+zWnsDmaeleSzonv2CHW42yXYPCvWi88oE1DJNYLNkIjua7MxAnkNZbScNw01A6zbLsZ3y8G6eEYnxSTRfwjd8EP4kdiHNJftm7Z4iRU7HOVh79/lRWB+gd171s3d/mI9kte3MRy6V8MMEMCAnMboGpaooYwgAmwclI2XZCczNWXfhaWe0ZS5PmytD/GDpXzkX0oEgY9K/uYo5V77NdZbGAjmyi8cE2B2ogvyaN2XfIInrZPgEffJ4AB7kFA2mwesdLOCh0BLD9itmCve3A1FGR4+stO2ANUoiI3w3Tv2yQSg4bjeDlJ08lXaaFCLW2peEXMXjQUk7fmpb5MNuOUTW6BE="; + private string _keyEscuelaKemper = "MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS/AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucoZQObOaLUEm+I+QZ7Y8Giupo+F1XWkLvAsdk/uZlJcTfKLJyJbJwsQYbSpLOCLataZ4O5MVnnmMbfG//NKJn9kSMvJQZhSwAwoGLYDm1ESGezrvZabgFJnoQv8Si1nAhVGTk9FkFBesxRzq07dmZYwFCnFSX4xt2fDHs1PMpQbeq83aL/PzLCce3kxbYSB5kQlzGtUYayiYXcu0cVRu228VwBLCD+2wTDDoCmRXtPesgrLKUR4WWWb5N2AqAU1mNDC+UEYsENAerOFXWnmwrcTAu5qyZ7GsBMTpipW4Dbou2yqQ0lpA/aB06n1kz1aL6mNqGPaJ+OqoFuc8Ugdhadd+MmjHfFzoI20SZ3b2geCsUMNCsAd6oXMsZdWm8lzjqCGWHFeol0ik/xHMQvuQkkeCsQ28PBxdnUgf7ZGer+TN+2ZLd2kvTBOk6pIVgy5yC6cZ+o1Tloql9hYGa6rT3xcMbXlW+9e5jM2MWXZliVW3ZhaPjptJFDbIfWxJPjz4QvKyJk0zok4muv13Iiwj2bCyefUTRz6psqI4cGaYm9JpscKO2RCJN8UluYGbbWmYQU+Int6LtZj/lv8p6xnVjWxYI+rBPdtkpfFYRp+MJiXjgPw5B6UGuoruv7+vHjOLHOotRo+RdjZt7NqL9dAJnl1Qb2jfW6+d7NYQSI/bAwxO0sk4taQIT6Gsu/8kfZOPC2xk9rphGqCSS/4q3Os0MMjA1bcJLyoWLp13pqhK6bmiiHw0BBXH4fbEp4xjSbpPx4tHXzbdn8oDsHKZkWh3pPC2J/nVl0k/yF1KDVowVtMDXE47k6TGVcBoqe8PDXCG9+vjRpzIidqNo5qebaUZu6riWMWzldz8x3Z/jLWXuDiM7/Yscn0Z2GIlfoeyz+GwP2eTdOw9EUedHjEQuJY32bq8LICimJ4Ht+zMJKUyhwVQyAER8byzQBwTYmYP5U0wdsyIFitphw+/IH8+v08Ia1iBLPQAeAvRfTTIFLCs8foyUrj5Zv2B/wTYIZy6ioUM+qADeXyo45uBLLqkN90Rf6kiTqDld78NxwsfyR5MxtJLVDFkmf2IMMJHTqSfhbi+7QJaC11OOUJTD0v9wo0X/oO5GvZhe0ZaGHnm9zqTopALuFEAxcaQlc4R81wjC4wrIrqWnbcl2dxiBtD73KW+wcC9ymsLf4I8BEmiN25lx/OUc1IHNyXZJYSFkEfaxCEZWKcnbiyf5sqFSSlEqZLc4lUPJFAoP6s1FHVcyO0odWqdadhRZLZC9RCzQgPlMRtji/OXy5phh7diOBZv5UYp5nb+MZ2NAB/eFXm2JLguxjvEstuvTDmZDUb6Uqv++RdhO5gvKf/AcwU38ifaHQ9uvRuDocYwVxZS2nr9rOwZ8nAh+P2o4e0tEXjxFKQGhxXYkn75H3hhfnFYjik/2qunHBBZfcdG148MaNP6DjX33M238T9Zw/GyGx00JMogr2pdP4JAErv9a5yt4YR41KGf8guSOUbOXVARw6+ybh7+meb7w4BeTlj3aZkv8tVGdfIt3lrwVnlbzhLjeQY6PplKp3/a5Kr5yM0T4wJoKQQ6v3vSNmrhpbuAtKxpMILe8CQoo="; + + private List CreateTaxCredentials() + { + return new List + { + new TaxCredential + { + Base64File = _certEscuelaKemper, + FileType = FileType.CertificateCsd, + Password = "12345678a" + }, + new TaxCredential + { + Base64File = _keyEscuelaKemper, + FileType = FileType.PrivateKeyCsd, + Password = "12345678a" + } + }; + } + + private InvoiceIssuer CreateIssuer() + { + return new InvoiceIssuer { Id = "0e82a655-5f0c-4e07-abab-8f322e4123ef" }; + } + + private Autotransporte CreateAutotransporte() + { + return new Autotransporte + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + ConfigVehicularId = "VL", + PesoBrutoVehicular = 1, + PlacaVM = "plac892", + AnioModeloVM = 2020, + AseguraRespCivil = "AseguraRespCivil", + PolizaRespCivil = "123456789", + Remolques = new List + { + new Remolque { SubTipoRemId = "CTR004", Placa = "VL45K98" } + } + }; + } + + private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) + { + var mercancia = new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + }; + + if (includeDocumentacionAduanera) + { + mercancia.TipoMateriaId = "05"; + mercancia.DescripcionMateria = "otramateria"; + mercancia.DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }; + } + + return mercancia; + } + + private Invoice CreateBaseInvoice(string taxObjectCode = "01", List itemTaxes = null) + { + return new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "01", + PaymentMethodCode = "PUE", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "SerieCCP31", + Date = DateTime.Now, + ExchangeRate = 1, + ExportCode = "01", + Issuer = CreateIssuer(), + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", + ItemSku = "UT421511", + Quantity = 1, + UnitOfMeasurementCode = "H87", + Description = "Transporte de carga por carretera", + UnitPrice = 100.00m, + Discount = 0, + TaxObjectCode = taxObjectCode, + ItemTaxes = itemTaxes ?? new List() + } + } + }; + } + + // button1: Factura ingreso autotransporte nacional + private async void button1_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1.0m, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List { CreateMercancia() }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "URE180429TM6", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button2: Factura ingreso autotransporte nacional con impuestos + private async void button2_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var itemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.040000m, TaxFlagCode = "R" } + }; + + var invoice = CreateBaseInvoice("02", itemTaxes); + invoice.Items[0].UnitPrice = 26232.75m; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List { CreateMercancia() }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "URE180429TM6", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button3: Factura ingreso autotransporte extranjero + private async void button3_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button4: Factura ingreso autotransporte internacional aduanero + private async void button4_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List { CreateMercancia(includeDocumentacionAduanera: true) }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button5: Factura ingreso transporte ferroviario nacional + private async void button5_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario() }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button6: Factura ingreso transporte ferroviario extranjero + private async void button6_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + + var ubicaciones = CreateUbicacionesFerroviarioNacional(); + // Replace last destination with a foreign one + ubicaciones[ubicaciones.Count - 1] = new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", + Referencia = "WHITE HOUSE", MunicipioId = "1234", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = ubicaciones, + Mercancias = new List { CreateMercanciaFerroviario(includeTipoMateria: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button7: Factura ingresdo transporte ferrovirario internacional aduanero + private async void button7_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario(includeDocumentacionAduanera: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button8: Factura ingreso transporte aereo nacional + private async void button8_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button9: Factura ingreso transporte aereo extranjero + private async void button9_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button10: Factura ingreso transporte aereo internacional aduanero + private async void button10_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RfcImpo = "EKU9003173C9" } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button11: Factura ingreso transporte maritimo nacional + private async void button11_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button12: Factura ingreso transporte maritimo extranjero + private async void button12_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", + Referencia = "N/A", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button13: Factura ingreso transporte maritimo internacional aduanero + private async void button13_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "CP3.1"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "01", + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" }, + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", + NombreEstacion = "Loreto", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", + NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), + TipoEstacionId = "02", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1.50m, + ValorMercancia = 100, + MonedaId = "MXN", + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020", CvesTransporteId = "02" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "X1A", + PesoBruto = 1.50m, + PesoNeto = 1.00m, + PesoTara = 0.50m + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button14: Factura traslado autotransporte nacional + private async void button14_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button15: Factura traslado autotransporte extranjero + private async void button15_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "SerieCCP31"; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button16: Factura traslado autotransporte internacional aduanero + private async void button16_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "SerieCCP31"; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button17: Factura traslado transporte ferroviario nacional + private async void button17_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario() }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button18: Factura traslado transporte ferroviario extranjero + private async void button18_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + var ubicaciones = CreateUbicacionesFerroviarioNacional(); + // Replace last destination with a foreign one + ubicaciones[ubicaciones.Count - 1] = new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", + Referencia = "WHITE HOUSE", MunicipioId = "1234", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = ubicaciones, + Mercancias = new List { CreateMercanciaFerroviario(includeTipoMateria: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button19: Factura traslado transporte ferroviario inernacional aduanero + private async void button19_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario(includeDocumentacionAduanera: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button20: Factura traslado transporte aereo nacional + private async void button20_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button21: Factura traslado transporte aereo extranjero + private async void button21_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button22: Factura traslado transporte aereo internacional aduanero + private async void button22_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button23: Factura traslado transporte maritimo nacional + private async void button23_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button24: Factura traslado transporte maritimo extranjero + private async void button24_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", + Referencia = "N/A", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button25: Factura traslado transporte maritimo internacional aduanero + private async void button25_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" }, + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + private TransporteFerroviario CreateTransporteFerroviario() + { + return new TransporteFerroviario + { + TipoDeServicioId = "TS01", + TipoDeTraficoId = "TT01", + DerechosDePaso = new List + { + new DerechoDePaso { TipoDerechoDePasoId = "CDP114", KilometrajePagado = 100 } + }, + Carros = new List + { + new Carro + { + TipoCarroId = "TC08", + MatriculaCarro = "A00012", + GuiaCarro = "123ASD", + ToneladasNetasCarro = 10 + } + } + }; + } + + private TipoFigura CreateTipoFiguraFerroviario() + { + return new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + }; + } + + private List CreateUbicacionesFerroviarioNacional() + { + return new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202021", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "SC283", NombreEstacion = "HUAXTITLA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T01:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202022", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "TG0", NombreEstacion = "NAVOJOA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T02:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202023", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "E0029", NombreEstacion = "TRES JAGUEYES", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T03:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202024", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "TI032", NombreEstacion = "NAVOLATO", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + TipoEstacionId = "03", DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }; + } + + private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bool includeDocumentacionAduanera = false) + { + var m = new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202025" } + } + }; + + if (includeTipoMateria || includeDocumentacionAduanera) + { + m.TipoMateriaId = "05"; + m.DescripcionMateria = "otramateria"; + } + + if (includeDocumentacionAduanera) + { + m.DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }; + } + + return m; + } + + private Invoice CreateBaseInvoiceFerroviario() + { + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; + return invoice; + } + + private Invoice CreateBaseTraslado() + { + return new Invoice + { + VersionCode = "4.0", + CurrencyCode = "XXX", + TypeCode = "T", + ExpeditionZipCode = "42501", + PaymentMethodCode = "", + Date = DateTime.Now, + ExchangeRate = 1, + ExportCode = "01", + Issuer = CreateIssuer(), + Recipient = new InvoiceRecipient { Id = "0e82a655-5f0c-4e07-abab-8f322e4123ef" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", + ItemSku = "UT421511", + Quantity = 1, + UnitOfMeasurementCode = "H87", + Description = "Transporte de carga por carretera", + UnitPrice = 100.00m, + Discount = 0, + TaxObjectCode = "01", + ItemTaxes = new List() + } + } + }; + } + } +} diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs new file mode 100644 index 0000000..1d7a34d --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs @@ -0,0 +1,416 @@ +namespace FiscalApi.Samples.NetFramework +{ + partial class BillOfLadingValueForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.button7 = new System.Windows.Forms.Button(); + this.button8 = new System.Windows.Forms.Button(); + this.button9 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.button12 = new System.Windows.Forms.Button(); + this.button13 = new System.Windows.Forms.Button(); + this.button14 = new System.Windows.Forms.Button(); + this.button15 = new System.Windows.Forms.Button(); + this.button16 = new System.Windows.Forms.Button(); + this.button17 = new System.Windows.Forms.Button(); + this.button18 = new System.Windows.Forms.Button(); + this.button19 = new System.Windows.Forms.Button(); + this.button20 = new System.Windows.Forms.Button(); + this.button21 = new System.Windows.Forms.Button(); + this.button22 = new System.Windows.Forms.Button(); + this.button23 = new System.Windows.Forms.Button(); + this.button24 = new System.Windows.Forms.Button(); + this.button25 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Controls.Add(this.button2); + this.groupBox1.Controls.Add(this.button3); + this.groupBox1.Controls.Add(this.button4); + this.groupBox1.Controls.Add(this.button5); + this.groupBox1.Controls.Add(this.button6); + this.groupBox1.Controls.Add(this.button7); + this.groupBox1.Controls.Add(this.button8); + this.groupBox1.Controls.Add(this.button9); + this.groupBox1.Controls.Add(this.button10); + this.groupBox1.Controls.Add(this.button11); + this.groupBox1.Controls.Add(this.button12); + this.groupBox1.Controls.Add(this.button13); + this.groupBox1.Controls.Add(this.button14); + this.groupBox1.Controls.Add(this.button15); + this.groupBox1.Controls.Add(this.button16); + this.groupBox1.Controls.Add(this.button17); + this.groupBox1.Controls.Add(this.button18); + this.groupBox1.Controls.Add(this.button19); + this.groupBox1.Controls.Add(this.button20); + this.groupBox1.Controls.Add(this.button21); + this.groupBox1.Controls.Add(this.button22); + this.groupBox1.Controls.Add(this.button23); + this.groupBox1.Controls.Add(this.button24); + this.groupBox1.Controls.Add(this.button25); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Size = new System.Drawing.Size(995, 430); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Carta Porte"; + // + // button1 - Factura ingreso autotransporte nacional + // + this.button1.Location = new System.Drawing.Point(5, 21); + this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(189, 60); + this.button1.TabIndex = 1; + this.button1.Text = "Factura ingreso autotransporte nacional"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 - Factura ingreso autotransporte nacional con impuestos + // + this.button2.Location = new System.Drawing.Point(203, 21); + this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(189, 60); + this.button2.TabIndex = 2; + this.button2.Text = "Factura ingreso autotransporte nacional con impuestos"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 - Factura ingreso autotransporte extranjero + // + this.button3.Location = new System.Drawing.Point(401, 21); + this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(189, 60); + this.button3.TabIndex = 3; + this.button3.Text = "Factura ingreso autotransporte extranjero"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // button4 - Factura ingreso autotransporte internacional aduanero + // + this.button4.Location = new System.Drawing.Point(599, 21); + this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(189, 60); + this.button4.TabIndex = 4; + this.button4.Text = "Factura ingreso autotransporte internacional aduanero"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button5 - Factura ingreso transporte ferroviario nacional + // + this.button5.Location = new System.Drawing.Point(797, 21); + this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(189, 60); + this.button5.TabIndex = 5; + this.button5.Text = "Factura ingreso transporte ferroviario nacional"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 - Factura ingreso transporte ferroviario extranjero + // + this.button6.Location = new System.Drawing.Point(5, 89); + this.button6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(189, 60); + this.button6.TabIndex = 6; + this.button6.Text = "Factura ingreso transporte ferroviario extranjero"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click); + // + // button7 - Factura ingreso transporte ferroviario internacional aduanero + // + this.button7.Location = new System.Drawing.Point(203, 89); + this.button7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button7.Name = "button7"; + this.button7.Size = new System.Drawing.Size(189, 60); + this.button7.TabIndex = 7; + this.button7.Text = "Factura ingresdo transporte ferrovirario internacional aduanero"; + this.button7.UseVisualStyleBackColor = true; + this.button7.Click += new System.EventHandler(this.button7_Click); + // + // button8 - Factura ingreso transporte aereo nacional + // + this.button8.Location = new System.Drawing.Point(401, 89); + this.button8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button8.Name = "button8"; + this.button8.Size = new System.Drawing.Size(189, 60); + this.button8.TabIndex = 8; + this.button8.Text = "Factura ingreso transporte aereo nacional"; + this.button8.UseVisualStyleBackColor = true; + this.button8.Click += new System.EventHandler(this.button8_Click); + // + // button9 - Factura ingreso transporte aereo extranjero + // + this.button9.Location = new System.Drawing.Point(599, 89); + this.button9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(189, 60); + this.button9.TabIndex = 9; + this.button9.Text = "Factura ingreso transporte aereo extranjero"; + this.button9.UseVisualStyleBackColor = true; + this.button9.Click += new System.EventHandler(this.button9_Click); + // + // button10 - Factura ingreso transporte aereo internacional aduanero + // + this.button10.Location = new System.Drawing.Point(797, 89); + this.button10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(189, 60); + this.button10.TabIndex = 10; + this.button10.Text = "Factura ingreso transporte aereo internacional aduanero"; + this.button10.UseVisualStyleBackColor = true; + this.button10.Click += new System.EventHandler(this.button10_Click); + // + // button11 - Factura ingreso transporte maritimo nacional + // + this.button11.Location = new System.Drawing.Point(5, 157); + this.button11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(189, 60); + this.button11.TabIndex = 11; + this.button11.Text = "Factura ingreso transporte maritimo nacional"; + this.button11.UseVisualStyleBackColor = true; + this.button11.Click += new System.EventHandler(this.button11_Click); + // + // button12 - Factura ingreso transporte maritimo extranjero + // + this.button12.Location = new System.Drawing.Point(203, 157); + this.button12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(189, 60); + this.button12.TabIndex = 12; + this.button12.Text = "Factura ingreso transporte maritimo extranjero"; + this.button12.UseVisualStyleBackColor = true; + this.button12.Click += new System.EventHandler(this.button12_Click); + // + // button13 - Factura ingreso transporte maritimo internacional aduanero + // + this.button13.Location = new System.Drawing.Point(401, 157); + this.button13.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(189, 60); + this.button13.TabIndex = 13; + this.button13.Text = "Factura ingreso transporte maritimo internacional aduanero"; + this.button13.UseVisualStyleBackColor = true; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // button14 - Factura traslado autotransporte nacional + // + this.button14.Location = new System.Drawing.Point(599, 157); + this.button14.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(189, 60); + this.button14.TabIndex = 14; + this.button14.Text = "Factura traslado autotransporte nacional"; + this.button14.UseVisualStyleBackColor = true; + this.button14.Click += new System.EventHandler(this.button14_Click); + // + // button15 - Factura traslado autotransporte extranjero + // + this.button15.Location = new System.Drawing.Point(797, 157); + this.button15.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(189, 60); + this.button15.TabIndex = 15; + this.button15.Text = "Factura traslado autotransporte extranjero"; + this.button15.UseVisualStyleBackColor = true; + this.button15.Click += new System.EventHandler(this.button15_Click); + // + // button16 - Factura traslado autotransporte internacional aduanero + // + this.button16.Location = new System.Drawing.Point(5, 225); + this.button16.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(189, 60); + this.button16.TabIndex = 16; + this.button16.Text = "Factura traslado autotransporte internacional aduanero"; + this.button16.UseVisualStyleBackColor = true; + this.button16.Click += new System.EventHandler(this.button16_Click); + // + // button17 - Factura traslado transporte ferroviario nacional + // + this.button17.Location = new System.Drawing.Point(203, 225); + this.button17.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(189, 60); + this.button17.TabIndex = 17; + this.button17.Text = "Factura traslado transporte ferroviario nacional"; + this.button17.UseVisualStyleBackColor = true; + this.button17.Click += new System.EventHandler(this.button17_Click); + // + // button18 - Factura traslado transporte ferroviario extranjero + // + this.button18.Location = new System.Drawing.Point(401, 225); + this.button18.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button18.Name = "button18"; + this.button18.Size = new System.Drawing.Size(189, 60); + this.button18.TabIndex = 18; + this.button18.Text = "Factura traslado transporte ferroviario extranjero"; + this.button18.UseVisualStyleBackColor = true; + this.button18.Click += new System.EventHandler(this.button18_Click); + // + // button19 - Factura traslado transporte ferroviario internacional aduanero + // + this.button19.Location = new System.Drawing.Point(599, 225); + this.button19.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button19.Name = "button19"; + this.button19.Size = new System.Drawing.Size(189, 60); + this.button19.TabIndex = 19; + this.button19.Text = "Factura traslado transporte ferroviario inernacional aduanero"; + this.button19.UseVisualStyleBackColor = true; + this.button19.Click += new System.EventHandler(this.button19_Click); + // + // button20 - Factura traslado transporte aereo nacional + // + this.button20.Location = new System.Drawing.Point(797, 225); + this.button20.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button20.Name = "button20"; + this.button20.Size = new System.Drawing.Size(189, 60); + this.button20.TabIndex = 20; + this.button20.Text = "Factura traslado transporte aereo nacional"; + this.button20.UseVisualStyleBackColor = true; + this.button20.Click += new System.EventHandler(this.button20_Click); + // + // button21 - Factura traslado transporte aereo extranjero + // + this.button21.Location = new System.Drawing.Point(5, 293); + this.button21.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button21.Name = "button21"; + this.button21.Size = new System.Drawing.Size(189, 60); + this.button21.TabIndex = 21; + this.button21.Text = "Factura traslado transporte aereo extranjero"; + this.button21.UseVisualStyleBackColor = true; + this.button21.Click += new System.EventHandler(this.button21_Click); + // + // button22 - Factura traslado transporte aereo internacional aduanero + // + this.button22.Location = new System.Drawing.Point(203, 293); + this.button22.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button22.Name = "button22"; + this.button22.Size = new System.Drawing.Size(189, 60); + this.button22.TabIndex = 22; + this.button22.Text = "Factura traslado transporte aereo internacional aduanero"; + this.button22.UseVisualStyleBackColor = true; + this.button22.Click += new System.EventHandler(this.button22_Click); + // + // button23 - Factura traslado transporte maritimo nacional + // + this.button23.Location = new System.Drawing.Point(401, 293); + this.button23.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button23.Name = "button23"; + this.button23.Size = new System.Drawing.Size(189, 60); + this.button23.TabIndex = 23; + this.button23.Text = "Factura traslado transporte maritimo nacional"; + this.button23.UseVisualStyleBackColor = true; + this.button23.Click += new System.EventHandler(this.button23_Click); + // + // button24 - Factura traslado transporte maritimo extranjero + // + this.button24.Location = new System.Drawing.Point(599, 293); + this.button24.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button24.Name = "button24"; + this.button24.Size = new System.Drawing.Size(189, 60); + this.button24.TabIndex = 24; + this.button24.Text = "Factura traslado transporte maritimo extranjero"; + this.button24.UseVisualStyleBackColor = true; + this.button24.Click += new System.EventHandler(this.button24_Click); + // + // button25 - Factura traslado transporte maritimo internacional aduanero + // + this.button25.Location = new System.Drawing.Point(797, 293); + this.button25.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button25.Name = "button25"; + this.button25.Size = new System.Drawing.Size(189, 60); + this.button25.TabIndex = 25; + this.button25.Text = "Factura traslado transporte maritimo internacional aduanero"; + this.button25.UseVisualStyleBackColor = true; + this.button25.Click += new System.EventHandler(this.button25_Click); + // + // BillOfLadingValueForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1019, 454); + this.Controls.Add(this.groupBox1); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Name = "BillOfLadingValueForm"; + this.Text = "BillOfLadingValueForm"; + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.Button button7; + private System.Windows.Forms.Button button8; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.Button button12; + private System.Windows.Forms.Button button13; + private System.Windows.Forms.Button button14; + private System.Windows.Forms.Button button15; + private System.Windows.Forms.Button button16; + private System.Windows.Forms.Button button17; + private System.Windows.Forms.Button button18; + private System.Windows.Forms.Button button19; + private System.Windows.Forms.Button button20; + private System.Windows.Forms.Button button21; + private System.Windows.Forms.Button button22; + private System.Windows.Forms.Button button23; + private System.Windows.Forms.Button button24; + private System.Windows.Forms.Button button25; + } +} \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs new file mode 100644 index 0000000..2ac7c1b --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs @@ -0,0 +1,3119 @@ +using Fiscalapi.Common; +using Fiscalapi.Models; +using Fiscalapi.Models.BillOfLading; +using Fiscalapi.Services; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FiscalApi.Samples.NetFramework +{ + public partial class BillOfLadingValueForm : Form + { + private FiscalapiSettings _settings; + public BillOfLadingValueForm(FiscalapiSettings settings) + { + InitializeComponent(); + _settings = settings; + } + + private string _certEscuelaKemper = "MIIFsDCCA5igAwIBAgIUMzAwMDEwMDAwMDA1MDAwMDM0MTYwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWxpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQUNBTjERMA8GA1UELRMIMi41LjQuNDUxJTAjBgkqhkiG9w0BCQITFnJlc3BvbnNhYmxlOiBBQ0RNQS1TQVQwHhcNMjMwNTE4MTE0MzUxWhcNMjcwNTE4MTE0MzUxWjCB1zEnMCUGA1UEAxMeRVNDVUVMQSBLRU1QRVIgVVJHQVRFIFNBIERFIENWMScwJQYDVQQpEx5FU0NVRUxBIEtFTVBFUiBVUkdBVEUgU0EgREUgQ1YxJzAlBgNVBAoTHkVTQ1VFTEEgS0VNUEVSIFVSR0FURSBTQSBERSBDVjElMCMGA1UELRMcRUtVOTAwMzE3M0M5IC8gVkFEQTgwMDkyN0RKMzEeMBwGA1UEBRMVIC8gVkFEQTgwMDkyN0hTUlNSTDA1MRMwEQYDVQQLEwpTdWN1cnNhbCAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmecO6n2GS0zL025gbHGQVxznPDICoXzR2uUngz4DqxVUC/w9cE6FxSiXm2ap8Gcjg7wmcZfm85EBaxCx/0J2u5CqnhzIoGCdhBPuhWQnIh5TLgj/X6uNquwZkKChbNe9aeFirU/JbyN7Egia9oKH9KZUsodiM/pWAH00PCtoKJ9OBcSHMq8Rqa3KKoBcfkg1ZrgueffwRLws9yOcRWLb02sDOPzGIm/jEFicVYt2Hw1qdRE5xmTZ7AGG0UHs+unkGjpCVeJ+BEBn0JPLWVvDKHZAQMj6s5Bku35+d/MyATkpOPsGT/VTnsouxekDfikJD1f7A1ZpJbqDpkJnss3vQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAFaUgj5PqgvJigNMgtrdXZnbPfVBbukAbW4OGnUhNrA7SRAAfv2BSGk16PI0nBOr7qF2mItmBnjgEwk+DTv8Zr7w5qp7vleC6dIsZFNJoa6ZndrE/f7KO1CYruLXr5gwEkIyGfJ9NwyIagvHHMszzyHiSZIA850fWtbqtythpAliJ2jF35M5pNS+YTkRB+T6L/c6m00ymN3q9lT1rB03YywxrLreRSFZOSrbwWfg34EJbHfbFXpCSVYdJRfiVdvHnewN0r5fUlPtR9stQHyuqewzdkyb5jTTw02D2cUfL57vlPStBj7SEi3uOWvLrsiDnnCIxRMYJ2UA2ktDKHk+zWnsDmaeleSzonv2CHW42yXYPCvWi88oE1DJNYLNkIjua7MxAnkNZbScNw01A6zbLsZ3y8G6eEYnxSTRfwjd8EP4kdiHNJftm7Z4iRU7HOVh79/lRWB+gd171s3d/mI9kte3MRy6V8MMEMCAnMboGpaooYwgAmwclI2XZCczNWXfhaWe0ZS5PmytD/GDpXzkX0oEgY9K/uYo5V77NdZbGAjmyi8cE2B2ogvyaN2XfIInrZPgEffJ4AB7kFA2mwesdLOCh0BLD9itmCve3A1FGR4+stO2ANUoiI3w3Tv2yQSg4bjeDlJ08lXaaFCLW2peEXMXjQUk7fmpb5MNuOUTW6BE="; + private string _keyEscuelaKemper = "MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS/AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucoZQObOaLUEm+I+QZ7Y8Giupo+F1XWkLvAsdk/uZlJcTfKLJyJbJwsQYbSpLOCLataZ4O5MVnnmMbfG//NKJn9kSMvJQZhSwAwoGLYDm1ESGezrvZabgFJnoQv8Si1nAhVGTk9FkFBesxRzq07dmZYwFCnFSX4xt2fDHs1PMpQbeq83aL/PzLCce3kxbYSB5kQlzGtUYayiYXcu0cVRu228VwBLCD+2wTDDoCmRXtPesgrLKUR4WWWb5N2AqAU1mNDC+UEYsENAerOFXWnmwrcTAu5qyZ7GsBMTpipW4Dbou2yqQ0lpA/aB06n1kz1aL6mNqGPaJ+OqoFuc8Ugdhadd+MmjHfFzoI20SZ3b2geCsUMNCsAd6oXMsZdWm8lzjqCGWHFeol0ik/xHMQvuQkkeCsQ28PBxdnUgf7ZGer+TN+2ZLd2kvTBOk6pIVgy5yC6cZ+o1Tloql9hYGa6rT3xcMbXlW+9e5jM2MWXZliVW3ZhaPjptJFDbIfWxJPjz4QvKyJk0zok4muv13Iiwj2bCyefUTRz6psqI4cGaYm9JpscKO2RCJN8UluYGbbWmYQU+Int6LtZj/lv8p6xnVjWxYI+rBPdtkpfFYRp+MJiXjgPw5B6UGuoruv7+vHjOLHOotRo+RdjZt7NqL9dAJnl1Qb2jfW6+d7NYQSI/bAwxO0sk4taQIT6Gsu/8kfZOPC2xk9rphGqCSS/4q3Os0MMjA1bcJLyoWLp13pqhK6bmiiHw0BBXH4fbEp4xjSbpPx4tHXzbdn8oDsHKZkWh3pPC2J/nVl0k/yF1KDVowVtMDXE47k6TGVcBoqe8PDXCG9+vjRpzIidqNo5qebaUZu6riWMWzldz8x3Z/jLWXuDiM7/Yscn0Z2GIlfoeyz+GwP2eTdOw9EUedHjEQuJY32bq8LICimJ4Ht+zMJKUyhwVQyAER8byzQBwTYmYP5U0wdsyIFitphw+/IH8+v08Ia1iBLPQAeAvRfTTIFLCs8foyUrj5Zv2B/wTYIZy6ioUM+qADeXyo45uBLLqkN90Rf6kiTqDld78NxwsfyR5MxtJLVDFkmf2IMMJHTqSfhbi+7QJaC11OOUJTD0v9wo0X/oO5GvZhe0ZaGHnm9zqTopALuFEAxcaQlc4R81wjC4wrIrqWnbcl2dxiBtD73KW+wcC9ymsLf4I8BEmiN25lx/OUc1IHNyXZJYSFkEfaxCEZWKcnbiyf5sqFSSlEqZLc4lUPJFAoP6s1FHVcyO0odWqdadhRZLZC9RCzQgPlMRtji/OXy5phh7diOBZv5UYp5nb+MZ2NAB/eFXm2JLguxjvEstuvTDmZDUb6Uqv++RdhO5gvKf/AcwU38ifaHQ9uvRuDocYwVxZS2nr9rOwZ8nAh+P2o4e0tEXjxFKQGhxXYkn75H3hhfnFYjik/2qunHBBZfcdG148MaNP6DjX33M238T9Zw/GyGx00JMogr2pdP4JAErv9a5yt4YR41KGf8guSOUbOXVARw6+ybh7+meb7w4BeTlj3aZkv8tVGdfIt3lrwVnlbzhLjeQY6PplKp3/a5Kr5yM0T4wJoKQQ6v3vSNmrhpbuAtKxpMILe8CQoo="; + + private List CreateTaxCredentials() + { + return new List + { + new TaxCredential + { + Base64File = _certEscuelaKemper, + FileType = FileType.CertificateCsd, + Password = "12345678a" + }, + new TaxCredential + { + Base64File = _keyEscuelaKemper, + FileType = FileType.PrivateKeyCsd, + Password = "12345678a" + } + }; + } + + private InvoiceIssuer CreateIssuer() + { + return new InvoiceIssuer + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + TaxRegimeCode = "601", + TaxCredentials = CreateTaxCredentials() + }; + } + + private Autotransporte CreateAutotransporte() + { + return new Autotransporte + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + ConfigVehicularId = "VL", + PesoBrutoVehicular = 1, + PlacaVM = "plac892", + AnioModeloVM = 2020, + AseguraRespCivil = "AseguraRespCivil", + PolizaRespCivil = "123456789", + Remolques = new List + { + new Remolque { SubTipoRemId = "CTR004", Placa = "VL45K98" } + } + }; + } + + private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) + { + var mercancia = new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + }; + + if (includeDocumentacionAduanera) + { + mercancia.TipoMateriaId = "05"; + mercancia.DescripcionMateria = "otramateria"; + mercancia.DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }; + } + + return mercancia; + } + + private Invoice CreateBaseInvoice(string taxObjectCode = "01", List itemTaxes = null) + { + return new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "01", + PaymentMethodCode = "PUE", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "SerieCCP31", + Date = DateTime.Now, + ExchangeRate = 1, + ExportCode = "01", + Issuer = CreateIssuer(), + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", + ItemSku = "UT421511", + Quantity = 1, + UnitOfMeasurementCode = "H87", + Description = "Transporte de carga por carretera", + UnitPrice = 100.00m, + Discount = 0, + TaxObjectCode = taxObjectCode, + ItemTaxes = itemTaxes ?? new List() + } + } + }; + } + + // button1: Factura ingreso autotransporte nacional + private async void button1_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient + { + Tin = "URE180429TM6", + LegalName = "UNIVERSIDAD ROBOTICA ESPAÑOLA", + ZipCode = "86991", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1.0m, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List { CreateMercancia() }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "URE180429TM6", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button2: Factura ingreso autotransporte nacional con impuestos + private async void button2_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var itemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.040000m, TaxFlagCode = "R" } + }; + + var invoice = CreateBaseInvoice("02", itemTaxes); + invoice.Items[0].UnitPrice = 26232.75m; + invoice.Recipient = new InvoiceRecipient + { + Tin = "URE180429TM6", + LegalName = "UNIVERSIDAD ROBOTICA ESPAÑOLA", + ZipCode = "86991", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "URE180429TM6", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List { CreateMercancia() }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "URE180429TM6", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button3: Factura ingreso autotransporte extranjero + private async void button3_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button4: Factura ingreso autotransporte internacional aduanero + private async void button4_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List { CreateMercancia(includeDocumentacionAduanera: true) }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button5: Factura ingreso transporte ferroviario nacional + private async void button5_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario() }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button6: Factura ingreso transporte ferroviario extranjero + private async void button6_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + + var ubicaciones = CreateUbicacionesFerroviarioNacional(); + // Replace last destination with a foreign one + ubicaciones[ubicaciones.Count - 1] = new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", + Referencia = "WHITE HOUSE", MunicipioId = "1234", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = ubicaciones, + Mercancias = new List { CreateMercanciaFerroviario(includeTipoMateria: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button7: Factura ingresdo transporte ferrovirario internacional aduanero + private async void button7_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoiceFerroviario(); + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario(includeDocumentacionAduanera: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button8: Factura ingreso transporte aereo nacional + private async void button8_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button9: Factura ingreso transporte aereo extranjero + private async void button9_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button10: Factura ingreso transporte aereo internacional aduanero + private async void button10_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RfcImpo = "EKU9003173C9" } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button11: Factura ingreso transporte maritimo nacional + private async void button11_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button12: Factura ingreso transporte maritimo extranjero + private async void button12_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", + Referencia = "N/A", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button13: Factura ingreso transporte maritimo internacional aduanero + private async void button13_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseInvoice(); + invoice.Series = "CP3.1"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "01", + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" }, + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", + NombreEstacion = "Loreto", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", + NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), + TipoEstacionId = "02", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1.50m, + ValorMercancia = 100, + MonedaId = "MXN", + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020", CvesTransporteId = "02" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "X1A", + PesoBruto = 1.50m, + PesoNeto = 1.00m, + PesoTara = 0.50m + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", + ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", + MunicipioId = "Municipio1", EstadoId = "Estado1", PaisId = "AFG", CodigoPostalId = "CodigoPosta1" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button14: Factura traslado autotransporte nacional + private async void button14_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button15: Factura traslado autotransporte extranjero + private async void button15_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "SerieCCP31"; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button16: Factura traslado autotransporte internacional aduanero + private async void button16_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "SerieCCP31"; + + var domicilioUSA = new Domicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "01", + TotalDistRec = 1, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + LogisticaInversaRecoleccionDevolucionId = "Sí", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", + IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = domicilioUSA + }, + new Ubicacion + { + TipoUbicacion = "Destino", + IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NumRegIdTrib = "01010101", + ResidenciaFiscalId = "USA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + DistanciaRecorrida = 1, + Domicilio = domicilioUSA + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2003-04-02T00:00:00"), + LoteMedicamento = "LoteMedic1", + FormaFarmaceuticaId = "01", + CondicionesEspTranspId = "01", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + FraccionArancelariaId = "6309000100", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + Autotransporte = CreateAutotransporte(), + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "NumLicencia1", + NombreFigura = "NombreFigura1", + Domicilio = domicilioUSA + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button17: Factura traslado transporte ferroviario nacional + private async void button17_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario() }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button18: Factura traslado transporte ferroviario extranjero + private async void button18_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + var ubicaciones = CreateUbicacionesFerroviarioNacional(); + // Replace last destination with a foreign one + ubicaciones[ubicaciones.Count - 1] = new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", + Referencia = "WHITE HOUSE", MunicipioId = "1234", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + }; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = ubicaciones, + Mercancias = new List { CreateMercanciaFerroviario(includeTipoMateria: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button19: Factura traslado transporte ferroviario inernacional aduanero + private async void button19_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "04", + TotalDistRec = 500, + PesoNetoTotal = 10, + RegistroISTMOId = "Sí", + UbicacionPoloOrigenId = "01", + UbicacionPoloDestinoId = "01", + UnidadPesoId = "XBX", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = CreateUbicacionesFerroviarioNacional(), + Mercancias = new List { CreateMercanciaFerroviario(includeDocumentacionAduanera: true) }, + TransporteFerroviario = CreateTransporteFerroviario(), + TiposFigura = new List { CreateTipoFiguraFerroviario() } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button20: Factura traslado transporte aereo nacional + private async void button20_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button21: Factura traslado transporte aereo extranjero + private async void button21_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button22: Factura traslado transporte aereo internacional aduanero + private async void button22_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "03", + UnidadPesoId = "XBX", + PesoNetoTotal = 10, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "EA0417", NombreEstacion = "Loreto", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + } + } + }, + TransporteAereo = new TransporteAereo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "Demo", + MatriculaAeronave = "61E5-WZ", + NombreAseg = "NombreAseg", + NumPolizaSeguro = "NumPolizaSeguro", + NumeroGuia = "acUbYlBVTmlzx", + LugarContrato = "LugarContrato", + CodigoTransportistaId = "CA001", + RfcEmbarcador = "EKU9003173C9", + NombreEmbarcador = "Embarcador" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", + RfcFigura = "EKU9003173C9", + NumLicencia = "a234567890", + NombreFigura = "NombreFigura" + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button23: Factura traslado transporte maritimo nacional + private async void button23_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "No", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button24: Factura traslado transporte maritimo extranjero + private async void button24_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "USA", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "XEXX010101000", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", + NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + Domicilio = new Domicilio + { + Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", + Referencia = "N/A", MunicipioId = "N/A", + EstadoId = "TX", PaisId = "USA", CodigoPostalId = "12345" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // button25: Factura traslado transporte maritimo internacional aduanero + private async void button25_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = CreateBaseTraslado(); + invoice.Series = "Serie"; + + invoice.Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Entrada", + PaisOrigenDestinoId = "AFG", + ViaEntradaSalidaId = "02", + UnidadPesoId = "XBX", + PesoNetoTotal = 1, + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "IMD" }, + new RegimenAduanero { RegimenAduaneroId = "IMD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202020", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "PM001", NombreEstacion = "Rosarito", + NavegacionTraficoId = "Altura", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), + TipoEstacionId = "03", + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }, + Mercancias = new List + { + new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + ValorMercancia = 100, + MonedaId = "MXN", + TipoMateriaId = "05", + DescripcionMateria = "otramateria", + DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + }, + DetalleMercancia = new DetalleMercancia + { + UnidadPesoMercId = "Tu", + PesoBruto = 1, + PesoNeto = 1, + PesoTara = 0.001m, + NumPiezas = 1 + } + } + }, + TransporteMaritimo = new TransporteMaritimo + { + PermSCTId = "TPAF01", + NumPermisoSCT = "NumPermisoSCT1", + NombreAseg = "NombreAseg1", + NumPolizaSeguro = "NumPolizaSeguro1", + TipoEmbarcacionId = "B01", + Matricula = "Matricula1", + NumeroOMI = "IMO1234567", + AnioEmbarcacion = 2003, + NombreEmbarc = "NombreEmbarc1", + NacionalidadEmbarcId = "AFG", + UnidadesDeArqBruto = 0.001m, + TipoCargaId = "CGS", + Eslora = 0.01m, + Manga = 0.01m, + Calado = 0.01m, + Puntal = 0.01m, + LineaNaviera = "LineaNaviera1", + NombreAgenteNaviero = "NombreAgenteNaviero1", + NumAutorizacionNavieroId = "ANC001/2022", + NumViaje = "NumViaje1", + NumConocEmbarc = "NumConocEmbarc1", + PermisoTempNavegacion = "PermisoTempNavegac1", + Contenedores = new List + { + new ContenedorMaritimo + { + TipoContenedorId = "CM011", + IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", + PlacaVMCCP = "JNG7683", + FechaCertificacionCCP = "2024-06-20T11:11:00", + RemolquesCCP = new List + { + new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } + } + } + } + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + + if (apiResponse.Succeeded) + MessageBox.Show(JsonConvert.SerializeObject(apiResponse.Data, Formatting.Indented)); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + private TransporteFerroviario CreateTransporteFerroviario() + { + return new TransporteFerroviario + { + TipoDeServicioId = "TS01", + TipoDeTraficoId = "TT01", + DerechosDePaso = new List + { + new DerechoDePaso { TipoDerechoDePasoId = "CDP114", KilometrajePagado = 100 } + }, + Carros = new List + { + new Carro + { + TipoCarroId = "TC08", + MatriculaCarro = "A00012", + GuiaCarro = "123ASD", + ToneladasNetasCarro = 10 + } + } + }; + } + + private TipoFigura CreateTipoFiguraFerroviario() + { + return new TipoFigura + { + TipoFiguraId = "02", + RfcFigura = "EKU9003173C9", + NombreFigura = "NombreFigura", + PartesTransporte = new List + { + new ParteTransporte { ParteTransporteId = "PT02" } + }, + Domicilio = new Domicilio + { + Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", + LocalidadId = "01", Referencia = "casa blanca", + MunicipioId = "010", EstadoId = "ZAC", PaisId = "MEX", CodigoPostalId = "99080" + } + }; + } + + private List CreateUbicacionesFerroviarioNacional() + { + return new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IdUbicacion = "OR101010", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", + NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), + TipoEstacionId = "01", + Domicilio = new Domicilio + { + Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", + ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", + MunicipioId = "011", EstadoId = "CMX", PaisId = "MEX", CodigoPostalId = "13250" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202021", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "SC283", NombreEstacion = "HUAXTITLA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T01:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202022", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "TG0", NombreEstacion = "NAVOJOA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T02:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202023", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "E0029", NombreEstacion = "TRES JAGUEYES", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T03:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202024", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "TI032", NombreEstacion = "NAVOLATO", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), + TipoEstacionId = "02", DistanciaRecorrida = 100.00m + }, + new Ubicacion + { + TipoUbicacion = "Destino", IdUbicacion = "DE202025", + RfcRemitenteDestinatario = "EKU9003173C9", + NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", + NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", + FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), + TipoEstacionId = "03", DistanciaRecorrida = 100.00m, + Domicilio = new Domicilio + { + Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", + ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", + MunicipioId = "004", EstadoId = "COA", PaisId = "MEX", CodigoPostalId = "25350" + } + } + }; + } + + private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bool includeDocumentacionAduanera = false) + { + var m = new Mercancia + { + BienesTranspId = "11121900", + Descripcion = "Accesorios de equipo de telefonía", + Cantidad = 1.0m, + ClaveUnidadId = "XBX", + MaterialPeligrosoId = "No", + DenominacionGenericaProd = "DenominacionGenericaProd1", + DenominacionDistintivaProd = "DenominacionDistintivaProd1", + Fabricante = "Fabricante1", + FechaCaducidad = DateTime.Parse("2028-01-01T00:00:00"), + LoteMedicamento = "LoteMedic1", + RegistroSanitarioFolioAutorizacion = "RegistroSanita1", + PesoEnKg = 1, + CantidadTransporta = new List + { + new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202025" } + } + }; + + if (includeTipoMateria || includeDocumentacionAduanera) + { + m.TipoMateriaId = "05"; + m.DescripcionMateria = "otramateria"; + } + + if (includeDocumentacionAduanera) + { + m.DocumentacionAduanera = new List + { + new DocumentoAduanero + { + TipoDocumentoId = "01", + NumPedimento = "23 43 0472 8000448", + RfcImpo = "EKU9003173C9" + } + }; + } + + return m; + } + + private Invoice CreateBaseInvoiceFerroviario() + { + var invoice = CreateBaseInvoice(); + invoice.Series = "Serie"; + invoice.Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }; + return invoice; + } + + private Invoice CreateBaseTraslado() + { + return new Invoice + { + VersionCode = "4.0", + CurrencyCode = "XXX", + TypeCode = "T", + ExpeditionZipCode = "42501", + PaymentMethodCode = "", + Date = DateTime.Now, + ExchangeRate = 1, + ExportCode = "01", + Issuer = CreateIssuer(), + Recipient = new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = "S01" + }, + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", + ItemSku = "UT421511", + Quantity = 1, + UnitOfMeasurementCode = "H87", + Description = "Transporte de carga por carretera", + UnitPrice = 100.00m, + Discount = 0, + TaxObjectCode = "01", + ItemTaxes = new List() + } + } + }; + } + } +} diff --git a/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj b/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj index ab374bb..8fda2d7 100644 --- a/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj +++ b/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj @@ -33,8 +33,8 @@ 4 - - ..\packages\Fiscalapi.4.0.360\lib\net461\Fiscalapi.dll + + ..\packages\Fiscalapi.4.0.372\lib\net461\Fiscalapi.dll ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll @@ -108,6 +108,18 @@ + + Form + + + BillOfLadingReferenceForm.cs + + + Form + + + BillOfLadingValueForm.cs + Form diff --git a/FiscalApi.Samples.NetFramework/Form1.cs b/FiscalApi.Samples.NetFramework/Form1.cs index 7babf0d..7816869 100644 --- a/FiscalApi.Samples.NetFramework/Form1.cs +++ b/FiscalApi.Samples.NetFramework/Form1.cs @@ -22,8 +22,8 @@ public Form1() Settings = new FiscalapiSettings { ApiUrl = "https://test.fiscalapi.com", - ApiKey = "sk_test_b4f8cc00_d02a_4ecc_a68a_f87ae970958c", - Tenant = "275510ee-f64d-435a-9e92-1553d8f10a7e", + ApiKey = "api_key", + Tenant = "tenant_id", }; // Create directory if not exists diff --git a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs index 51b049d..8945834 100644 --- a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs +++ b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs @@ -173,7 +173,8 @@ private void button13_Click(object sender, EventArgs e) private void button14_Click(object sender, EventArgs e) { - + BillOfLadingReferenceForm billOfLadingReferenceForm = new BillOfLadingReferenceForm(_settings); + billOfLadingReferenceForm.ShowDialog(); } } } diff --git a/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs b/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs index 0a7858c..9fd2c62 100644 --- a/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs +++ b/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs @@ -717,7 +717,8 @@ private void button9_Click_1(object sender, EventArgs e) private void button13_Click_1(object sender, EventArgs e) { - + BillOfLadingValueForm cartaporteForm = new BillOfLadingValueForm(_settings); + cartaporteForm.ShowDialog(); } private void button10_Click_1(object sender, EventArgs e) From b10b6ea4fc6b15c2a2cdb93fc35afe6ab358fdcc Mon Sep 17 00:00:00 2001 From: Jose Antonio Medina Date: Sun, 22 Mar 2026 12:24:59 -0600 Subject: [PATCH 2/4] Fixed typos --- .../BillOfLadingReferenceForm.Designer.cs | 2 +- .../BillOfLadingValueForm.Designer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs index 036d63a..a0e1bdf 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs @@ -169,7 +169,7 @@ private void InitializeComponent() this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(189, 60); this.button7.TabIndex = 7; - this.button7.Text = "Factura ingresdo transporte ferrovirario internacional aduanero"; + this.button7.Text = "Factura ingreso transporte ferroviario internacional aduanero"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs index 1d7a34d..682e7fb 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.Designer.cs @@ -169,7 +169,7 @@ private void InitializeComponent() this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(189, 60); this.button7.TabIndex = 7; - this.button7.Text = "Factura ingresdo transporte ferrovirario internacional aduanero"; + this.button7.Text = "Factura ingreso transporte ferroviario internacional aduanero"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // From 90026bd9c6b79f4e2d96888178e8b7fd7f6e3ca7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Medina Date: Thu, 16 Apr 2026 18:58:54 -0600 Subject: [PATCH 3/4] Fixed discrepancies with public API --- .../BillOfLadingReferenceForm.cs | 300 +++++++++--------- .../BillOfLadingValueForm.cs | 300 +++++++++--------- 2 files changed, 300 insertions(+), 300 deletions(-) diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs index c5a8347..56c4d90 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs @@ -91,7 +91,7 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) FraccionArancelariaId = "6309000100", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } }; @@ -105,7 +105,7 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }; } @@ -169,8 +169,8 @@ private async void button1_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -183,8 +183,8 @@ private async void button1_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -203,7 +203,7 @@ private async void button1_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "URE180429TM6", + RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -258,8 +258,8 @@ private async void button2_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -272,8 +272,8 @@ private async void button2_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -292,7 +292,7 @@ private async void button2_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "URE180429TM6", + RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -355,8 +355,8 @@ private async void button3_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -365,8 +365,8 @@ private async void button3_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -397,7 +397,7 @@ private async void button3_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -407,7 +407,7 @@ private async void button3_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -465,8 +465,8 @@ private async void button4_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -475,8 +475,8 @@ private async void button4_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -491,7 +491,7 @@ private async void button4_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -557,8 +557,8 @@ private async void button6_Click(object sender, EventArgs e) // Replace last destination with a foreign one ubicaciones[ubicaciones.Count - 1] = new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", @@ -670,8 +670,8 @@ private async void button8_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -685,8 +685,8 @@ private async void button8_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -719,7 +719,7 @@ private async void button8_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -733,7 +733,7 @@ private async void button8_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -741,7 +741,7 @@ private async void button8_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -787,8 +787,8 @@ private async void button9_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -802,8 +802,8 @@ private async void button9_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", @@ -838,7 +838,7 @@ private async void button9_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -852,7 +852,7 @@ private async void button9_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -860,7 +860,7 @@ private async void button9_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -907,8 +907,8 @@ private async void button10_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -923,8 +923,8 @@ private async void button10_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -959,11 +959,11 @@ private async void button10_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", DocumentacionAduanera = new List { - new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RfcImpo = "EKU9003173C9" } + new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -977,7 +977,7 @@ private async void button10_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -985,7 +985,7 @@ private async void button10_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -1024,8 +1024,8 @@ private async void button11_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1040,8 +1040,8 @@ private async void button11_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1073,7 +1073,7 @@ private async void button11_Click(object sender, EventArgs e) PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -1116,7 +1116,7 @@ private async void button11_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1129,7 +1129,7 @@ private async void button11_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -1184,8 +1184,8 @@ private async void button12_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1200,8 +1200,8 @@ private async void button12_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", @@ -1237,7 +1237,7 @@ private async void button12_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -1280,7 +1280,7 @@ private async void button12_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1293,7 +1293,7 @@ private async void button12_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -1353,8 +1353,8 @@ private async void button13_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", @@ -1371,8 +1371,8 @@ private async void button13_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", @@ -1416,12 +1416,12 @@ private async void button13_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020", CvesTransporteId = "02" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020", CvesTransporteId = "02" } }, DetalleMercancia = new DetalleMercancia { @@ -1463,7 +1463,7 @@ private async void button13_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1481,7 +1481,7 @@ private async void button13_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -1489,7 +1489,7 @@ private async void button13_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -1538,8 +1538,8 @@ private async void button14_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -1552,8 +1552,8 @@ private async void button14_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -1583,7 +1583,7 @@ private async void button14_Click(object sender, EventArgs e) PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1593,7 +1593,7 @@ private async void button14_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -1650,8 +1650,8 @@ private async void button15_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1660,8 +1660,8 @@ private async void button15_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1692,7 +1692,7 @@ private async void button15_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1702,7 +1702,7 @@ private async void button15_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -1760,8 +1760,8 @@ private async void button16_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1770,8 +1770,8 @@ private async void button16_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1806,12 +1806,12 @@ private async void button16_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1821,7 +1821,7 @@ private async void button16_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -1889,8 +1889,8 @@ private async void button18_Click(object sender, EventArgs e) // Replace last destination with a foreign one ubicaciones[ubicaciones.Count - 1] = new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", @@ -2001,8 +2001,8 @@ private async void button20_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2016,8 +2016,8 @@ private async void button20_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -2050,7 +2050,7 @@ private async void button20_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2064,7 +2064,7 @@ private async void button20_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2072,7 +2072,7 @@ private async void button20_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2117,8 +2117,8 @@ private async void button21_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2132,8 +2132,8 @@ private async void button21_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", @@ -2168,7 +2168,7 @@ private async void button21_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2182,7 +2182,7 @@ private async void button21_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2190,7 +2190,7 @@ private async void button21_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2235,8 +2235,8 @@ private async void button22_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2250,8 +2250,8 @@ private async void button22_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -2290,12 +2290,12 @@ private async void button22_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2309,7 +2309,7 @@ private async void button22_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2317,7 +2317,7 @@ private async void button22_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2355,8 +2355,8 @@ private async void button23_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2371,8 +2371,8 @@ private async void button23_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2406,7 +2406,7 @@ private async void button23_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2449,7 +2449,7 @@ private async void button23_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2462,7 +2462,7 @@ private async void button23_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2516,8 +2516,8 @@ private async void button24_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2532,8 +2532,8 @@ private async void button24_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", @@ -2569,7 +2569,7 @@ private async void button24_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2612,7 +2612,7 @@ private async void button24_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2625,7 +2625,7 @@ private async void button24_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2680,8 +2680,8 @@ private async void button25_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2696,8 +2696,8 @@ private async void button25_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2737,12 +2737,12 @@ private async void button25_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2785,7 +2785,7 @@ private async void button25_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2798,7 +2798,7 @@ private async void button25_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2854,7 +2854,7 @@ private TipoFigura CreateTipoFiguraFerroviario() return new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2875,8 +2875,8 @@ private List CreateUbicacionesFerroviarioNacional() { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2890,8 +2890,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202021", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202021", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "SC283", NombreEstacion = "HUAXTITLA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T01:00:01"), @@ -2899,8 +2899,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202022", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202022", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "TG0", NombreEstacion = "NAVOJOA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T02:00:01"), @@ -2908,8 +2908,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202023", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202023", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "E0029", NombreEstacion = "TRES JAGUEYES", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T03:00:01"), @@ -2917,8 +2917,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202024", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202024", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "TI032", NombreEstacion = "NAVOLATO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), @@ -2926,8 +2926,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), @@ -2960,7 +2960,7 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202025" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202025" } } }; @@ -2978,7 +2978,7 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }; } diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs index 2ac7c1b..cdf0742 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs @@ -97,7 +97,7 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) FraccionArancelariaId = "6309000100", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } }; @@ -111,7 +111,7 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }; } @@ -182,8 +182,8 @@ private async void button1_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -196,8 +196,8 @@ private async void button1_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -216,7 +216,7 @@ private async void button1_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "URE180429TM6", + RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -278,8 +278,8 @@ private async void button2_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -292,8 +292,8 @@ private async void button2_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "URE180429TM6", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -312,7 +312,7 @@ private async void button2_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "URE180429TM6", + RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -382,8 +382,8 @@ private async void button3_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -392,8 +392,8 @@ private async void button3_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -424,7 +424,7 @@ private async void button3_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -434,7 +434,7 @@ private async void button3_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -499,8 +499,8 @@ private async void button4_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -509,8 +509,8 @@ private async void button4_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -525,7 +525,7 @@ private async void button4_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -591,8 +591,8 @@ private async void button6_Click(object sender, EventArgs e) // Replace last destination with a foreign one ubicaciones[ubicaciones.Count - 1] = new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", @@ -711,8 +711,8 @@ private async void button8_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -726,8 +726,8 @@ private async void button8_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -760,7 +760,7 @@ private async void button8_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -774,7 +774,7 @@ private async void button8_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -782,7 +782,7 @@ private async void button8_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -835,8 +835,8 @@ private async void button9_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -850,8 +850,8 @@ private async void button9_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", @@ -886,7 +886,7 @@ private async void button9_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -900,7 +900,7 @@ private async void button9_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -908,7 +908,7 @@ private async void button9_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -962,8 +962,8 @@ private async void button10_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -978,8 +978,8 @@ private async void button10_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1014,11 +1014,11 @@ private async void button10_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", DocumentacionAduanera = new List { - new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RfcImpo = "EKU9003173C9" } + new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1032,7 +1032,7 @@ private async void button10_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -1040,7 +1040,7 @@ private async void button10_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -1086,8 +1086,8 @@ private async void button11_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1102,8 +1102,8 @@ private async void button11_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1135,7 +1135,7 @@ private async void button11_Click(object sender, EventArgs e) PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -1178,7 +1178,7 @@ private async void button11_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1191,7 +1191,7 @@ private async void button11_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -1253,8 +1253,8 @@ private async void button12_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -1269,8 +1269,8 @@ private async void button12_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", @@ -1306,7 +1306,7 @@ private async void button12_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -1349,7 +1349,7 @@ private async void button12_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1362,7 +1362,7 @@ private async void button12_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -1429,8 +1429,8 @@ private async void button13_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", @@ -1447,8 +1447,8 @@ private async void button13_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", @@ -1492,12 +1492,12 @@ private async void button13_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020", CvesTransporteId = "02" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020", CvesTransporteId = "02" } }, DetalleMercancia = new DetalleMercancia { @@ -1539,7 +1539,7 @@ private async void button13_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -1557,7 +1557,7 @@ private async void button13_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -1565,7 +1565,7 @@ private async void button13_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = new Domicilio @@ -1614,8 +1614,8 @@ private async void button14_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), Domicilio = new Domicilio @@ -1628,8 +1628,8 @@ private async void button14_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, @@ -1659,7 +1659,7 @@ private async void button14_Click(object sender, EventArgs e) PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1669,7 +1669,7 @@ private async void button14_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -1726,8 +1726,8 @@ private async void button15_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1736,8 +1736,8 @@ private async void button15_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1768,7 +1768,7 @@ private async void button15_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1778,7 +1778,7 @@ private async void button15_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -1836,8 +1836,8 @@ private async void button16_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Origen", - IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1846,8 +1846,8 @@ private async void button16_Click(object sender, EventArgs e) new Ubicacion { TipoUbicacion = "Destino", - IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -1882,12 +1882,12 @@ private async void button16_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -1897,7 +1897,7 @@ private async void button16_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", Domicilio = domicilioUSA @@ -1965,8 +1965,8 @@ private async void button18_Click(object sender, EventArgs e) // Replace last destination with a foreign one ubicaciones[ubicaciones.Count - 1] = new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", @@ -2077,8 +2077,8 @@ private async void button20_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2092,8 +2092,8 @@ private async void button20_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -2126,7 +2126,7 @@ private async void button20_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2140,7 +2140,7 @@ private async void button20_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2148,7 +2148,7 @@ private async void button20_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2193,8 +2193,8 @@ private async void button21_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2208,8 +2208,8 @@ private async void button21_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", @@ -2244,7 +2244,7 @@ private async void button21_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2258,7 +2258,7 @@ private async void button21_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2266,7 +2266,7 @@ private async void button21_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2311,8 +2311,8 @@ private async void button22_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2326,8 +2326,8 @@ private async void button22_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), @@ -2366,12 +2366,12 @@ private async void button22_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } } } }, @@ -2385,7 +2385,7 @@ private async void button22_Click(object sender, EventArgs e) NumeroGuia = "acUbYlBVTmlzx", LugarContrato = "LugarContrato", CodigoTransportistaId = "CA001", - RfcEmbarcador = "EKU9003173C9", + RFCEmbarcador = "EKU9003173C9", NombreEmbarcador = "Embarcador" }, TiposFigura = new List @@ -2393,7 +2393,7 @@ private async void button22_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "01", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NumLicencia = "a234567890", NombreFigura = "NombreFigura" } @@ -2431,8 +2431,8 @@ private async void button23_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2447,8 +2447,8 @@ private async void button23_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2482,7 +2482,7 @@ private async void button23_Click(object sender, EventArgs e) MonedaId = "MXN", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2525,7 +2525,7 @@ private async void button23_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2538,7 +2538,7 @@ private async void button23_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2592,8 +2592,8 @@ private async void button24_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2608,8 +2608,8 @@ private async void button24_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "XEXX010101000", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "XEXX010101000", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", @@ -2645,7 +2645,7 @@ private async void button24_Click(object sender, EventArgs e) DescripcionMateria = "otramateria", CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2688,7 +2688,7 @@ private async void button24_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2701,7 +2701,7 @@ private async void button24_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2756,8 +2756,8 @@ private async void button25_Click(object sender, EventArgs e) { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2772,8 +2772,8 @@ private async void button25_Click(object sender, EventArgs e) }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202020", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202020", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "PM001", NombreEstacion = "Rosarito", NavegacionTraficoId = "Altura", @@ -2813,12 +2813,12 @@ private async void button25_Click(object sender, EventArgs e) { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202020" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202020" } }, DetalleMercancia = new DetalleMercancia { @@ -2861,7 +2861,7 @@ private async void button25_Click(object sender, EventArgs e) TipoContenedorId = "CM011", IdCCPRelacionado = "CCCBCD94-870A-4332-A52A-A52AA52AA52A", PlacaVMCCP = "JNG7683", - FechaCertificacionCCP = "2024-06-20T11:11:00", + FechaCertificacionCCP = DateTime.Parse("2024-06-20T11:11:00"), RemolquesCCP = new List { new RemolqueCCP { SubTipoRemCCPId = "CTR001", PlacaCCP = "JNG7636" } @@ -2874,7 +2874,7 @@ private async void button25_Click(object sender, EventArgs e) new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2930,7 +2930,7 @@ private TipoFigura CreateTipoFiguraFerroviario() return new TipoFigura { TipoFiguraId = "02", - RfcFigura = "EKU9003173C9", + RFCFigura = "EKU9003173C9", NombreFigura = "NombreFigura", PartesTransporte = new List { @@ -2951,8 +2951,8 @@ private List CreateUbicacionesFerroviarioNacional() { new Ubicacion { - TipoUbicacion = "Origen", IdUbicacion = "OR101010", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Origen", IDUbicacion = "OR101010", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), @@ -2966,8 +2966,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202021", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202021", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "SC283", NombreEstacion = "HUAXTITLA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T01:00:01"), @@ -2975,8 +2975,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202022", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202022", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "TG0", NombreEstacion = "NAVOJOA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T02:00:01"), @@ -2984,8 +2984,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202023", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202023", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "E0029", NombreEstacion = "TRES JAGUEYES", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T03:00:01"), @@ -2993,8 +2993,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202024", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202024", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "TI032", NombreEstacion = "NAVOLATO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), @@ -3002,8 +3002,8 @@ private List CreateUbicacionesFerroviarioNacional() }, new Ubicacion { - TipoUbicacion = "Destino", IdUbicacion = "DE202025", - RfcRemitenteDestinatario = "EKU9003173C9", + TipoUbicacion = "Destino", IDUbicacion = "DE202025", + RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), @@ -3036,7 +3036,7 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo PesoEnKg = 1, CantidadTransporta = new List { - new CantidadTransporta { Cantidad = 1, IdOrigen = "OR101010", IdDestino = "DE202025" } + new CantidadTransporta { Cantidad = 1, IDOrigen = "OR101010", IDDestino = "DE202025" } } }; @@ -3054,7 +3054,7 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", - RfcImpo = "EKU9003173C9" + RFCImpo = "EKU9003173C9" } }; } From 84dfafd03f7a81c2e6946b8bb63a1db8d03ecd66 Mon Sep 17 00:00:00 2001 From: Jose Antonio Medina Date: Fri, 17 Apr 2026 12:20:54 -0600 Subject: [PATCH 4/4] Fixed share class issue --- .../BillOfLadingReferenceForm.cs | 154 +++++++++-------- .../BillOfLadingValueForm.cs | 156 ++++++++++-------- 2 files changed, 179 insertions(+), 131 deletions(-) diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs index 56c4d90..1c9b6d0 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs @@ -99,9 +99,9 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) { mercancia.TipoMateriaId = "05"; mercancia.DescripcionMateria = "otramateria"; - mercancia.DocumentacionAduanera = new List + mercancia.DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -173,7 +173,7 @@ private async void button1_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -188,7 +188,7 @@ private async void button1_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -206,7 +206,7 @@ private async void button1_Click(object sender, EventArgs e) RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -262,7 +262,7 @@ private async void button2_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -277,7 +277,7 @@ private async void button2_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -295,7 +295,7 @@ private async void button2_Click(object sender, EventArgs e) RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -325,7 +325,13 @@ private async void button3_Click(object sender, EventArgs e) var invoice = CreateBaseInvoice(); invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -410,7 +416,7 @@ private async void button3_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -435,7 +441,13 @@ private async void button4_Click(object sender, EventArgs e) var invoice = CreateBaseInvoice(); invoice.Recipient = new InvoiceRecipient { Id = "37f7c342-d9a6-4881-9620-0da769b50ce5" }; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -494,7 +506,7 @@ private async void button4_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -564,7 +576,7 @@ private async void button6_Click(object sender, EventArgs e) NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", Referencia = "WHITE HOUSE", MunicipioId = "1234", @@ -676,7 +688,7 @@ private async void button8_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -691,7 +703,7 @@ private async void button8_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -793,7 +805,7 @@ private async void button9_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -808,7 +820,7 @@ private async void button9_Click(object sender, EventArgs e) NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", @@ -913,7 +925,7 @@ private async void button10_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -929,7 +941,7 @@ private async void button10_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -957,9 +969,9 @@ private async void button10_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { @@ -1031,7 +1043,7 @@ private async void button11_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1047,7 +1059,7 @@ private async void button11_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1135,7 +1147,7 @@ private async void button11_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -1191,7 +1203,7 @@ private async void button12_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1207,7 +1219,7 @@ private async void button12_Click(object sender, EventArgs e) NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", Referencia = "N/A", MunicipioId = "N/A", @@ -1299,7 +1311,7 @@ private async void button12_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -1361,7 +1373,7 @@ private async void button13_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1379,7 +1391,7 @@ private async void button13_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), TipoEstacionId = "02", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1410,9 +1422,9 @@ private async void button13_Click(object sender, EventArgs e) FraccionArancelariaId = "6309000100", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -1492,7 +1504,7 @@ private async void button13_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -1542,7 +1554,7 @@ private async void button14_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1557,7 +1569,7 @@ private async void button14_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1620,7 +1632,13 @@ private async void button15_Click(object sender, EventArgs e) var invoice = CreateBaseTraslado(); invoice.Series = "SerieCCP31"; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -1705,7 +1723,7 @@ private async void button15_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -1730,7 +1748,13 @@ private async void button16_Click(object sender, EventArgs e) var invoice = CreateBaseTraslado(); invoice.Series = "SerieCCP31"; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -1800,9 +1824,9 @@ private async void button16_Click(object sender, EventArgs e) FraccionArancelariaId = "6309000100", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -1824,7 +1848,7 @@ private async void button16_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -1896,7 +1920,7 @@ private async void button18_Click(object sender, EventArgs e) NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", Referencia = "WHITE HOUSE", MunicipioId = "1234", @@ -2007,7 +2031,7 @@ private async void button20_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2022,7 +2046,7 @@ private async void button20_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2123,7 +2147,7 @@ private async void button21_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2138,7 +2162,7 @@ private async void button21_Click(object sender, EventArgs e) NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", @@ -2241,7 +2265,7 @@ private async void button22_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2256,7 +2280,7 @@ private async void button22_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2284,9 +2308,9 @@ private async void button22_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -2362,7 +2386,7 @@ private async void button23_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2378,7 +2402,7 @@ private async void button23_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2468,7 +2492,7 @@ private async void button23_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2523,7 +2547,7 @@ private async void button24_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2539,7 +2563,7 @@ private async void button24_Click(object sender, EventArgs e) NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", Referencia = "N/A", MunicipioId = "N/A", @@ -2631,7 +2655,7 @@ private async void button24_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2687,7 +2711,7 @@ private async void button25_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2703,7 +2727,7 @@ private async void button25_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2731,9 +2755,9 @@ private async void button25_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -2804,7 +2828,7 @@ private async void button25_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2860,7 +2884,7 @@ private TipoFigura CreateTipoFiguraFerroviario() { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2881,7 +2905,7 @@ private List CreateUbicacionesFerroviarioNacional() NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2932,7 +2956,7 @@ private List CreateUbicacionesFerroviarioNacional() NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), TipoEstacionId = "03", DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2972,9 +2996,9 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo if (includeDocumentacionAduanera) { - m.DocumentacionAduanera = new List + m.DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs index cdf0742..ecee97b 100644 --- a/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs @@ -1,4 +1,4 @@ -using Fiscalapi.Common; +using Fiscalapi.Common; using Fiscalapi.Models; using Fiscalapi.Models.BillOfLading; using Fiscalapi.Services; @@ -105,9 +105,9 @@ private Mercancia CreateMercancia(bool includeDocumentacionAduanera = false) { mercancia.TipoMateriaId = "05"; mercancia.DescripcionMateria = "otramateria"; - mercancia.DocumentacionAduanera = new List + mercancia.DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -186,7 +186,7 @@ private async void button1_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -201,7 +201,7 @@ private async void button1_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -219,7 +219,7 @@ private async void button1_Click(object sender, EventArgs e) RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -282,7 +282,7 @@ private async void button2_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "URE180429TM6", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -297,7 +297,7 @@ private async void button2_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -315,7 +315,7 @@ private async void button2_Click(object sender, EventArgs e) RFCFigura = "URE180429TM6", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -352,7 +352,13 @@ private async void button3_Click(object sender, EventArgs e) CfdiUseCode = "S01" }; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -437,7 +443,7 @@ private async void button3_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -469,7 +475,13 @@ private async void button4_Click(object sender, EventArgs e) CfdiUseCode = "S01" }; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -528,7 +540,7 @@ private async void button4_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -598,7 +610,7 @@ private async void button6_Click(object sender, EventArgs e) NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", Referencia = "WHITE HOUSE", MunicipioId = "1234", @@ -717,7 +729,7 @@ private async void button8_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -732,7 +744,7 @@ private async void button8_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -841,7 +853,7 @@ private async void button9_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -856,7 +868,7 @@ private async void button9_Click(object sender, EventArgs e) NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", @@ -968,7 +980,7 @@ private async void button10_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -984,7 +996,7 @@ private async void button10_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1012,9 +1024,9 @@ private async void button10_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", RFCImpo = "EKU9003173C9" } }, CantidadTransporta = new List { @@ -1093,7 +1105,7 @@ private async void button11_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1109,7 +1121,7 @@ private async void button11_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1197,7 +1209,7 @@ private async void button11_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -1260,7 +1272,7 @@ private async void button12_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1276,7 +1288,7 @@ private async void button12_Click(object sender, EventArgs e) NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", Referencia = "N/A", MunicipioId = "N/A", @@ -1368,7 +1380,7 @@ private async void button12_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -1437,7 +1449,7 @@ private async void button13_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1455,7 +1467,7 @@ private async void button13_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T04:00:01"), TipoEstacionId = "02", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1486,9 +1498,9 @@ private async void button13_Click(object sender, EventArgs e) FraccionArancelariaId = "6309000100", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -1568,7 +1580,7 @@ private async void button13_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "Calle1", NumeroExterior = "NumeroExterior1", NumeroInterior = "NumeroInterior1", ColoniaId = "Colonia1", LocalidadId = "Localidad1", Referencia = "Referencia1", @@ -1618,7 +1630,7 @@ private async void button14_Click(object sender, EventArgs e) RFCRemitenteDestinatario = "EKU9003173C9", NombreRemitenteDestinatario = "NombreRemitenteDestinatario1", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -1633,7 +1645,7 @@ private async void button14_Click(object sender, EventArgs e) NombreRemitenteDestinatario = "NombreRemitenteDestinatario2", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), DistanciaRecorrida = 1, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -1696,7 +1708,13 @@ private async void button15_Click(object sender, EventArgs e) var invoice = CreateBaseTraslado(); invoice.Series = "SerieCCP31"; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -1781,7 +1799,7 @@ private async void button15_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -1806,7 +1824,13 @@ private async void button16_Click(object sender, EventArgs e) var invoice = CreateBaseTraslado(); invoice.Series = "SerieCCP31"; - var domicilioUSA = new Domicilio + var domicilioUSA = new UbicacionDomicilio + { + Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", + Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", + PaisId = "USA", CodigoPostalId = "N/A" + }; + var domicilioUSATF = new TiposFiguraDomicilio { Calle = "ST", NumeroExterior = "214", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", EstadoId = "TX", @@ -1876,9 +1900,9 @@ private async void button16_Click(object sender, EventArgs e) FraccionArancelariaId = "6309000100", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -1900,7 +1924,7 @@ private async void button16_Click(object sender, EventArgs e) RFCFigura = "EKU9003173C9", NumLicencia = "NumLicencia1", NombreFigura = "NombreFigura1", - Domicilio = domicilioUSA + Domicilio = domicilioUSATF } } } @@ -1972,7 +1996,7 @@ private async void button18_Click(object sender, EventArgs e) NumEstacionId = "EF0001", NombreEstacion = "NombreEstacion", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "1234", ColoniaId = "1234", Referencia = "WHITE HOUSE", MunicipioId = "1234", @@ -2083,7 +2107,7 @@ private async void button20_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2098,7 +2122,7 @@ private async void button20_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2199,7 +2223,7 @@ private async void button21_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2214,7 +2238,7 @@ private async void button21_Click(object sender, EventArgs e) NumRegIdTrib = "01010101", ResidenciaFiscalId = "USA", NumEstacionId = "EA0143", NombreEstacion = "Phoenix-Mesa Gateway", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12344", ColoniaId = "N/A", Referencia = "WHITE HOUSE", MunicipioId = "N/A", @@ -2317,7 +2341,7 @@ private async void button22_Click(object sender, EventArgs e) NumEstacionId = "EA0417", NombreEstacion = "Loreto", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2332,7 +2356,7 @@ private async void button22_Click(object sender, EventArgs e) NumEstacionId = "EA0418", NombreEstacion = "Los Cabos", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2360,9 +2384,9 @@ private async void button22_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -2438,7 +2462,7 @@ private async void button23_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2454,7 +2478,7 @@ private async void button23_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2544,7 +2568,7 @@ private async void button23_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2599,7 +2623,7 @@ private async void button24_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2615,7 +2639,7 @@ private async void button24_Click(object sender, EventArgs e) NumEstacionId = "PM120", NombreEstacion = "NombreEstacion", NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "ST", NumeroExterior = "12345", ColoniaId = "N/A", Referencia = "N/A", MunicipioId = "N/A", @@ -2707,7 +2731,7 @@ private async void button24_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2763,7 +2787,7 @@ private async void button25_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -2779,7 +2803,7 @@ private async void button25_Click(object sender, EventArgs e) NavegacionTraficoId = "Altura", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:01"), TipoEstacionId = "03", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -2807,9 +2831,9 @@ private async void button25_Click(object sender, EventArgs e) MonedaId = "MXN", TipoMateriaId = "05", DescripcionMateria = "otramateria", - DocumentacionAduanera = new List + DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448", @@ -2880,7 +2904,7 @@ private async void button25_Click(object sender, EventArgs e) { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2936,7 +2960,7 @@ private TipoFigura CreateTipoFiguraFerroviario() { new ParteTransporte { ParteTransporteId = "PT02" } }, - Domicilio = new Domicilio + Domicilio = new TiposFiguraDomicilio { Calle = "calle", NumeroExterior = "211", ColoniaId = "0814", LocalidadId = "01", Referencia = "casa blanca", @@ -2957,7 +2981,7 @@ private List CreateUbicacionesFerroviarioNacional() NumEstacionId = "Q0736", NombreEstacion = "SANTO NINO", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T00:00:00"), TipoEstacionId = "01", - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle1", NumeroExterior = "211", NumeroInterior = "212", ColoniaId = "1957", LocalidadId = "13", Referencia = "casa blanca", @@ -3008,7 +3032,7 @@ private List CreateUbicacionesFerroviarioNacional() NumEstacionId = "JM047", NombreEstacion = "HUEHUETOCA", FechaHoraSalidaLlegada = DateTime.Parse("2023-08-01T05:00:01"), TipoEstacionId = "03", DistanciaRecorrida = 100.00m, - Domicilio = new Domicilio + Domicilio = new UbicacionDomicilio { Calle = "Calle2", NumeroExterior = "214", NumeroInterior = "215", ColoniaId = "0347", LocalidadId = "23", Referencia = "casa negra", @@ -3048,9 +3072,9 @@ private Mercancia CreateMercanciaFerroviario(bool includeTipoMateria = false, bo if (includeDocumentacionAduanera) { - m.DocumentacionAduanera = new List + m.DocumentacionAduanera = new List { - new DocumentoAduanero + new DocumentacionAduanera { TipoDocumentoId = "01", NumPedimento = "23 43 0472 8000448",