diff --git a/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.Designer.cs new file mode 100644 index 0000000..a0e1bdf --- /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 ingreso transporte ferroviario 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..1c9b6d0 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingReferenceForm.cs @@ -0,0 +1,3053 @@ +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 DocumentacionAduanera + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 TiposFiguraDomicilio + { + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera { 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 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", + 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 DocumentacionAduanera + { + 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 = domicilioUSATF + } + } + } + }; + + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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..682e7fb --- /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 ingreso transporte ferroviario 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..ecee97b --- /dev/null +++ b/FiscalApi.Samples.NetFramework/BillOfLadingValueForm.cs @@ -0,0 +1,3143 @@ +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 DocumentacionAduanera + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 TiposFiguraDomicilio + { + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera { 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 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", + 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 = domicilioUSATF + } + } + } + }; + + 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 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", + 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 DocumentacionAduanera + { + 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 = domicilioUSATF + } + } + } + }; + + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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 = DateTime.Parse("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 TiposFiguraDomicilio + { + 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 TiposFiguraDomicilio + { + 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 UbicacionDomicilio + { + 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 UbicacionDomicilio + { + 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 DocumentacionAduanera + { + 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/ComercioExteriorCurlSamples.json b/FiscalApi.Samples.NetFramework/ComercioExteriorCurlSamples.json new file mode 100644 index 0000000..99d78dc --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorCurlSamples.json @@ -0,0 +1,1219 @@ + + +Ejemplos facturas comercio exterior + + + +## Por Valores + +Factura CE Ingreso Con Carta Porte 31 +curl --location 'https://test.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: 102e5f13-e114-41dd-bea7-507fce177281' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: sk_test_4e7ca2f5_6c02_4571_9767_212f32cebd59' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "99", + "paymentMethodCode": "PUE", + "currencyCode": "USD", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "XEXX010101000", + "legalName": "Persona Fisica Extranjera", + "zipCode": "42501", + "taxRegimeCode": "616", + "cfdiUseCode": "S01", + "countryId": "USA", + "foreignTin": "123456789" + }, + "items": [ + { + "itemCode": "78101800", + "itemSku": "SERV02", + "quantity": 1.000000, + "unitOfMeasurementCode": "HUR", + "description": "FLETE", + "unitPrice": 2300.000000, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + }, + { + "taxCode": "003", + "taxTypeCode": "Tasa", + "taxRate": 0.300000, + "taxFlagCode": "R" + } + ] + }, + { + "itemCode": "50161509", + "itemSku": "A0001", + "quantity": 1.000000, + "unitOfMeasurementCode": "H87", + "description": "Gomitas", + "unitPrice": 120.000000, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + } + ] + }, + { + "itemCode": "50307037", + "itemSku": "A0002", + "quantity": 1.000000, + "unitOfMeasurementCode": "H87", + "description": "Pulparindo", + "unitPrice": 100.000000, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + } + ] + } + ], + "complement": { + "cartaPorte": { + "transpInternacId": "S\u00ED", + "entradaSalidaMercId": "Salida", + "paisOrigenDestinoId": "ALB", + "viaEntradaSalidaId": "01", + "totalDistRec": 120.00, + "unidadPesoId": "KGM", + "regimenAduaneros": [ + { + "regimenAduaneroId": "EXD" + } + ], + "ubicaciones": [ + { + "tipoUbicacion": "Origen", + "idUbicacion": "OR000001", + "rfcRemitenteDestinatario": "XAXX010101000", + "nombreRemitenteDestinatario": "Origen Nacional", + "fechaHoraSalidaLlegada": "2026-04-27T08:00:00", + "domicilio": { + "calle": "xola", + "numeroExterior": "531", + "coloniaId": "0496", + "localidadId": "03", + "municipioId": "014", + "estadoId": "CMX", + "paisId": "MEX", + "codigoPostalId": "03100" + } + }, + { + "tipoUbicacion": "Destino", + "idUbicacion": "DE000001", + "rfcRemitenteDestinatario": "XAXX010101000", + "nombreRemitenteDestinatario": "Destino Nacional", + "fechaHoraSalidaLlegada": "2026-04-27T20:00:00", + "distanciaRecorrida": 120.00, + "domicilio": { + "calle": "Av Coyoacan", + "numeroExterior": "120", + "coloniaId": "2624", + "localidadId": "03", + "municipioId": "014", + "estadoId": "CMX", + "paisId": "MEX", + "codigoPostalId": "03100" + } + } + ], + "mercancias": [ + { + "bienesTranspId": "50433238", + "descripcion": "Gomitas", + "cantidad": 1, + "claveUnidadId": "XPK", + "pesoEnKg": 10.000, + "valorMercancia": 1200.00, + "monedaId": "USD", + "fraccionArancelariaId": "2005800100", + "tipoMateriaId": "04" + }, + { + "bienesTranspId": "50433238", + "descripcion": "Pulparindo", + "cantidad": 1, + "claveUnidadId": "XPK", + "pesoEnKg": 10.000, + "valorMercancia": 1000.00, + "monedaId": "USD", + "fraccionArancelariaId": "2005800100", + "tipoMateriaId": "04" + } + ], + "autotransporte": { + "permSCTId": "TPAF02", + "numPermisoSCT": "123456", + "configVehicularId": "C2", + "pesoBrutoVehicular": 1, + "placaVM": "555TTT", + "anioModeloVM": 2023, + "aseguraRespCivil": "ODISEA", + "polizaRespCivil": "3456YUHNB234RT" + }, + "tiposFigura": [ + { + "tipoFiguraId": "01", + "rfcFigura": "KAHO641101B39", + "numLicencia": "D0908240", + "nombreFigura": "OSCAR KALA HAAK" + } + ] + }, + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "CIF", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "Av Siempre viva", + "numeroExterior": "123", + "coloniaId": "0001", + "localidadId": "06", + "municipioId": "025", + "estadoId": "COA", + "paisId": "MEX", + "codigoPostalId": "26015" + } + }, + "receptor": { + "numRegIdTrib": "123456789", + "domicilio": { + "calle": "Clinton ST", + "numeroExterior": "10002", + "estado": "NY", + "paisId": "USA", + "codigoPostal": "10002-0000" + } + }, + "mercancias": [ + { + "noIdentificacion": "A0001", + "fraccionArancelariaId": "4011101099", + "cantidadAduana": 1.000, + "unidadAduanaId": "06", + "valorUnitarioAduana": 120.00, + "valorDolares": 120.00 + }, + { + "noIdentificacion": "A0002", + "fraccionArancelariaId": "8407210299", + "cantidadAduana": 1.000, + "unidadAduanaId": "06", + "valorUnitarioAduana": 100.00, + "valorDolares": 100.00 + } + ] + } + } +}' + +--- +Factura CE Ingreso Diferentes Monedas +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "99", + "paymentMethodCode": "PPD", + "currencyCode": "MXN", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "XEXX010101000", + "legalName": "Persona Fisica Extranjera", + "zipCode": "42501", + "taxRegimeCode": "616", + "cfdiUseCode": "S01", + "countryId": "USA", + "foreignTin": "123456789" + }, + "items": [ + { + "itemCode": "50211503", + "itemSku": "131494-1055", + "quantity": 2, + "unitOfMeasurementCode": "H87", + "description": "Cigarros", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + }, + { + "taxCode": "001", + "taxTypeCode": "Tasa", + "taxRate": 0.100000, + "taxFlagCode": "R" + }, + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.106666, + "taxFlagCode": "R" + } + ] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "numRegIdTrib":"123456789", + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 2.00, + "unidadAduanaId": "01", + "valorUnitarioAduana": 11.74, + "valorDolares": 23.47 + } + ] + } + } +}' + +--- +Factura CE Kit Parte +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "01", + "paymentMethodCode": "PUE", + "currencyCode": "MXN", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "XEXX010101000", + "legalName": "U.S. 0026 SW", + "zipCode": "42501", + "taxRegimeCode": "616", + "cfdiUseCode": "CP01", + "countryId": "USA", + "foreignTin": "123456789" + }, + "items": [ + { + "itemCode": "51241200", + "itemSku": "131494-1055", + "quantity": 1.0, + "unitOfMeasurementCode": "H87", + "description": "FORMULA MAGISTRAL", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + }, + { + "itemCode": "51241200", + "itemSku": "131494-1055", + "quantity": 1.0, + "unitOfMeasurementCode": "H87", + "description": "FORMULA MAGISTRAL", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "numRegIdTrib": "123456789", + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 2, + "unidadAduanaId": "01", + "valorUnitarioAduana": 10.00, + "valorDolares": 20.00 + } + ] + } + } +}' + +--- +Factura CE Receptor Extranjero +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "99", + "paymentMethodCode": "PPD", + "currencyCode": "USD", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "XEXX010101000", + "legalName": "U.S. 0026 SW", + "zipCode": "42501", + "taxRegimeCode": "616", + "cfdiUseCode": "CP01", + "countryId": "USA", + "foreignTin": "123456789" + }, + "items": [ + { + "itemCode": "50211503", + "itemSku": "131494-1055", + "quantity": 2, + "unitOfMeasurementCode": "H87", + "description": "Cigarros", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + }, + { + "taxCode": "001", + "taxTypeCode": "Tasa", + "taxRate": 0.100000, + "taxFlagCode": "R" + } + ] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "numRegIdTrib": "123456789", + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 117.64, + "unidadAduanaId": "01", + "valorUnitarioAduana": 3.40, + "valorDolares": 400.00 + } + ] + } + } +}' + + +--- +Factura CE Receptor Nacional +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "99", + "paymentMethodCode": "PPD", + "currencyCode": "USD", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "URE180429TM6", + "legalName": "UNIVERSIDAD ROBOTICA ESPAÑOLA", + "zipCode": "86991", + "taxRegimeCode": "601", + "cfdiUseCode": "G01" + }, + "items": [ + { + "itemCode": "50211503", + "itemSku": "131494-1055", + "quantity": 2, + "unitOfMeasurementCode": "H87", + "description": "Cigarros", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + }, + { + "taxCode": "001", + "taxTypeCode": "Tasa", + "taxRate": 0.100000, + "taxFlagCode": "R" + }, + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.106666, + "taxFlagCode": "R" + } + ] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "colonia": "0214", + "localidad": "01", + "municipio": "014", + "estado": "QUE", + "paisId": "MEX", + "codigoPostal": "76199" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 117.64, + "unidadAduanaId": "01", + "valorUnitarioAduana": 3.40, + "valorDolares": 400.00 + } + ] + } + } +}' + +--- +Factura CE Traslado Con Carta Porte 31 +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "currencyCode": "XXX", + "typeCode": "T", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "zipCode": "42501", + "taxRegimeCode": "601", + "cfdiUseCode": "S01" + }, + "items": [ + { + "itemCode": "78101800", + "itemSku": "TR01", + "quantity": 1.0, + "unitOfMeasurementCode": "H87", + "description": "TRANSPORTE DE CARGA", + "unitPrice": 0.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + }, + { + "itemCode": "32101622", + "itemSku": "UT421511", + "quantity": 100.00, + "unitOfMeasurementCode": "XBX", + "description": "MEMORIA FLASH", + "unitPrice": 0.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + } + ], + "complement": { + "cartaPorte": { + "transpInternacId": "S\u00ED", + "entradaSalidaMercId": "Salida", + "paisOrigenDestinoId": "ALB", + "viaEntradaSalidaId": "01", + "totalDistRec": 120.00, + "unidadPesoId": "KGM", + "regimenAduaneros": [ + { + "regimenAduaneroId": "EXD" + } + ], + "ubicaciones": [ + { + "tipoUbicacion": "Origen", + "idUbicacion": "OR000001", + "rfcRemitenteDestinatario": "XAXX010101000", + "nombreRemitenteDestinatario": "Origen Nacional", + "fechaHoraSalidaLlegada": "2026-04-27T08:00:00", + "domicilio": { + "calle": "xola", + "numeroExterior": "531", + "coloniaId": "0496", + "localidadId": "03", + "municipioId": "014", + "estadoId": "CMX", + "paisId": "MEX", + "codigoPostalId": "03100" + } + }, + { + "tipoUbicacion": "Destino", + "idUbicacion": "DE000001", + "rfcRemitenteDestinatario": "XAXX010101000", + "nombreRemitenteDestinatario": "Destino Nacional", + "fechaHoraSalidaLlegada": "2026-04-27T20:00:00", + "distanciaRecorrida": 120.00, + "domicilio": { + "calle": "Av Coyoacan", + "numeroExterior": "120", + "coloniaId": "2624", + "localidadId": "03", + "municipioId": "014", + "estadoId": "CMX", + "paisId": "MEX", + "codigoPostalId": "03100" + } + } + ], + "mercancias": [ + { + "bienesTranspId": "50433238", + "descripcion": "Gomitas", + "cantidad": 1, + "claveUnidadId": "XPK", + "pesoEnKg": 10.000, + "valorMercancia": 1200.00, + "monedaId": "USD", + "fraccionArancelariaId": "2005800100", + "tipoMateriaId": "04" + }, + { + "bienesTranspId": "50433238", + "descripcion": "Pulparindo", + "cantidad": 1, + "claveUnidadId": "XPK", + "pesoEnKg": 10.000, + "valorMercancia": 1000.00, + "monedaId": "USD", + "fraccionArancelariaId": "2005800100", + "tipoMateriaId": "04" + } + ], + "autotransporte": { + "permSCTId": "TPAF02", + "numPermisoSCT": "123456", + "configVehicularId": "C2", + "pesoBrutoVehicular": 1, + "placaVM": "555TTT", + "anioModeloVM": 2023, + "aseguraRespCivil": "ODISEA", + "polizaRespCivil": "3456YUHNB234RT" + }, + "tiposFigura": [ + { + "tipoFiguraId": "01", + "rfcFigura": "KAHO641101B39", + "numLicencia": "D0908240", + "nombreFigura": "OSCAR KALA HAAK" + } + ] + }, + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "UT421511", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 100.00, + "unidadAduanaId": "01", + "valorUnitarioAduana": 1.00, + "valorDolares": 0.00 + } + ] + } + } +}' + + +--- +Factura CE Traslado Traslado Mercancia Propia +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "currencyCode": "USD", + "typeCode": "T", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "zipCode": "42501", + "taxRegimeCode": "601", + "cfdiUseCode": "S01" + }, + "items": [ + { + "itemCode": "50211503", + "itemSku": "131494-1055", + "quantity": 1.0, + "unitOfMeasurementCode": "H87", + "description": "My description...", + "unitPrice": 0.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + } + ], + "complement": { + "comercioExterior": { + "motivoTrasladoId": "02", + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FCA", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "domicilio": { + "calle": "SW Street.", + "numeroExterior": "12345", + "localidad": "Oregon", + "estado": "OR", + "paisId": "USA", + "codigoPostal": "12345" + } + }, + "destinatarios": [ + { + "numRegIdTrib": "123456789", + "nombre": "EKU9003173C9", + "domicilios": [ + { + "calle": "SW Street.", + "numeroExterior": "12345", + "localidad": "Oregon", + "estado": "OR", + "paisId": "USA", + "codigoPostal": "12345" + } + ] + } + ], + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "0101210100", + "cantidadAduana": 1, + "unidadAduanaId": "07", + "valorUnitarioAduana": 22.64, + "valorDolares": 22.64 + } + ] + } + } +}' + + +--- +Factura CE Traslado Traslado +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "currencyCode": "USD", + "typeCode": "T", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "zipCode": "42501", + "taxRegimeCode": "601", + "cfdiUseCode": "G01" + }, + "items": [ + { + "itemCode": "50211503", + "itemSku": "131494-1055", + "quantity": 2, + "unitOfMeasurementCode": "H87", + "description": "Cigarros", + "unitPrice": 200.00, + "discount": 0, + "taxObjectCode": "01", + "itemTaxes": [] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2402200100", + "cantidadAduana": 117.64, + "unidadAduanaId": "01", + "valorUnitarioAduana": 3.40, + "valorDolares": 400.00 + } + ] + } + } +}' + +--- +Factura CE Unidades De Medida No Equivalentes + +curl --location 'https://live.fiscalapi.com/api/v4/invoices' \ +--header 'X-TENANT-KEY: ' \ +--header 'X-TIME-ZONE: America/Mexico_City' \ +--header 'Content-Type: application/json' \ +--header 'X-API-KEY: ' \ +--data '{ + "versionCode": "4.0", + "paymentFormCode": "99", + "paymentMethodCode": "PPD", + "currencyCode": "USD", + "typeCode": "I", + "expeditionZipCode": "42501", + "series": "CCE", + "date": "2026-05-08T08:56:40", + "paymentConditions": "CondicionesDePago", + "exportCode": "02", + "issuer": { + "tin": "EKU9003173C9", + "legalName": "ESCUELA KEMPER URGATE", + "taxRegimeCode": "601", + "taxCredentials": [ + { + "base64File": "Omited...", + "fileType": 0, + "password": "12345678a" + }, + { + "base64File": "Omited...", + "fileType": 1, + "password": "12345678a" + } + ] + }, + "recipient": { + "tin": "XEXX010101000", + "legalName": "U.S. 0026 SW", + "zipCode": "42501", + "taxRegimeCode": "616", + "cfdiUseCode": "CP01", + "countryId": "USA", + "foreignTin": "123456789" + }, + "items": [ + { + "itemCode": "50201708", + "itemSku": "131494-1055", + "quantity": 1.000, + "unitOfMeasurementCode": "H87", + "description": "Bebida", + "unitPrice": 100.00, + "discount": 0, + "taxObjectCode": "02", + "itemTaxes": [ + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.160000, + "taxFlagCode": "T" + }, + { + "taxCode": "001", + "taxTypeCode": "Tasa", + "taxRate": 0.100000, + "taxFlagCode": "R" + }, + { + "taxCode": "002", + "taxTypeCode": "Tasa", + "taxRate": 0.106666, + "taxFlagCode": "R" + } + ] + } + ], + "complement": { + "comercioExterior": { + "claveDePedimentoId": "A1", + "certificadoOrigen": 0, + "incotermId": "FOB", + "tipoCambioUSD": 17.2530, + "emisor": { + "domicilio": { + "calle": "CALLE DEL PAPEL", + "coloniaId": "0214", + "localidadId": "01", + "municipioId": "014", + "estadoId": "QUE", + "paisId": "MEX", + "codigoPostalId": "76199" + } + }, + "receptor": { + "numRegIdTrib": "123456789", + "domicilio": { + "calle": "ST. A", + "estado": "TX", + "paisId": "USA", + "codigoPostal": "00000" + } + }, + "mercancias": [ + { + "noIdentificacion": "131494-1055", + "fraccionArancelariaId": "2009310201", + "cantidadAduana": 0.500, + "unidadAduanaId": "08", + "valorUnitarioAduana": 200.00, + "valorDolares": 100.00 + } + ] + } + } +}' \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.Designer.cs b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.Designer.cs new file mode 100644 index 0000000..fa07bd7 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.Designer.cs @@ -0,0 +1,192 @@ +namespace FiscalApi.Samples.NetFramework +{ + partial class ComercioExteriorReferenceForm + { + /// + /// 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.FacturaCEIngresoConCartaPorte31Button = new System.Windows.Forms.Button(); + this.FacturaCEIngresoDiferentesMonedasButton = new System.Windows.Forms.Button(); + this.FacturaCEKitParteButton = new System.Windows.Forms.Button(); + this.FacturaCEReceptorExtranjeroButton = new System.Windows.Forms.Button(); + this.FacturaCEReceptorNacionalButton = new System.Windows.Forms.Button(); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton = new System.Windows.Forms.Button(); + this.FacturaCETrasladoTrasladoButton = new System.Windows.Forms.Button(); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton = new System.Windows.Forms.Button(); + this.FacturaCETrasladoConCartaPorte31Button = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.FacturaCEUnidadesDeMedidaNoEquivalentesButton); + this.groupBox1.Controls.Add(this.FacturaCETrasladoTrasladoButton); + this.groupBox1.Controls.Add(this.FacturaCETrasladoTrasladoMercanciaPropiaButton); + this.groupBox1.Controls.Add(this.FacturaCEReceptorNacionalButton); + this.groupBox1.Controls.Add(this.FacturaCEReceptorExtranjeroButton); + this.groupBox1.Controls.Add(this.FacturaCEKitParteButton); + this.groupBox1.Controls.Add(this.FacturaCEIngresoDiferentesMonedasButton); + this.groupBox1.Controls.Add(this.FacturaCEIngresoConCartaPorte31Button); + this.groupBox1.Controls.Add(this.FacturaCETrasladoConCartaPorte31Button); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.groupBox1.Size = new System.Drawing.Size(968, 436); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Factura con complemento comercio exterior (Por referencias)"; + this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); + // + // FacturaCEIngresoConCartaPorte31Button + // + this.FacturaCEIngresoConCartaPorte31Button.Location = new System.Drawing.Point(8, 33); + this.FacturaCEIngresoConCartaPorte31Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEIngresoConCartaPorte31Button.Name = "FacturaCEIngresoConCartaPorte31Button"; + this.FacturaCEIngresoConCartaPorte31Button.Size = new System.Drawing.Size(284, 94); + this.FacturaCEIngresoConCartaPorte31Button.TabIndex = 1; + this.FacturaCEIngresoConCartaPorte31Button.Text = "Factura CE Ingreso Con Carta Porte 31"; + this.FacturaCEIngresoConCartaPorte31Button.UseVisualStyleBackColor = true; + this.FacturaCEIngresoConCartaPorte31Button.Click += new System.EventHandler(this.FacturaCEIngresoConCartaPorte31Button_Click); + // + // FacturaCEIngresoDiferentesMonedasButton + // + this.FacturaCEIngresoDiferentesMonedasButton.Location = new System.Drawing.Point(300, 33); + this.FacturaCEIngresoDiferentesMonedasButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEIngresoDiferentesMonedasButton.Name = "FacturaCEIngresoDiferentesMonedasButton"; + this.FacturaCEIngresoDiferentesMonedasButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEIngresoDiferentesMonedasButton.TabIndex = 2; + this.FacturaCEIngresoDiferentesMonedasButton.Text = "Factura CE Ingreso Diferentes Monedas"; + this.FacturaCEIngresoDiferentesMonedasButton.UseVisualStyleBackColor = true; + this.FacturaCEIngresoDiferentesMonedasButton.Click += new System.EventHandler(this.FacturaCEIngresoDiferentesMonedasButton_Click); + // + // FacturaCEKitParteButton + // + this.FacturaCEKitParteButton.Location = new System.Drawing.Point(592, 33); + this.FacturaCEKitParteButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEKitParteButton.Name = "FacturaCEKitParteButton"; + this.FacturaCEKitParteButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEKitParteButton.TabIndex = 3; + this.FacturaCEKitParteButton.Text = "Factura CE Kit Parte"; + this.FacturaCEKitParteButton.UseVisualStyleBackColor = true; + this.FacturaCEKitParteButton.Click += new System.EventHandler(this.FacturaCEKitParteButton_Click); + // + // FacturaCEReceptorExtranjeroButton + // + this.FacturaCEReceptorExtranjeroButton.Location = new System.Drawing.Point(8, 133); + this.FacturaCEReceptorExtranjeroButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEReceptorExtranjeroButton.Name = "FacturaCEReceptorExtranjeroButton"; + this.FacturaCEReceptorExtranjeroButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEReceptorExtranjeroButton.TabIndex = 4; + this.FacturaCEReceptorExtranjeroButton.Text = "Factura CE Receptor Extranjero"; + this.FacturaCEReceptorExtranjeroButton.UseVisualStyleBackColor = true; + this.FacturaCEReceptorExtranjeroButton.Click += new System.EventHandler(this.FacturaCEReceptorExtranjeroButton_Click); + // + // FacturaCEReceptorNacionalButton + // + this.FacturaCEReceptorNacionalButton.Location = new System.Drawing.Point(300, 133); + this.FacturaCEReceptorNacionalButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEReceptorNacionalButton.Name = "FacturaCEReceptorNacionalButton"; + this.FacturaCEReceptorNacionalButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEReceptorNacionalButton.TabIndex = 5; + this.FacturaCEReceptorNacionalButton.Text = "Factura CE Receptor Nacional"; + this.FacturaCEReceptorNacionalButton.UseVisualStyleBackColor = true; + this.FacturaCEReceptorNacionalButton.Click += new System.EventHandler(this.FacturaCEReceptorNacionalButton_Click); + // + // FacturaCETrasladoTrasladoMercanciaPropiaButton + // + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Location = new System.Drawing.Point(592, 133); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Name = "FacturaCETrasladoTrasladoMercanciaPropiaButton"; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.TabIndex = 6; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Text = "Factura CE Traslado Traslado Mercancia Propia"; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.UseVisualStyleBackColor = true; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Click += new System.EventHandler(this.FacturaCETrasladoTrasladoMercanciaPropiaButton_Click); + // + // FacturaCETrasladoTrasladoButton + // + this.FacturaCETrasladoTrasladoButton.Location = new System.Drawing.Point(8, 233); + this.FacturaCETrasladoTrasladoButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoTrasladoButton.Name = "FacturaCETrasladoTrasladoButton"; + this.FacturaCETrasladoTrasladoButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoTrasladoButton.TabIndex = 7; + this.FacturaCETrasladoTrasladoButton.Text = "Factura CE Traslado Traslado"; + this.FacturaCETrasladoTrasladoButton.UseVisualStyleBackColor = true; + this.FacturaCETrasladoTrasladoButton.Click += new System.EventHandler(this.FacturaCETrasladoTrasladoButton_Click); + // + // FacturaCEUnidadesDeMedidaNoEquivalentesButton + // + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Location = new System.Drawing.Point(300, 233); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Name = "FacturaCEUnidadesDeMedidaNoEquivalentesButton"; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.TabIndex = 8; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Text = "Factura CE Unidades De Medida No Equivalentes"; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.UseVisualStyleBackColor = true; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Click += new System.EventHandler(this.FacturaCEUnidadesDeMedidaNoEquivalentesButton_Click); + // + // FacturaCETrasladoConCartaPorte31Button + // + this.FacturaCETrasladoConCartaPorte31Button.Location = new System.Drawing.Point(592, 233); + this.FacturaCETrasladoConCartaPorte31Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoConCartaPorte31Button.Name = "FacturaCETrasladoConCartaPorte31Button"; + this.FacturaCETrasladoConCartaPorte31Button.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoConCartaPorte31Button.TabIndex = 9; + this.FacturaCETrasladoConCartaPorte31Button.Text = "Factura CE Traslado Con Carta Porte 31"; + this.FacturaCETrasladoConCartaPorte31Button.UseVisualStyleBackColor = true; + this.FacturaCETrasladoConCartaPorte31Button.Click += new System.EventHandler(this.FacturaCETrasladoConCartaPorte31Button_Click); + // + // ComercioExteriorReferenceForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(968, 436); + this.Controls.Add(this.groupBox1); + this.Name = "ComercioExteriorReferenceForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ComercioExteriorReferenceForm"; + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button FacturaCEUnidadesDeMedidaNoEquivalentesButton; + private System.Windows.Forms.Button FacturaCETrasladoTrasladoButton; + private System.Windows.Forms.Button FacturaCETrasladoTrasladoMercanciaPropiaButton; + private System.Windows.Forms.Button FacturaCEReceptorNacionalButton; + private System.Windows.Forms.Button FacturaCEReceptorExtranjeroButton; + private System.Windows.Forms.Button FacturaCEKitParteButton; + private System.Windows.Forms.Button FacturaCEIngresoDiferentesMonedasButton; + private System.Windows.Forms.Button FacturaCEIngresoConCartaPorte31Button; + private System.Windows.Forms.Button FacturaCETrasladoConCartaPorte31Button; + } +} \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.cs b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.cs new file mode 100644 index 0000000..2409ac3 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.cs @@ -0,0 +1,830 @@ +using Fiscalapi.Common; +using Fiscalapi.Models; +using Fiscalapi.Models.BillOfLading; +using Fiscalapi.Models.ForeignTrade; +using Fiscalapi.Services; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace FiscalApi.Samples.NetFramework +{ + public partial class ComercioExteriorReferenceForm : Form + { + private FiscalapiSettings _settings; + + public ComercioExteriorReferenceForm(FiscalapiSettings settings) + { + InitializeComponent(); + _settings = settings; + } + + private void groupBox1_Enter(object sender, EventArgs e) + { + } + + private Emisor CreateCommonEmisor() + { + return new Emisor + { + Domicilio = new EmisorDomicilio + { + Calle = "CALLE DEL PAPEL", + ColoniaId = "0214", + LocalidadId = "01", + MunicipioId = "014", + EstadoId = "QUE", + PaisId = "MEX", + CodigoPostalId = "76199" + } + }; + } + + private Receptor CreateCommonReceptorTX(bool includeNumRegIdTrib) + { + var receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "ST. A", + Estado = "TX", + PaisId = "USA", + CodigoPostal = "00000" + } + }; + if (includeNumRegIdTrib) receptor.NumRegIdTrib = "123456789"; + return receptor; + } + + private void ShowResult(ApiResponse apiResponse) + { + if (apiResponse.Succeeded) + MessageBox.Show("Timbrada: " + apiResponse.Succeeded); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // Factura CE Ingreso Con Carta Porte 31 (USD, PUE) + private async void FacturaCEIngresoConCartaPorte31Button_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PUE", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", ItemSku = "SERV02", Quantity = 1.000000m, + UnitOfMeasurementCode = "HUR", Description = "FLETE", UnitPrice = 2300.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "003", TaxTypeCode = "Tasa", TaxRate = 0.300000m, TaxFlagCode = "R" } + } + }, + new InvoiceItem + { + ItemCode = "50161509", ItemSku = "A0001", Quantity = 1.000000m, + UnitOfMeasurementCode = "H87", Description = "Gomitas", UnitPrice = 120.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" } + } + }, + new InvoiceItem + { + ItemCode = "50307037", ItemSku = "A0002", Quantity = 1.000000m, + UnitOfMeasurementCode = "H87", Description = "Pulparindo", UnitPrice = 100.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" } + } + } + }, + Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "ALB", + ViaEntradaSalidaId = "01", + TotalDistRec = 120.00m, + UnidadPesoId = "KGM", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IDUbicacion = "OR000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Origen Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T08:00:00"), + Domicilio = new UbicacionDomicilio + { + Calle = "xola", NumeroExterior = "531", ColoniaId = "0496", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IDUbicacion = "DE000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Destino Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T20:00:00"), + DistanciaRecorrida = 120.00m, + Domicilio = new UbicacionDomicilio + { + Calle = "Av Coyoacan", NumeroExterior = "120", ColoniaId = "2624", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Gomitas", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1200.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + }, + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Pulparindo", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1000.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + } + }, + Autotransporte = new Autotransporte + { + PermSCTId = "TPAF02", + NumPermisoSCT = "123456", + ConfigVehicularId = "C2", + PesoBrutoVehicular = 1, + PlacaVM = "555TTT", + AnioModeloVM = 2023, + AseguraRespCivil = "ODISEA", + PolizaRespCivil = "3456YUHNB234RT" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", RFCFigura = "KAHO641101B39", + NumLicencia = "D0908240", NombreFigura = "OSCAR KALA HAAK" + } + } + }, + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "CIF", + TipoCambioUSD = 17.2530m, + Emisor = new Emisor + { + Domicilio = new EmisorDomicilio + { + Calle = "Av Siempre viva", + NumeroExterior = "123", + ColoniaId = "0001", + LocalidadId = "06", + MunicipioId = "025", + EstadoId = "COA", + PaisId = "MEX", + CodigoPostalId = "26015" + } + }, + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "Clinton ST", + NumeroExterior = "10002", + Estado = "NY", + PaisId = "USA", + CodigoPostal = "10002-0000" + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "A0001", FraccionArancelariaId = "4011101099", + CantidadAduana = 1.000m, UnidadAduanaId = "06", + ValorUnitarioAduana = 120.00m, ValorDolares = 120.00m + }, + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "A0002", FraccionArancelariaId = "8407210299", + CantidadAduana = 1.000m, UnidadAduanaId = "06", + ValorUnitarioAduana = 100.00m, ValorDolares = 100.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Ingreso Diferentes Monedas (MXN, PPD) + private async void FacturaCEIngresoDiferentesMonedasButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 2.00m, UnidadAduanaId = "01", + ValorUnitarioAduana = 11.74m, ValorDolares = 23.47m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Kit Parte (MXN, PUE) + private async void FacturaCEKitParteButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "01", + PaymentMethodCode = "PUE", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "51241200", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "FORMULA MAGISTRAL", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + }, + new InvoiceItem + { + ItemCode = "51241200", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "FORMULA MAGISTRAL", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 2, UnidadAduanaId = "01", + ValorUnitarioAduana = 10.00m, ValorDolares = 20.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Receptor Extranjero (USD, PPD) + private async void FacturaCEReceptorExtranjeroButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Receptor Nacional (USD, PPD) + private async void FacturaCEReceptorNacionalButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "CALLE DEL PAPEL", + Colonia = "0214", + Localidad = "01", + Municipio = "014", + Estado = "QUE", + PaisId = "MEX", + CodigoPostal = "76199" + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Traslado Mercancia Propia (USD, T) + private async void FacturaCETrasladoTrasladoMercanciaPropiaButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "USD", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "My description...", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + MotivoTrasladoId = "02", + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FCA", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "SW Street.", NumeroExterior = "12345", Localidad = "Oregon", + Estado = "OR", PaisId = "USA", CodigoPostal = "12345" + } + }, + Destinatarios = new List + { + new Destinatario + { + NumRegIdTrib = "123456789", + Nombre = "EKU9003173C9", + Domicilios = new List + { + new DestinatarioDomicilio + { + Calle = "SW Street.", NumeroExterior = "12345", Localidad = "Oregon", + Estado = "OR", PaisId = "USA", CodigoPostal = "12345" + } + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "0101210100", + CantidadAduana = 1, UnidadAduanaId = "07", + ValorUnitarioAduana = 22.64m, ValorDolares = 22.64m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Traslado (USD, T) + private async void FacturaCETrasladoTrasladoButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "USD", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: false), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Unidades De Medida No Equivalentes (USD, PPD) + private async void FacturaCEUnidadesDeMedidaNoEquivalentesButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "50201708", ItemSku = "131494-1055", Quantity = 1.000m, + UnitOfMeasurementCode = "H87", Description = "Bebida", UnitPrice = 100.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2009310201", + CantidadAduana = 0.500m, UnidadAduanaId = "08", + ValorUnitarioAduana = 200.00m, ValorDolares = 100.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Con Carta Porte 31 (XXX, T) + private async void FacturaCETrasladoConCartaPorte31Button_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "XXX", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = new InvoiceIssuer { Id = "2e7b988f-3a2a-4f67-86e9-3f931dd48581" }, + Recipient = new InvoiceRecipient { Id = "109f4d94-63ea-4a21-ab15-20c8b87d8ee9" }, + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", ItemSku = "TR01", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "TRANSPORTE DE CARGA", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + }, + new InvoiceItem + { + ItemCode = "32101622", ItemSku = "UT421511", Quantity = 100.00m, + UnitOfMeasurementCode = "XBX", Description = "MEMORIA FLASH", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "ALB", + ViaEntradaSalidaId = "01", + TotalDistRec = 120.00m, + UnidadPesoId = "KGM", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IDUbicacion = "OR000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Origen Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T08:00:00"), + Domicilio = new UbicacionDomicilio + { + Calle = "xola", NumeroExterior = "531", ColoniaId = "0496", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IDUbicacion = "DE000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Destino Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T20:00:00"), + DistanciaRecorrida = 120.00m, + Domicilio = new UbicacionDomicilio + { + Calle = "Av Coyoacan", NumeroExterior = "120", ColoniaId = "2624", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Gomitas", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1200.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + }, + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Pulparindo", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1000.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + } + }, + Autotransporte = new Autotransporte + { + PermSCTId = "TPAF02", NumPermisoSCT = "123456", ConfigVehicularId = "C2", + PesoBrutoVehicular = 1, PlacaVM = "555TTT", AnioModeloVM = 2023, + AseguraRespCivil = "ODISEA", PolizaRespCivil = "3456YUHNB234RT" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", RFCFigura = "KAHO641101B39", + NumLicencia = "D0908240", NombreFigura = "OSCAR KALA HAAK" + } + } + }, + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: false), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "UT421511", FraccionArancelariaId = "2402200100", + CantidadAduana = 100.00m, UnidadAduanaId = "01", + ValorUnitarioAduana = 1.00m, ValorDolares = 0.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + } +} diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.resx b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorReferenceForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.Designer.cs b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.Designer.cs new file mode 100644 index 0000000..892edde --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.Designer.cs @@ -0,0 +1,191 @@ +namespace FiscalApi.Samples.NetFramework +{ + partial class ComercioExteriorValuesForm + { + /// + /// 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.FacturaCEUnidadesDeMedidaNoEquivalentesButton = new System.Windows.Forms.Button(); + this.FacturaCETrasladoTrasladoButton = new System.Windows.Forms.Button(); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton = new System.Windows.Forms.Button(); + this.FacturaCEReceptorNacionalButton = new System.Windows.Forms.Button(); + this.FacturaCEReceptorExtranjeroButton = new System.Windows.Forms.Button(); + this.FacturaCEKitParteButton = new System.Windows.Forms.Button(); + this.FacturaCEIngresoDiferentesMonedasButton = new System.Windows.Forms.Button(); + this.FacturaCEIngresoConCartaPorte31Button = new System.Windows.Forms.Button(); + this.FacturaCETrasladoConCartaPorte31Button = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.FacturaCEUnidadesDeMedidaNoEquivalentesButton); + this.groupBox1.Controls.Add(this.FacturaCETrasladoTrasladoButton); + this.groupBox1.Controls.Add(this.FacturaCETrasladoTrasladoMercanciaPropiaButton); + this.groupBox1.Controls.Add(this.FacturaCEReceptorNacionalButton); + this.groupBox1.Controls.Add(this.FacturaCEReceptorExtranjeroButton); + this.groupBox1.Controls.Add(this.FacturaCEKitParteButton); + this.groupBox1.Controls.Add(this.FacturaCEIngresoDiferentesMonedasButton); + this.groupBox1.Controls.Add(this.FacturaCEIngresoConCartaPorte31Button); + this.groupBox1.Controls.Add(this.FacturaCETrasladoConCartaPorte31Button); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.groupBox1.Size = new System.Drawing.Size(897, 373); + this.groupBox1.TabIndex = 2; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Factura con complemento comercio exterior (Por valores) "; + // + // FacturaCEUnidadesDeMedidaNoEquivalentesButton + // + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Location = new System.Drawing.Point(300, 233); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Name = "FacturaCEUnidadesDeMedidaNoEquivalentesButton"; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.TabIndex = 8; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Text = "Factura CE Unidades De Medida No Equivalentes"; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.UseVisualStyleBackColor = true; + this.FacturaCEUnidadesDeMedidaNoEquivalentesButton.Click += new System.EventHandler(this.FacturaCEUnidadesDeMedidaNoEquivalentesButton_Click); + // + // FacturaCETrasladoTrasladoButton + // + this.FacturaCETrasladoTrasladoButton.Location = new System.Drawing.Point(8, 233); + this.FacturaCETrasladoTrasladoButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoTrasladoButton.Name = "FacturaCETrasladoTrasladoButton"; + this.FacturaCETrasladoTrasladoButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoTrasladoButton.TabIndex = 7; + this.FacturaCETrasladoTrasladoButton.Text = "Factura CE Traslado Traslado"; + this.FacturaCETrasladoTrasladoButton.UseVisualStyleBackColor = true; + this.FacturaCETrasladoTrasladoButton.Click += new System.EventHandler(this.FacturaCETrasladoTrasladoButton_Click); + // + // FacturaCETrasladoTrasladoMercanciaPropiaButton + // + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Location = new System.Drawing.Point(592, 133); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Name = "FacturaCETrasladoTrasladoMercanciaPropiaButton"; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.TabIndex = 6; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Text = "Factura CE Traslado Traslado Mercancia Propia"; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.UseVisualStyleBackColor = true; + this.FacturaCETrasladoTrasladoMercanciaPropiaButton.Click += new System.EventHandler(this.FacturaCETrasladoTrasladoMercanciaPropiaButton_Click); + // + // FacturaCEReceptorNacionalButton + // + this.FacturaCEReceptorNacionalButton.Location = new System.Drawing.Point(300, 133); + this.FacturaCEReceptorNacionalButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEReceptorNacionalButton.Name = "FacturaCEReceptorNacionalButton"; + this.FacturaCEReceptorNacionalButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEReceptorNacionalButton.TabIndex = 5; + this.FacturaCEReceptorNacionalButton.Text = "Factura CE Receptor Nacional"; + this.FacturaCEReceptorNacionalButton.UseVisualStyleBackColor = true; + this.FacturaCEReceptorNacionalButton.Click += new System.EventHandler(this.FacturaCEReceptorNacionalButton_Click); + // + // FacturaCEReceptorExtranjeroButton + // + this.FacturaCEReceptorExtranjeroButton.Location = new System.Drawing.Point(8, 133); + this.FacturaCEReceptorExtranjeroButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEReceptorExtranjeroButton.Name = "FacturaCEReceptorExtranjeroButton"; + this.FacturaCEReceptorExtranjeroButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEReceptorExtranjeroButton.TabIndex = 4; + this.FacturaCEReceptorExtranjeroButton.Text = "Factura CE Receptor Extranjero"; + this.FacturaCEReceptorExtranjeroButton.UseVisualStyleBackColor = true; + this.FacturaCEReceptorExtranjeroButton.Click += new System.EventHandler(this.FacturaCEReceptorExtranjeroButton_Click); + // + // FacturaCEKitParteButton + // + this.FacturaCEKitParteButton.Location = new System.Drawing.Point(592, 33); + this.FacturaCEKitParteButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEKitParteButton.Name = "FacturaCEKitParteButton"; + this.FacturaCEKitParteButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEKitParteButton.TabIndex = 3; + this.FacturaCEKitParteButton.Text = "Factura CE Kit Parte"; + this.FacturaCEKitParteButton.UseVisualStyleBackColor = true; + this.FacturaCEKitParteButton.Click += new System.EventHandler(this.FacturaCEKitParteButton_Click); + // + // FacturaCEIngresoDiferentesMonedasButton + // + this.FacturaCEIngresoDiferentesMonedasButton.Location = new System.Drawing.Point(300, 33); + this.FacturaCEIngresoDiferentesMonedasButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEIngresoDiferentesMonedasButton.Name = "FacturaCEIngresoDiferentesMonedasButton"; + this.FacturaCEIngresoDiferentesMonedasButton.Size = new System.Drawing.Size(284, 94); + this.FacturaCEIngresoDiferentesMonedasButton.TabIndex = 2; + this.FacturaCEIngresoDiferentesMonedasButton.Text = "Factura CE Ingreso Diferentes Monedas"; + this.FacturaCEIngresoDiferentesMonedasButton.UseVisualStyleBackColor = true; + this.FacturaCEIngresoDiferentesMonedasButton.Click += new System.EventHandler(this.FacturaCEIngresoDiferentesMonedasButton_Click); + // + // FacturaCEIngresoConCartaPorte31Button + // + this.FacturaCEIngresoConCartaPorte31Button.Location = new System.Drawing.Point(8, 33); + this.FacturaCEIngresoConCartaPorte31Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCEIngresoConCartaPorte31Button.Name = "FacturaCEIngresoConCartaPorte31Button"; + this.FacturaCEIngresoConCartaPorte31Button.Size = new System.Drawing.Size(284, 94); + this.FacturaCEIngresoConCartaPorte31Button.TabIndex = 1; + this.FacturaCEIngresoConCartaPorte31Button.Text = "Factura CE Ingreso Con Carta Porte 31"; + this.FacturaCEIngresoConCartaPorte31Button.UseVisualStyleBackColor = true; + this.FacturaCEIngresoConCartaPorte31Button.Click += new System.EventHandler(this.FacturaCEIngresoConCartaPorte31Button_Click); + // + // FacturaCETrasladoConCartaPorte31Button + // + this.FacturaCETrasladoConCartaPorte31Button.Location = new System.Drawing.Point(592, 233); + this.FacturaCETrasladoConCartaPorte31Button.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.FacturaCETrasladoConCartaPorte31Button.Name = "FacturaCETrasladoConCartaPorte31Button"; + this.FacturaCETrasladoConCartaPorte31Button.Size = new System.Drawing.Size(284, 94); + this.FacturaCETrasladoConCartaPorte31Button.TabIndex = 9; + this.FacturaCETrasladoConCartaPorte31Button.Text = "Factura CE Traslado Con Carta Porte 31"; + this.FacturaCETrasladoConCartaPorte31Button.UseVisualStyleBackColor = true; + this.FacturaCETrasladoConCartaPorte31Button.Click += new System.EventHandler(this.FacturaCETrasladoConCartaPorte31Button_Click); + // + // ComercioExteriorValuesForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(897, 373); + this.Controls.Add(this.groupBox1); + this.Name = "ComercioExteriorValuesForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ComercioExteriorValuesForm"; + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button FacturaCEUnidadesDeMedidaNoEquivalentesButton; + private System.Windows.Forms.Button FacturaCETrasladoTrasladoButton; + private System.Windows.Forms.Button FacturaCETrasladoTrasladoMercanciaPropiaButton; + private System.Windows.Forms.Button FacturaCEReceptorNacionalButton; + private System.Windows.Forms.Button FacturaCEReceptorExtranjeroButton; + private System.Windows.Forms.Button FacturaCEKitParteButton; + private System.Windows.Forms.Button FacturaCEIngresoDiferentesMonedasButton; + private System.Windows.Forms.Button FacturaCEIngresoConCartaPorte31Button; + private System.Windows.Forms.Button FacturaCETrasladoConCartaPorte31Button; + } +} \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.cs b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.cs new file mode 100644 index 0000000..0a32600 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.cs @@ -0,0 +1,887 @@ +using Fiscalapi.Common; +using Fiscalapi.Models; +using Fiscalapi.Models.BillOfLading; +using Fiscalapi.Models.ForeignTrade; +using Fiscalapi.Services; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace FiscalApi.Samples.NetFramework +{ + public partial class ComercioExteriorValuesForm : Form + { + private FiscalapiSettings _settings; + + public ComercioExteriorValuesForm(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 InvoiceRecipient CreateForeignRecipient(string legalName = "Persona Fisica Extranjera", string cfdiUseCode = "S01") + { + return new InvoiceRecipient + { + Tin = "XEXX010101000", + LegalName = legalName, + ZipCode = "42501", + TaxRegimeCode = "616", + CfdiUseCode = cfdiUseCode, + CountryId = "USA", + ForeignTin = "123456789" + }; + } + + private InvoiceRecipient CreateNationalRecipient() + { + return new InvoiceRecipient + { + Tin = "URE180429TM6", + LegalName = "UNIVERSIDAD ROBOTICA ESPAÑOLA", + ZipCode = "86991", + TaxRegimeCode = "601", + CfdiUseCode = "G01" + }; + } + + private InvoiceRecipient CreateSelfRecipient(string cfdiUseCode = "S01") + { + return new InvoiceRecipient + { + Tin = "EKU9003173C9", + LegalName = "ESCUELA KEMPER URGATE", + ZipCode = "42501", + TaxRegimeCode = "601", + CfdiUseCode = cfdiUseCode + }; + } + + private Emisor CreateCommonEmisor() + { + return new Emisor + { + Domicilio = new EmisorDomicilio + { + Calle = "CALLE DEL PAPEL", + ColoniaId = "0214", + LocalidadId = "01", + MunicipioId = "014", + EstadoId = "QUE", + PaisId = "MEX", + CodigoPostalId = "76199" + } + }; + } + + private Receptor CreateCommonReceptorTX(bool includeNumRegIdTrib) + { + var receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "ST. A", + Estado = "TX", + PaisId = "USA", + CodigoPostal = "00000" + } + }; + if (includeNumRegIdTrib) receptor.NumRegIdTrib = "123456789"; + return receptor; + } + + private void ShowResult(ApiResponse apiResponse) + { + if (apiResponse.Succeeded) + MessageBox.Show("Timbrada: " + apiResponse.Succeeded); + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } + + // Factura CE Ingreso Con Carta Porte 31 (USD, PUE) + private async void FacturaCEIngresoConCartaPorte31Button_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PUE", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateForeignRecipient(), + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", ItemSku = "SERV02", Quantity = 1.000000m, + UnitOfMeasurementCode = "HUR", Description = "FLETE", UnitPrice = 2300.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "003", TaxTypeCode = "Tasa", TaxRate = 0.300000m, TaxFlagCode = "R" } + } + }, + new InvoiceItem + { + ItemCode = "50161509", ItemSku = "A0001", Quantity = 1.000000m, + UnitOfMeasurementCode = "H87", Description = "Gomitas", UnitPrice = 120.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" } + } + }, + new InvoiceItem + { + ItemCode = "50307037", ItemSku = "A0002", Quantity = 1.000000m, + UnitOfMeasurementCode = "H87", Description = "Pulparindo", UnitPrice = 100.000000m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" } + } + } + }, + Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "ALB", + ViaEntradaSalidaId = "01", + TotalDistRec = 120.00m, + UnidadPesoId = "KGM", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IDUbicacion = "OR000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Origen Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T08:00:00"), + Domicilio = new UbicacionDomicilio + { + Calle = "xola", NumeroExterior = "531", ColoniaId = "0496", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IDUbicacion = "DE000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Destino Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T20:00:00"), + DistanciaRecorrida = 120.00m, + Domicilio = new UbicacionDomicilio + { + Calle = "Av Coyoacan", NumeroExterior = "120", ColoniaId = "2624", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Gomitas", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1200.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + }, + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Pulparindo", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1000.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + } + }, + Autotransporte = new Autotransporte + { + PermSCTId = "TPAF02", + NumPermisoSCT = "123456", + ConfigVehicularId = "C2", + PesoBrutoVehicular = 1, + PlacaVM = "555TTT", + AnioModeloVM = 2023, + AseguraRespCivil = "ODISEA", + PolizaRespCivil = "3456YUHNB234RT" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", RFCFigura = "KAHO641101B39", + NumLicencia = "D0908240", NombreFigura = "OSCAR KALA HAAK" + } + } + }, + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "CIF", + TipoCambioUSD = 17.2530m, + Emisor = new Emisor + { + Domicilio = new EmisorDomicilio + { + Calle = "Av Siempre viva", + NumeroExterior = "123", + ColoniaId = "0001", + LocalidadId = "06", + MunicipioId = "025", + EstadoId = "COA", + PaisId = "MEX", + CodigoPostalId = "26015" + } + }, + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "Clinton ST", + NumeroExterior = "10002", + Estado = "NY", + PaisId = "USA", + CodigoPostal = "10002-0000" + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "A0001", FraccionArancelariaId = "4011101099", + CantidadAduana = 1.000m, UnidadAduanaId = "06", + ValorUnitarioAduana = 120.00m, ValorDolares = 120.00m + }, + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "A0002", FraccionArancelariaId = "8407210299", + CantidadAduana = 1.000m, UnidadAduanaId = "06", + ValorUnitarioAduana = 100.00m, ValorDolares = 100.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Ingreso Diferentes Monedas (MXN, PPD) + private async void FacturaCEIngresoDiferentesMonedasButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateForeignRecipient(), + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 2.00m, UnidadAduanaId = "01", + ValorUnitarioAduana = 11.74m, ValorDolares = 23.47m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Kit Parte (MXN, PUE) + private async void FacturaCEKitParteButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "01", + PaymentMethodCode = "PUE", + CurrencyCode = "MXN", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateForeignRecipient("U.S. 0026 SW", "CP01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "51241200", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "FORMULA MAGISTRAL", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + }, + new InvoiceItem + { + ItemCode = "51241200", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "FORMULA MAGISTRAL", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 2, UnidadAduanaId = "01", + ValorUnitarioAduana = 10.00m, ValorDolares = 20.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Receptor Extranjero (USD, PPD) + private async void FacturaCEReceptorExtranjeroButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateForeignRecipient("U.S. 0026 SW", "CP01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Receptor Nacional (USD, PPD) + private async void FacturaCEReceptorNacionalButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateNationalRecipient(), + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "CALLE DEL PAPEL", + Colonia = "0214", + Localidad = "01", + Municipio = "014", + Estado = "QUE", + PaisId = "MEX", + CodigoPostal = "76199" + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Traslado Mercancia Propia (USD, T) + private async void FacturaCETrasladoTrasladoMercanciaPropiaButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "USD", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateSelfRecipient("S01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "My description...", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + MotivoTrasladoId = "02", + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FCA", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = new Receptor + { + Domicilio = new ReceptorDomicilio + { + Calle = "SW Street.", NumeroExterior = "12345", Localidad = "Oregon", + Estado = "OR", PaisId = "USA", CodigoPostal = "12345" + } + }, + Destinatarios = new List + { + new Destinatario + { + NumRegIdTrib = "123456789", + Nombre = "EKU9003173C9", + Domicilios = new List + { + new DestinatarioDomicilio + { + Calle = "SW Street.", NumeroExterior = "12345", Localidad = "Oregon", + Estado = "OR", PaisId = "USA", CodigoPostal = "12345" + } + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "0101210100", + CantidadAduana = 1, UnidadAduanaId = "07", + ValorUnitarioAduana = 22.64m, ValorDolares = 22.64m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Traslado (USD, T) + private async void FacturaCETrasladoTrasladoButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "USD", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateSelfRecipient("G01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "50211503", ItemSku = "131494-1055", Quantity = 2, + UnitOfMeasurementCode = "H87", Description = "Cigarros", UnitPrice = 200.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: false), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2402200100", + CantidadAduana = 117.64m, UnidadAduanaId = "01", + ValorUnitarioAduana = 3.40m, ValorDolares = 400.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Unidades De Medida No Equivalentes (USD, PPD) + private async void FacturaCEUnidadesDeMedidaNoEquivalentesButton_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentFormCode = "99", + PaymentMethodCode = "PPD", + CurrencyCode = "USD", + TypeCode = "I", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + PaymentConditions = "CondicionesDePago", + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateForeignRecipient("U.S. 0026 SW", "CP01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "50201708", ItemSku = "131494-1055", Quantity = 1.000m, + UnitOfMeasurementCode = "H87", Description = "Bebida", UnitPrice = 100.00m, + Discount = 0, TaxObjectCode = "02", + ItemTaxes = new List + { + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.160000m, TaxFlagCode = "T" }, + new InvoiceItemTax { TaxCode = "001", TaxTypeCode = "Tasa", TaxRate = 0.100000m, TaxFlagCode = "R" }, + new InvoiceItemTax { TaxCode = "002", TaxTypeCode = "Tasa", TaxRate = 0.106666m, TaxFlagCode = "R" } + } + } + }, + Complement = new Complement + { + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: true), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "131494-1055", FraccionArancelariaId = "2009310201", + CantidadAduana = 0.500m, UnidadAduanaId = "08", + ValorUnitarioAduana = 200.00m, ValorDolares = 100.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + + // Factura CE Traslado Con Carta Porte 31 (XXX, T) + private async void FacturaCETrasladoConCartaPorte31Button_Click(object sender, EventArgs e) + { + var fiscalApi = FiscalApiClient.Create(_settings); + + var invoice = new Invoice + { + VersionCode = "4.0", + PaymentMethodCode = null, + CurrencyCode = "XXX", + TypeCode = "T", + ExpeditionZipCode = "42501", + Series = "CCE", + Date = DateTime.Parse("2026-05-08T08:56:40"), + ExportCode = "02", + Issuer = CreateIssuer(), + Recipient = CreateSelfRecipient("S01"), + Items = new List + { + new InvoiceItem + { + ItemCode = "78101800", ItemSku = "TR01", Quantity = 1.0m, + UnitOfMeasurementCode = "H87", Description = "TRANSPORTE DE CARGA", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + }, + new InvoiceItem + { + ItemCode = "32101622", ItemSku = "UT421511", Quantity = 100.00m, + UnitOfMeasurementCode = "XBX", Description = "MEMORIA FLASH", UnitPrice = 0.00m, + Discount = 0, TaxObjectCode = "01", ItemTaxes = new List() + } + }, + Complement = new Complement + { + CartaPorte = new CartaPorte + { + TranspInternacId = "Sí", + EntradaSalidaMercId = "Salida", + PaisOrigenDestinoId = "ALB", + ViaEntradaSalidaId = "01", + TotalDistRec = 120.00m, + UnidadPesoId = "KGM", + RegimenAduaneros = new List + { + new RegimenAduanero { RegimenAduaneroId = "EXD" } + }, + Ubicaciones = new List + { + new Ubicacion + { + TipoUbicacion = "Origen", IDUbicacion = "OR000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Origen Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T08:00:00"), + Domicilio = new UbicacionDomicilio + { + Calle = "xola", NumeroExterior = "531", ColoniaId = "0496", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + }, + new Ubicacion + { + TipoUbicacion = "Destino", IDUbicacion = "DE000001", + RFCRemitenteDestinatario = "XAXX010101000", NombreRemitenteDestinatario = "Destino Nacional", + FechaHoraSalidaLlegada = DateTime.Parse("2026-04-27T20:00:00"), + DistanciaRecorrida = 120.00m, + Domicilio = new UbicacionDomicilio + { + Calle = "Av Coyoacan", NumeroExterior = "120", ColoniaId = "2624", + LocalidadId = "03", MunicipioId = "014", EstadoId = "CMX", + PaisId = "MEX", CodigoPostalId = "03100" + } + } + }, + Mercancias = new List + { + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Gomitas", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1200.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + }, + new Fiscalapi.Models.BillOfLading.Mercancia + { + BienesTranspId = "50433238", Descripcion = "Pulparindo", Cantidad = 1, + ClaveUnidadId = "XPK", PesoEnKg = 10.000m, ValorMercancia = 1000.00m, + MonedaId = "USD", FraccionArancelariaId = "2005800100", TipoMateriaId = "04" + } + }, + Autotransporte = new Autotransporte + { + PermSCTId = "TPAF02", NumPermisoSCT = "123456", ConfigVehicularId = "C2", + PesoBrutoVehicular = 1, PlacaVM = "555TTT", AnioModeloVM = 2023, + AseguraRespCivil = "ODISEA", PolizaRespCivil = "3456YUHNB234RT" + }, + TiposFigura = new List + { + new TipoFigura + { + TipoFiguraId = "01", RFCFigura = "KAHO641101B39", + NumLicencia = "D0908240", NombreFigura = "OSCAR KALA HAAK" + } + } + }, + ComercioExterior = new ComercioExterior + { + ClaveDePedimentoId = "A1", + CertificadoOrigen = 0, + IncotermId = "FOB", + TipoCambioUSD = 17.2530m, + Emisor = CreateCommonEmisor(), + Receptor = CreateCommonReceptorTX(includeNumRegIdTrib: false), + Mercancias = new List + { + new Fiscalapi.Models.ForeignTrade.Mercancia + { + NoIdentificacion = "UT421511", FraccionArancelariaId = "2402200100", + CantidadAduana = 100.00m, UnidadAduanaId = "01", + ValorUnitarioAduana = 1.00m, ValorDolares = 0.00m + } + } + } + } + }; + + var apiResponse = await fiscalApi.Invoices.CreateAsync(invoice); + ShowResult(apiResponse); + } + } +} diff --git a/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.resx b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FiscalApi.Samples.NetFramework/ComercioExteriorValuesForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj b/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj index ab374bb..1ffd501 100644 --- a/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj +++ b/FiscalApi.Samples.NetFramework/FiscalApi.Samples.NetFramework.csproj @@ -8,7 +8,7 @@ WinExe FiscalApi.Samples.NetFramework FiscalApi.Samples.NetFramework - v4.6.1 + v4.6.2 512 true true @@ -33,8 +33,8 @@ 4 - - ..\packages\Fiscalapi.4.0.360\lib\net461\Fiscalapi.dll + + ..\packages\Fiscalapi.4.0.385\lib\net461\Fiscalapi.dll ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll @@ -97,6 +97,9 @@ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + @@ -108,6 +111,30 @@ + + Form + + + BillOfLadingReferenceForm.cs + + + Form + + + BillOfLadingValueForm.cs + + + Form + + + ComercioExteriorReferenceForm.cs + + + Form + + + ComercioExteriorValuesForm.cs + Form @@ -219,6 +246,12 @@ + + ComercioExteriorReferenceForm.cs + + + ComercioExteriorValuesForm.cs + DownloadRequestsForm.cs @@ -279,6 +312,7 @@ True Resources.resx + SettingsSingleFileGenerator diff --git a/FiscalApi.Samples.NetFramework/Form1.Designer.cs b/FiscalApi.Samples.NetFramework/Form1.Designer.cs index 957c296..1e7b9f0 100644 --- a/FiscalApi.Samples.NetFramework/Form1.Designer.cs +++ b/FiscalApi.Samples.NetFramework/Form1.Designer.cs @@ -69,21 +69,6 @@ private void InitializeComponent() this.CertDefaultRefs = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.groupBox10 = new System.Windows.Forms.GroupBox(); - this.groupBox11 = new System.Windows.Forms.GroupBox(); - this.button6 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.button5 = new System.Windows.Forms.Button(); - this.button4 = new System.Windows.Forms.Button(); - this.groupBox13 = new System.Windows.Forms.GroupBox(); - this.button17 = new System.Windows.Forms.Button(); - this.button16 = new System.Windows.Forms.Button(); - this.button15 = new System.Windows.Forms.Button(); - this.button14 = new System.Windows.Forms.Button(); - this.groupBox12 = new System.Windows.Forms.GroupBox(); - this.button13 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.BuscarSolicitud = new System.Windows.Forms.Button(); @@ -106,6 +91,23 @@ private void InitializeComponent() this.groupBox7 = new System.Windows.Forms.GroupBox(); this.ListarDownloadCatalogo = new System.Windows.Forms.Button(); this.ListarDownloadCatalogos = new System.Windows.Forms.Button(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.groupBox14 = new System.Windows.Forms.GroupBox(); + this.FirmarButton = new System.Windows.Forms.Button(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.groupBox11 = new System.Windows.Forms.GroupBox(); + this.button6 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.groupBox13 = new System.Windows.Forms.GroupBox(); + this.button17 = new System.Windows.Forms.Button(); + this.button16 = new System.Windows.Forms.Button(); + this.button15 = new System.Windows.Forms.Button(); + this.button14 = new System.Windows.Forms.Button(); + this.groupBox12 = new System.Windows.Forms.GroupBox(); + this.button13 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -113,23 +115,24 @@ private void InitializeComponent() this.groupBox5.SuspendLayout(); this.groupBox6.SuspendLayout(); this.tabControl1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.groupBox9.SuspendLayout(); + this.groupBox8.SuspendLayout(); + this.groupBox7.SuspendLayout(); this.tabPage1.SuspendLayout(); + this.groupBox14.SuspendLayout(); this.groupBox10.SuspendLayout(); this.groupBox11.SuspendLayout(); this.groupBox13.SuspendLayout(); this.groupBox12.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.groupBox9.SuspendLayout(); - this.groupBox8.SuspendLayout(); - this.groupBox7.SuspendLayout(); this.SuspendLayout(); // // ObtenerFacturaById // - this.ObtenerFacturaById.Location = new System.Drawing.Point(7, 155); - this.ObtenerFacturaById.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerFacturaById.Location = new System.Drawing.Point(10, 242); + this.ObtenerFacturaById.Margin = new System.Windows.Forms.Padding(6); this.ObtenerFacturaById.Name = "ObtenerFacturaById"; - this.ObtenerFacturaById.Size = new System.Drawing.Size(147, 60); + this.ObtenerFacturaById.Size = new System.Drawing.Size(220, 94); this.ObtenerFacturaById.TabIndex = 0; this.ObtenerFacturaById.Text = "Obtener factura por ID"; this.ObtenerFacturaById.UseVisualStyleBackColor = true; @@ -137,10 +140,10 @@ private void InitializeComponent() // // ObtenerFacturaXMLById // - this.ObtenerFacturaXMLById.Location = new System.Drawing.Point(162, 88); - this.ObtenerFacturaXMLById.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerFacturaXMLById.Location = new System.Drawing.Point(243, 138); + this.ObtenerFacturaXMLById.Margin = new System.Windows.Forms.Padding(6); this.ObtenerFacturaXMLById.Name = "ObtenerFacturaXMLById"; - this.ObtenerFacturaXMLById.Size = new System.Drawing.Size(147, 60); + this.ObtenerFacturaXMLById.Size = new System.Drawing.Size(220, 94); this.ObtenerFacturaXMLById.TabIndex = 11; this.ObtenerFacturaXMLById.Text = "Obtener Factura XML By Id"; this.ObtenerFacturaXMLById.UseVisualStyleBackColor = true; @@ -153,20 +156,21 @@ private void InitializeComponent() this.groupBox2.Controls.Add(this.ObtenerListaPaginadaInvoices); this.groupBox2.Controls.Add(this.ObtenerFacturaById); this.groupBox2.Controls.Add(this.ObtenerFacturaXMLById); - this.groupBox2.Location = new System.Drawing.Point(4, 8); - this.groupBox2.Margin = new System.Windows.Forms.Padding(4); + this.groupBox2.Location = new System.Drawing.Point(6, 12); + this.groupBox2.Margin = new System.Windows.Forms.Padding(6); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(4); - this.groupBox2.Size = new System.Drawing.Size(320, 223); + this.groupBox2.Padding = new System.Windows.Forms.Padding(6); + this.groupBox2.Size = new System.Drawing.Size(480, 348); this.groupBox2.TabIndex = 16; this.groupBox2.TabStop = false; this.groupBox2.Text = "FACTURACION"; // // button11 // - this.button11.Location = new System.Drawing.Point(7, 88); + this.button11.Location = new System.Drawing.Point(10, 138); + this.button11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button11.Name = "button11"; - this.button11.Size = new System.Drawing.Size(147, 60); + this.button11.Size = new System.Drawing.Size(220, 94); this.button11.TabIndex = 22; this.button11.Text = "Facturación por referencias"; this.button11.UseVisualStyleBackColor = true; @@ -174,9 +178,10 @@ private void InitializeComponent() // // button12 // - this.button12.Location = new System.Drawing.Point(7, 22); + this.button12.Location = new System.Drawing.Point(10, 34); + this.button12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button12.Name = "button12"; - this.button12.Size = new System.Drawing.Size(147, 60); + this.button12.Size = new System.Drawing.Size(220, 94); this.button12.TabIndex = 21; this.button12.Text = "Facturación por valores"; this.button12.UseVisualStyleBackColor = true; @@ -184,10 +189,10 @@ private void InitializeComponent() // // ObtenerListaPaginadaInvoices // - this.ObtenerListaPaginadaInvoices.Location = new System.Drawing.Point(162, 23); - this.ObtenerListaPaginadaInvoices.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerListaPaginadaInvoices.Location = new System.Drawing.Point(243, 36); + this.ObtenerListaPaginadaInvoices.Margin = new System.Windows.Forms.Padding(6); this.ObtenerListaPaginadaInvoices.Name = "ObtenerListaPaginadaInvoices"; - this.ObtenerListaPaginadaInvoices.Size = new System.Drawing.Size(147, 60); + this.ObtenerListaPaginadaInvoices.Size = new System.Drawing.Size(220, 94); this.ObtenerListaPaginadaInvoices.TabIndex = 14; this.ObtenerListaPaginadaInvoices.Text = "Obtener Lista Paginada"; this.ObtenerListaPaginadaInvoices.UseVisualStyleBackColor = true; @@ -202,21 +207,21 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.ActualizarPersona); this.groupBox1.Controls.Add(this.CrearPersona); this.groupBox1.Controls.Add(this.ObtenerPersonaPorID); - this.groupBox1.Location = new System.Drawing.Point(4, 324); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4); + this.groupBox1.Location = new System.Drawing.Point(6, 506); + this.groupBox1.Margin = new System.Windows.Forms.Padding(6); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4); - this.groupBox1.Size = new System.Drawing.Size(320, 314); + this.groupBox1.Padding = new System.Windows.Forms.Padding(6); + this.groupBox1.Size = new System.Drawing.Size(480, 491); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "PERSONAS (Emisores, receptores, usuarios, clientes etc)"; // // button8 // - this.button8.Location = new System.Drawing.Point(7, 106); - this.button8.Margin = new System.Windows.Forms.Padding(4); + this.button8.Location = new System.Drawing.Point(10, 166); + this.button8.Margin = new System.Windows.Forms.Padding(6); this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(147, 60); + this.button8.Size = new System.Drawing.Size(220, 94); this.button8.TabIndex = 12; this.button8.Text = "Datos de empleado"; this.button8.UseVisualStyleBackColor = true; @@ -224,10 +229,10 @@ private void InitializeComponent() // // button7 // - this.button7.Location = new System.Drawing.Point(8, 40); - this.button7.Margin = new System.Windows.Forms.Padding(4); + this.button7.Location = new System.Drawing.Point(12, 62); + this.button7.Margin = new System.Windows.Forms.Padding(6); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(147, 60); + this.button7.Size = new System.Drawing.Size(220, 94); this.button7.TabIndex = 11; this.button7.Text = "Datos de empleador"; this.button7.UseVisualStyleBackColor = true; @@ -235,10 +240,10 @@ private void InitializeComponent() // // ObtenerListaPaginada // - this.ObtenerListaPaginada.Location = new System.Drawing.Point(7, 174); - this.ObtenerListaPaginada.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerListaPaginada.Location = new System.Drawing.Point(10, 272); + this.ObtenerListaPaginada.Margin = new System.Windows.Forms.Padding(6); this.ObtenerListaPaginada.Name = "ObtenerListaPaginada"; - this.ObtenerListaPaginada.Size = new System.Drawing.Size(147, 60); + this.ObtenerListaPaginada.Size = new System.Drawing.Size(220, 94); this.ObtenerListaPaginada.TabIndex = 5; this.ObtenerListaPaginada.Text = "Obtener lista paginada"; this.ObtenerListaPaginada.UseVisualStyleBackColor = true; @@ -246,10 +251,10 @@ private void InitializeComponent() // // BorrarPersona // - this.BorrarPersona.Location = new System.Drawing.Point(162, 174); - this.BorrarPersona.Margin = new System.Windows.Forms.Padding(4); + this.BorrarPersona.Location = new System.Drawing.Point(243, 272); + this.BorrarPersona.Margin = new System.Windows.Forms.Padding(6); this.BorrarPersona.Name = "BorrarPersona"; - this.BorrarPersona.Size = new System.Drawing.Size(147, 60); + this.BorrarPersona.Size = new System.Drawing.Size(220, 94); this.BorrarPersona.TabIndex = 4; this.BorrarPersona.Text = "Borrar persona"; this.BorrarPersona.UseVisualStyleBackColor = true; @@ -257,10 +262,10 @@ private void InitializeComponent() // // ActualizarPersona // - this.ActualizarPersona.Location = new System.Drawing.Point(162, 40); - this.ActualizarPersona.Margin = new System.Windows.Forms.Padding(4); + this.ActualizarPersona.Location = new System.Drawing.Point(243, 62); + this.ActualizarPersona.Margin = new System.Windows.Forms.Padding(6); this.ActualizarPersona.Name = "ActualizarPersona"; - this.ActualizarPersona.Size = new System.Drawing.Size(147, 60); + this.ActualizarPersona.Size = new System.Drawing.Size(220, 94); this.ActualizarPersona.TabIndex = 3; this.ActualizarPersona.Text = "Actualizar persona"; this.ActualizarPersona.UseVisualStyleBackColor = true; @@ -268,10 +273,10 @@ private void InitializeComponent() // // CrearPersona // - this.CrearPersona.Location = new System.Drawing.Point(162, 106); - this.CrearPersona.Margin = new System.Windows.Forms.Padding(4); + this.CrearPersona.Location = new System.Drawing.Point(243, 166); + this.CrearPersona.Margin = new System.Windows.Forms.Padding(6); this.CrearPersona.Name = "CrearPersona"; - this.CrearPersona.Size = new System.Drawing.Size(147, 60); + this.CrearPersona.Size = new System.Drawing.Size(220, 94); this.CrearPersona.TabIndex = 2; this.CrearPersona.Text = "Crear Persona"; this.CrearPersona.UseVisualStyleBackColor = true; @@ -279,10 +284,10 @@ private void InitializeComponent() // // ObtenerPersonaPorID // - this.ObtenerPersonaPorID.Location = new System.Drawing.Point(7, 242); - this.ObtenerPersonaPorID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerPersonaPorID.Location = new System.Drawing.Point(10, 378); + this.ObtenerPersonaPorID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerPersonaPorID.Name = "ObtenerPersonaPorID"; - this.ObtenerPersonaPorID.Size = new System.Drawing.Size(147, 60); + this.ObtenerPersonaPorID.Size = new System.Drawing.Size(220, 94); this.ObtenerPersonaPorID.TabIndex = 1; this.ObtenerPersonaPorID.Text = "Obtener persona por ID"; this.ObtenerPersonaPorID.UseVisualStyleBackColor = true; @@ -290,10 +295,10 @@ private void InitializeComponent() // // EliEliminaCertificado // - this.EliEliminaCertificado.Location = new System.Drawing.Point(194, 91); - this.EliEliminaCertificado.Margin = new System.Windows.Forms.Padding(4); + this.EliEliminaCertificado.Location = new System.Drawing.Point(291, 142); + this.EliEliminaCertificado.Margin = new System.Windows.Forms.Padding(6); this.EliEliminaCertificado.Name = "EliEliminaCertificado"; - this.EliEliminaCertificado.Size = new System.Drawing.Size(147, 60); + this.EliEliminaCertificado.Size = new System.Drawing.Size(220, 94); this.EliEliminaCertificado.TabIndex = 8; this.EliEliminaCertificado.Text = "Elimina Certificado de una persona"; this.EliEliminaCertificado.UseVisualStyleBackColor = true; @@ -301,10 +306,10 @@ private void InitializeComponent() // // ObtenerCertificadoById // - this.ObtenerCertificadoById.Location = new System.Drawing.Point(7, 91); - this.ObtenerCertificadoById.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerCertificadoById.Location = new System.Drawing.Point(10, 142); + this.ObtenerCertificadoById.Margin = new System.Windows.Forms.Padding(6); this.ObtenerCertificadoById.Name = "ObtenerCertificadoById"; - this.ObtenerCertificadoById.Size = new System.Drawing.Size(147, 60); + this.ObtenerCertificadoById.Size = new System.Drawing.Size(220, 94); this.ObtenerCertificadoById.TabIndex = 7; this.ObtenerCertificadoById.Text = "Obtener Certificado by Id"; this.ObtenerCertificadoById.UseVisualStyleBackColor = true; @@ -312,10 +317,10 @@ private void InitializeComponent() // // CargarCertificados // - this.CargarCertificados.Location = new System.Drawing.Point(194, 23); - this.CargarCertificados.Margin = new System.Windows.Forms.Padding(4); + this.CargarCertificados.Location = new System.Drawing.Point(291, 36); + this.CargarCertificados.Margin = new System.Windows.Forms.Padding(6); this.CargarCertificados.Name = "CargarCertificados"; - this.CargarCertificados.Size = new System.Drawing.Size(147, 60); + this.CargarCertificados.Size = new System.Drawing.Size(220, 94); this.CargarCertificados.TabIndex = 6; this.CargarCertificados.Text = "Crear certificado (cargar cert a una persona)"; this.CargarCertificados.UseVisualStyleBackColor = true; @@ -323,7 +328,6 @@ private void InitializeComponent() // // groupBox3 // - this.groupBox3.Anchor = System.Windows.Forms.AnchorStyles.None; this.groupBox3.Controls.Add(this.ActualizarImpuestosProducto); this.groupBox3.Controls.Add(this.ObtenerImpuestosProducto); this.groupBox3.Controls.Add(this.ObtenerProductosPagedList); @@ -331,11 +335,11 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.ActualizarProducto); this.groupBox3.Controls.Add(this.CrearProducto); this.groupBox3.Controls.Add(this.ObtenerProductoById); - this.groupBox3.Location = new System.Drawing.Point(332, 493); - this.groupBox3.Margin = new System.Windows.Forms.Padding(4); + this.groupBox3.Location = new System.Drawing.Point(501, 771); + this.groupBox3.Margin = new System.Windows.Forms.Padding(6); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Padding = new System.Windows.Forms.Padding(4); - this.groupBox3.Size = new System.Drawing.Size(373, 310); + this.groupBox3.Padding = new System.Windows.Forms.Padding(6); + this.groupBox3.Size = new System.Drawing.Size(560, 484); this.groupBox3.TabIndex = 18; this.groupBox3.TabStop = false; this.groupBox3.Text = "Productos"; @@ -343,10 +347,10 @@ private void InitializeComponent() // ActualizarImpuestosProducto // this.ActualizarImpuestosProducto.Anchor = System.Windows.Forms.AnchorStyles.None; - this.ActualizarImpuestosProducto.Location = new System.Drawing.Point(199, 156); - this.ActualizarImpuestosProducto.Margin = new System.Windows.Forms.Padding(4); + this.ActualizarImpuestosProducto.Location = new System.Drawing.Point(298, 244); + this.ActualizarImpuestosProducto.Margin = new System.Windows.Forms.Padding(6); this.ActualizarImpuestosProducto.Name = "ActualizarImpuestosProducto"; - this.ActualizarImpuestosProducto.Size = new System.Drawing.Size(147, 60); + this.ActualizarImpuestosProducto.Size = new System.Drawing.Size(220, 94); this.ActualizarImpuestosProducto.TabIndex = 12; this.ActualizarImpuestosProducto.Text = "Actualizar impuestos"; this.ActualizarImpuestosProducto.UseVisualStyleBackColor = true; @@ -355,10 +359,10 @@ private void InitializeComponent() // ObtenerImpuestosProducto // this.ObtenerImpuestosProducto.Anchor = System.Windows.Forms.AnchorStyles.None; - this.ObtenerImpuestosProducto.Location = new System.Drawing.Point(12, 156); - this.ObtenerImpuestosProducto.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerImpuestosProducto.Location = new System.Drawing.Point(18, 244); + this.ObtenerImpuestosProducto.Margin = new System.Windows.Forms.Padding(6); this.ObtenerImpuestosProducto.Name = "ObtenerImpuestosProducto"; - this.ObtenerImpuestosProducto.Size = new System.Drawing.Size(147, 60); + this.ObtenerImpuestosProducto.Size = new System.Drawing.Size(220, 94); this.ObtenerImpuestosProducto.TabIndex = 11; this.ObtenerImpuestosProducto.Text = "Obtener impuestos"; this.ObtenerImpuestosProducto.UseVisualStyleBackColor = true; @@ -367,10 +371,10 @@ private void InitializeComponent() // ObtenerProductosPagedList // this.ObtenerProductosPagedList.Anchor = System.Windows.Forms.AnchorStyles.None; - this.ObtenerProductosPagedList.Location = new System.Drawing.Point(12, 21); - this.ObtenerProductosPagedList.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerProductosPagedList.Location = new System.Drawing.Point(18, 33); + this.ObtenerProductosPagedList.Margin = new System.Windows.Forms.Padding(6); this.ObtenerProductosPagedList.Name = "ObtenerProductosPagedList"; - this.ObtenerProductosPagedList.Size = new System.Drawing.Size(147, 60); + this.ObtenerProductosPagedList.Size = new System.Drawing.Size(220, 94); this.ObtenerProductosPagedList.TabIndex = 10; this.ObtenerProductosPagedList.Text = "Obtener lista paginada"; this.ObtenerProductosPagedList.UseVisualStyleBackColor = true; @@ -379,10 +383,10 @@ private void InitializeComponent() // BorrarProducto // this.BorrarProducto.Anchor = System.Windows.Forms.AnchorStyles.None; - this.BorrarProducto.Location = new System.Drawing.Point(199, 88); - this.BorrarProducto.Margin = new System.Windows.Forms.Padding(4); + this.BorrarProducto.Location = new System.Drawing.Point(298, 138); + this.BorrarProducto.Margin = new System.Windows.Forms.Padding(6); this.BorrarProducto.Name = "BorrarProducto"; - this.BorrarProducto.Size = new System.Drawing.Size(147, 60); + this.BorrarProducto.Size = new System.Drawing.Size(220, 94); this.BorrarProducto.TabIndex = 9; this.BorrarProducto.Text = "Borrar producto"; this.BorrarProducto.UseVisualStyleBackColor = true; @@ -391,10 +395,10 @@ private void InitializeComponent() // ActualizarProducto // this.ActualizarProducto.Anchor = System.Windows.Forms.AnchorStyles.None; - this.ActualizarProducto.Location = new System.Drawing.Point(199, 22); - this.ActualizarProducto.Margin = new System.Windows.Forms.Padding(4); + this.ActualizarProducto.Location = new System.Drawing.Point(298, 34); + this.ActualizarProducto.Margin = new System.Windows.Forms.Padding(6); this.ActualizarProducto.Name = "ActualizarProducto"; - this.ActualizarProducto.Size = new System.Drawing.Size(147, 60); + this.ActualizarProducto.Size = new System.Drawing.Size(220, 94); this.ActualizarProducto.TabIndex = 8; this.ActualizarProducto.Text = "Actualizar producto"; this.ActualizarProducto.UseVisualStyleBackColor = true; @@ -403,10 +407,10 @@ private void InitializeComponent() // CrearProducto // this.CrearProducto.Anchor = System.Windows.Forms.AnchorStyles.None; - this.CrearProducto.Location = new System.Drawing.Point(13, 224); - this.CrearProducto.Margin = new System.Windows.Forms.Padding(4); + this.CrearProducto.Location = new System.Drawing.Point(20, 350); + this.CrearProducto.Margin = new System.Windows.Forms.Padding(6); this.CrearProducto.Name = "CrearProducto"; - this.CrearProducto.Size = new System.Drawing.Size(147, 60); + this.CrearProducto.Size = new System.Drawing.Size(220, 94); this.CrearProducto.TabIndex = 7; this.CrearProducto.Text = "Crear producto"; this.CrearProducto.UseVisualStyleBackColor = true; @@ -415,10 +419,10 @@ private void InitializeComponent() // ObtenerProductoById // this.ObtenerProductoById.Anchor = System.Windows.Forms.AnchorStyles.None; - this.ObtenerProductoById.Location = new System.Drawing.Point(12, 88); - this.ObtenerProductoById.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerProductoById.Location = new System.Drawing.Point(18, 138); + this.ObtenerProductoById.Margin = new System.Windows.Forms.Padding(6); this.ObtenerProductoById.Name = "ObtenerProductoById"; - this.ObtenerProductoById.Size = new System.Drawing.Size(147, 60); + this.ObtenerProductoById.Size = new System.Drawing.Size(220, 94); this.ObtenerProductoById.TabIndex = 6; this.ObtenerProductoById.Text = "Obtener producto por ID"; this.ObtenerProductoById.UseVisualStyleBackColor = true; @@ -431,21 +435,21 @@ private void InitializeComponent() this.groupBox4.Controls.Add(this.RevocaApikey); this.groupBox4.Controls.Add(this.CrearApikey); this.groupBox4.Controls.Add(this.ObtenerApikeyByID); - this.groupBox4.Location = new System.Drawing.Point(712, 341); - this.groupBox4.Margin = new System.Windows.Forms.Padding(4); + this.groupBox4.Location = new System.Drawing.Point(1068, 533); + this.groupBox4.Margin = new System.Windows.Forms.Padding(6); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Padding = new System.Windows.Forms.Padding(4); - this.groupBox4.Size = new System.Drawing.Size(181, 462); + this.groupBox4.Padding = new System.Windows.Forms.Padding(6); + this.groupBox4.Size = new System.Drawing.Size(272, 722); this.groupBox4.TabIndex = 19; this.groupBox4.TabStop = false; this.groupBox4.Text = "Api Keys"; // // UpdateApiKey // - this.UpdateApiKey.Location = new System.Drawing.Point(7, 295); - this.UpdateApiKey.Margin = new System.Windows.Forms.Padding(4); + this.UpdateApiKey.Location = new System.Drawing.Point(10, 461); + this.UpdateApiKey.Margin = new System.Windows.Forms.Padding(6); this.UpdateApiKey.Name = "UpdateApiKey"; - this.UpdateApiKey.Size = new System.Drawing.Size(147, 60); + this.UpdateApiKey.Size = new System.Drawing.Size(220, 94); this.UpdateApiKey.TabIndex = 18; this.UpdateApiKey.Text = "Obtener api-key por ID"; this.UpdateApiKey.UseVisualStyleBackColor = true; @@ -453,10 +457,10 @@ private void InitializeComponent() // // ObtenerPagedListApikeys // - this.ObtenerPagedListApikeys.Location = new System.Drawing.Point(7, 227); - this.ObtenerPagedListApikeys.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerPagedListApikeys.Location = new System.Drawing.Point(10, 355); + this.ObtenerPagedListApikeys.Margin = new System.Windows.Forms.Padding(6); this.ObtenerPagedListApikeys.Name = "ObtenerPagedListApikeys"; - this.ObtenerPagedListApikeys.Size = new System.Drawing.Size(147, 60); + this.ObtenerPagedListApikeys.Size = new System.Drawing.Size(220, 94); this.ObtenerPagedListApikeys.TabIndex = 17; this.ObtenerPagedListApikeys.Text = "Obtener lista paginada"; this.ObtenerPagedListApikeys.UseVisualStyleBackColor = true; @@ -464,10 +468,10 @@ private void InitializeComponent() // // RevocaApikey // - this.RevocaApikey.Location = new System.Drawing.Point(7, 159); - this.RevocaApikey.Margin = new System.Windows.Forms.Padding(4); + this.RevocaApikey.Location = new System.Drawing.Point(10, 248); + this.RevocaApikey.Margin = new System.Windows.Forms.Padding(6); this.RevocaApikey.Name = "RevocaApikey"; - this.RevocaApikey.Size = new System.Drawing.Size(147, 60); + this.RevocaApikey.Size = new System.Drawing.Size(220, 94); this.RevocaApikey.TabIndex = 15; this.RevocaApikey.Text = "Revocar ApiKey"; this.RevocaApikey.UseVisualStyleBackColor = true; @@ -475,10 +479,10 @@ private void InitializeComponent() // // CrearApikey // - this.CrearApikey.Location = new System.Drawing.Point(7, 91); - this.CrearApikey.Margin = new System.Windows.Forms.Padding(4); + this.CrearApikey.Location = new System.Drawing.Point(10, 142); + this.CrearApikey.Margin = new System.Windows.Forms.Padding(6); this.CrearApikey.Name = "CrearApikey"; - this.CrearApikey.Size = new System.Drawing.Size(147, 60); + this.CrearApikey.Size = new System.Drawing.Size(220, 94); this.CrearApikey.TabIndex = 14; this.CrearApikey.Text = "Crear ApiKey"; this.CrearApikey.UseVisualStyleBackColor = true; @@ -486,10 +490,10 @@ private void InitializeComponent() // // ObtenerApikeyByID // - this.ObtenerApikeyByID.Location = new System.Drawing.Point(7, 23); - this.ObtenerApikeyByID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerApikeyByID.Location = new System.Drawing.Point(10, 36); + this.ObtenerApikeyByID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerApikeyByID.Name = "ObtenerApikeyByID"; - this.ObtenerApikeyByID.Size = new System.Drawing.Size(147, 60); + this.ObtenerApikeyByID.Size = new System.Drawing.Size(220, 94); this.ObtenerApikeyByID.TabIndex = 13; this.ObtenerApikeyByID.Text = "Obtener api-key por ID"; this.ObtenerApikeyByID.UseVisualStyleBackColor = true; @@ -502,21 +506,21 @@ private void InitializeComponent() this.groupBox5.Controls.Add(this.BuscarCatalogo); this.groupBox5.Controls.Add(this.BuscarCodigoUnidad); this.groupBox5.Controls.Add(this.BuscarCodigoProductoServicio); - this.groupBox5.Location = new System.Drawing.Point(332, 8); - this.groupBox5.Margin = new System.Windows.Forms.Padding(4); + this.groupBox5.Location = new System.Drawing.Point(498, 12); + this.groupBox5.Margin = new System.Windows.Forms.Padding(6); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Padding = new System.Windows.Forms.Padding(4); - this.groupBox5.Size = new System.Drawing.Size(373, 223); + this.groupBox5.Padding = new System.Windows.Forms.Padding(6); + this.groupBox5.Size = new System.Drawing.Size(560, 348); this.groupBox5.TabIndex = 20; this.groupBox5.TabStop = false; this.groupBox5.Text = "CATALOGOS"; // // ObtenerCatalogRecordPorId // - this.ObtenerCatalogRecordPorId.Location = new System.Drawing.Point(194, 88); - this.ObtenerCatalogRecordPorId.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerCatalogRecordPorId.Location = new System.Drawing.Point(291, 138); + this.ObtenerCatalogRecordPorId.Margin = new System.Windows.Forms.Padding(6); this.ObtenerCatalogRecordPorId.Name = "ObtenerCatalogRecordPorId"; - this.ObtenerCatalogRecordPorId.Size = new System.Drawing.Size(147, 60); + this.ObtenerCatalogRecordPorId.Size = new System.Drawing.Size(220, 94); this.ObtenerCatalogRecordPorId.TabIndex = 19; this.ObtenerCatalogRecordPorId.Text = "Obtener registro por Id"; this.ObtenerCatalogRecordPorId.UseVisualStyleBackColor = true; @@ -524,10 +528,10 @@ private void InitializeComponent() // // ObtenerCatalogosDisponibles // - this.ObtenerCatalogosDisponibles.Location = new System.Drawing.Point(7, 156); - this.ObtenerCatalogosDisponibles.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerCatalogosDisponibles.Location = new System.Drawing.Point(10, 244); + this.ObtenerCatalogosDisponibles.Margin = new System.Windows.Forms.Padding(6); this.ObtenerCatalogosDisponibles.Name = "ObtenerCatalogosDisponibles"; - this.ObtenerCatalogosDisponibles.Size = new System.Drawing.Size(147, 60); + this.ObtenerCatalogosDisponibles.Size = new System.Drawing.Size(220, 94); this.ObtenerCatalogosDisponibles.TabIndex = 18; this.ObtenerCatalogosDisponibles.Text = "Obtener Catalogos disponibles"; this.ObtenerCatalogosDisponibles.UseVisualStyleBackColor = true; @@ -535,10 +539,10 @@ private void InitializeComponent() // // BuscarCatalogo // - this.BuscarCatalogo.Location = new System.Drawing.Point(194, 21); - this.BuscarCatalogo.Margin = new System.Windows.Forms.Padding(4); + this.BuscarCatalogo.Location = new System.Drawing.Point(291, 33); + this.BuscarCatalogo.Margin = new System.Windows.Forms.Padding(6); this.BuscarCatalogo.Name = "BuscarCatalogo"; - this.BuscarCatalogo.Size = new System.Drawing.Size(147, 60); + this.BuscarCatalogo.Size = new System.Drawing.Size(220, 94); this.BuscarCatalogo.TabIndex = 17; this.BuscarCatalogo.Text = "Buscar en cualquier catalogo SAT"; this.BuscarCatalogo.UseVisualStyleBackColor = true; @@ -546,10 +550,10 @@ private void InitializeComponent() // // BuscarCodigoUnidad // - this.BuscarCodigoUnidad.Location = new System.Drawing.Point(7, 88); - this.BuscarCodigoUnidad.Margin = new System.Windows.Forms.Padding(4); + this.BuscarCodigoUnidad.Location = new System.Drawing.Point(10, 138); + this.BuscarCodigoUnidad.Margin = new System.Windows.Forms.Padding(6); this.BuscarCodigoUnidad.Name = "BuscarCodigoUnidad"; - this.BuscarCodigoUnidad.Size = new System.Drawing.Size(147, 60); + this.BuscarCodigoUnidad.Size = new System.Drawing.Size(220, 94); this.BuscarCodigoUnidad.TabIndex = 14; this.BuscarCodigoUnidad.Text = "Buscar Codigo Unidad"; this.BuscarCodigoUnidad.UseVisualStyleBackColor = true; @@ -557,10 +561,10 @@ private void InitializeComponent() // // BuscarCodigoProductoServicio // - this.BuscarCodigoProductoServicio.Location = new System.Drawing.Point(7, 21); - this.BuscarCodigoProductoServicio.Margin = new System.Windows.Forms.Padding(4); + this.BuscarCodigoProductoServicio.Location = new System.Drawing.Point(10, 33); + this.BuscarCodigoProductoServicio.Margin = new System.Windows.Forms.Padding(6); this.BuscarCodigoProductoServicio.Name = "BuscarCodigoProductoServicio"; - this.BuscarCodigoProductoServicio.Size = new System.Drawing.Size(147, 60); + this.BuscarCodigoProductoServicio.Size = new System.Drawing.Size(220, 94); this.BuscarCodigoProductoServicio.TabIndex = 13; this.BuscarCodigoProductoServicio.Text = "Buscar Codigo Producto Servicio"; this.BuscarCodigoProductoServicio.UseVisualStyleBackColor = true; @@ -573,21 +577,21 @@ private void InitializeComponent() this.groupBox6.Controls.Add(this.CargarCertificados); this.groupBox6.Controls.Add(this.ObtenerCertificadoById); this.groupBox6.Controls.Add(this.EliEliminaCertificado); - this.groupBox6.Location = new System.Drawing.Point(332, 240); - this.groupBox6.Margin = new System.Windows.Forms.Padding(4); + this.groupBox6.Location = new System.Drawing.Point(498, 375); + this.groupBox6.Margin = new System.Windows.Forms.Padding(6); this.groupBox6.Name = "groupBox6"; - this.groupBox6.Padding = new System.Windows.Forms.Padding(4); - this.groupBox6.Size = new System.Drawing.Size(373, 245); + this.groupBox6.Padding = new System.Windows.Forms.Padding(6); + this.groupBox6.Size = new System.Drawing.Size(560, 383); this.groupBox6.TabIndex = 21; this.groupBox6.TabStop = false; this.groupBox6.Text = "Certificados (sellos)"; // // CertDefaultRefs // - this.CertDefaultRefs.Location = new System.Drawing.Point(8, 163); - this.CertDefaultRefs.Margin = new System.Windows.Forms.Padding(4); + this.CertDefaultRefs.Location = new System.Drawing.Point(12, 255); + this.CertDefaultRefs.Margin = new System.Windows.Forms.Padding(6); this.CertDefaultRefs.Name = "CertDefaultRefs"; - this.CertDefaultRefs.Size = new System.Drawing.Size(147, 60); + this.CertDefaultRefs.Size = new System.Drawing.Size(220, 94); this.CertDefaultRefs.TabIndex = 11; this.CertDefaultRefs.Text = "Obtener ultimos id de certficados validos de una persona"; this.CertDefaultRefs.UseVisualStyleBackColor = true; @@ -595,10 +599,10 @@ private void InitializeComponent() // // button2 // - this.button2.Location = new System.Drawing.Point(7, 23); - this.button2.Margin = new System.Windows.Forms.Padding(4); + this.button2.Location = new System.Drawing.Point(10, 36); + this.button2.Margin = new System.Windows.Forms.Padding(6); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(147, 60); + this.button2.Size = new System.Drawing.Size(220, 94); this.button2.TabIndex = 10; this.button2.Text = "Obtener lista paginada"; this.button2.UseVisualStyleBackColor = true; @@ -606,202 +610,26 @@ private void InitializeComponent() // // tabControl1 // - this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Margin = new System.Windows.Forms.Padding(4); + this.tabControl1.Margin = new System.Windows.Forms.Padding(6); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(906, 848); + this.tabControl1.Size = new System.Drawing.Size(1959, 1325); this.tabControl1.TabIndex = 0; // - // tabPage1 - // - this.tabPage1.Controls.Add(this.groupBox10); - this.tabPage1.Controls.Add(this.groupBox13); - this.tabPage1.Controls.Add(this.groupBox12); - this.tabPage1.Controls.Add(this.groupBox2); - this.tabPage1.Controls.Add(this.groupBox6); - this.tabPage1.Controls.Add(this.groupBox3); - this.tabPage1.Controls.Add(this.groupBox4); - this.tabPage1.Controls.Add(this.groupBox1); - this.tabPage1.Controls.Add(this.groupBox5); - this.tabPage1.Location = new System.Drawing.Point(4, 25); - this.tabPage1.Margin = new System.Windows.Forms.Padding(4); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(4); - this.tabPage1.Size = new System.Drawing.Size(898, 819); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "FACTURACION"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // groupBox10 - // - this.groupBox10.Controls.Add(this.groupBox11); - this.groupBox10.Controls.Add(this.button5); - this.groupBox10.Controls.Add(this.button4); - this.groupBox10.Location = new System.Drawing.Point(712, 8); - this.groupBox10.Name = "groupBox10"; - this.groupBox10.Size = new System.Drawing.Size(181, 326); - this.groupBox10.TabIndex = 24; - this.groupBox10.TabStop = false; - this.groupBox10.Text = "Descarga masiva"; - // - // groupBox11 - // - this.groupBox11.Controls.Add(this.button6); - this.groupBox11.Controls.Add(this.button3); - this.groupBox11.Location = new System.Drawing.Point(7, 22); - this.groupBox11.Name = "groupBox11"; - this.groupBox11.Size = new System.Drawing.Size(162, 159); - this.groupBox11.TabIndex = 21; - this.groupBox11.TabStop = false; - this.groupBox11.Text = "Catálogos"; - // - // button6 - // - this.button6.Location = new System.Drawing.Point(7, 90); - this.button6.Margin = new System.Windows.Forms.Padding(4); - this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(147, 60); - this.button6.TabIndex = 19; - this.button6.Text = "Listar catálogo"; - this.button6.UseVisualStyleBackColor = true; - this.button6.Click += new System.EventHandler(this.button6_Click_1); - // - // button3 - // - this.button3.Location = new System.Drawing.Point(7, 22); - this.button3.Margin = new System.Windows.Forms.Padding(4); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(147, 60); - this.button3.TabIndex = 18; - this.button3.Text = "Listar catálogos"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click_1); - // - // button5 - // - this.button5.Location = new System.Drawing.Point(14, 256); - this.button5.Margin = new System.Windows.Forms.Padding(4); - this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(147, 60); - this.button5.TabIndex = 20; - this.button5.Text = "Solicitudes de descarga"; - this.button5.UseVisualStyleBackColor = true; - this.button5.Click += new System.EventHandler(this.button5_Click_1); - // - // button4 - // - this.button4.Location = new System.Drawing.Point(14, 188); - this.button4.Margin = new System.Windows.Forms.Padding(4); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(147, 60); - this.button4.TabIndex = 19; - this.button4.Text = "Reglas de descarga"; - this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.button4_Click_1); - // - // groupBox13 - // - this.groupBox13.Controls.Add(this.button17); - this.groupBox13.Controls.Add(this.button16); - this.groupBox13.Controls.Add(this.button15); - this.groupBox13.Controls.Add(this.button14); - this.groupBox13.Location = new System.Drawing.Point(4, 645); - this.groupBox13.Name = "groupBox13"; - this.groupBox13.Size = new System.Drawing.Size(320, 158); - this.groupBox13.TabIndex = 23; - this.groupBox13.TabStop = false; - this.groupBox13.Text = "TIMBRES"; - // - // button17 - // - this.button17.Location = new System.Drawing.Point(162, 90); - this.button17.Margin = new System.Windows.Forms.Padding(4); - this.button17.Name = "button17"; - this.button17.Size = new System.Drawing.Size(147, 60); - this.button17.TabIndex = 17; - this.button17.Text = "Retirar timbres"; - this.button17.UseVisualStyleBackColor = true; - this.button17.Click += new System.EventHandler(this.button17_Click); - // - // button16 - // - this.button16.Location = new System.Drawing.Point(162, 22); - this.button16.Margin = new System.Windows.Forms.Padding(4); - this.button16.Name = "button16"; - this.button16.Size = new System.Drawing.Size(147, 60); - this.button16.TabIndex = 16; - this.button16.Text = "Transferir timbres"; - this.button16.UseVisualStyleBackColor = true; - this.button16.Click += new System.EventHandler(this.button16_Click); - // - // button15 - // - this.button15.Location = new System.Drawing.Point(7, 90); - this.button15.Margin = new System.Windows.Forms.Padding(4); - this.button15.Name = "button15"; - this.button15.Size = new System.Drawing.Size(147, 60); - this.button15.TabIndex = 15; - this.button15.Text = "Obtener movimiento por ID"; - this.button15.UseVisualStyleBackColor = true; - this.button15.Click += new System.EventHandler(this.button15_Click); - // - // button14 - // - this.button14.Location = new System.Drawing.Point(7, 22); - this.button14.Margin = new System.Windows.Forms.Padding(4); - this.button14.Name = "button14"; - this.button14.Size = new System.Drawing.Size(147, 60); - this.button14.TabIndex = 14; - this.button14.Text = "Listar movimientos"; - this.button14.UseVisualStyleBackColor = true; - this.button14.Click += new System.EventHandler(this.button14_Click); - // - // groupBox12 - // - this.groupBox12.Controls.Add(this.button13); - this.groupBox12.Controls.Add(this.button1); - this.groupBox12.Location = new System.Drawing.Point(4, 238); - this.groupBox12.Name = "groupBox12"; - this.groupBox12.Size = new System.Drawing.Size(320, 80); - this.groupBox12.TabIndex = 22; - this.groupBox12.TabStop = false; - this.groupBox12.Text = "CUENTA"; - // - // button13 - // - this.button13.Location = new System.Drawing.Point(7, 15); - this.button13.Margin = new System.Windows.Forms.Padding(4); - this.button13.Name = "button13"; - this.button13.Size = new System.Drawing.Size(147, 60); - this.button13.TabIndex = 13; - this.button13.Text = "Crear cuenta"; - this.button13.UseVisualStyleBackColor = true; - this.button13.Click += new System.EventHandler(this.button13_Click); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(162, 15); - this.button1.Margin = new System.Windows.Forms.Padding(4); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(147, 60); - this.button1.TabIndex = 12; - this.button1.Text = "Iniciar sesión"; - this.button1.UseVisualStyleBackColor = true; - // // tabPage2 // this.tabPage2.Controls.Add(this.groupBox9); this.tabPage2.Controls.Add(this.groupBox8); this.tabPage2.Controls.Add(this.groupBox7); - this.tabPage2.Location = new System.Drawing.Point(4, 25); - this.tabPage2.Margin = new System.Windows.Forms.Padding(4); + this.tabPage2.Location = new System.Drawing.Point(8, 39); + this.tabPage2.Margin = new System.Windows.Forms.Padding(6); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(4); - this.tabPage2.Size = new System.Drawing.Size(898, 819); + this.tabPage2.Padding = new System.Windows.Forms.Padding(6); + this.tabPage2.Size = new System.Drawing.Size(1943, 1278); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "DESCARGA MASIVA XML"; this.tabPage2.UseVisualStyleBackColor = true; @@ -818,21 +646,21 @@ private void InitializeComponent() this.groupBox9.Controls.Add(this.ListarXmlsPorSolicitudID); this.groupBox9.Controls.Add(this.ObtenerSolicitudporID); this.groupBox9.Controls.Add(this.ListarSolicitudes); - this.groupBox9.Location = new System.Drawing.Point(4, 170); - this.groupBox9.Margin = new System.Windows.Forms.Padding(4); + this.groupBox9.Location = new System.Drawing.Point(6, 266); + this.groupBox9.Margin = new System.Windows.Forms.Padding(6); this.groupBox9.Name = "groupBox9"; - this.groupBox9.Padding = new System.Windows.Forms.Padding(4); - this.groupBox9.Size = new System.Drawing.Size(783, 202); + this.groupBox9.Padding = new System.Windows.Forms.Padding(6); + this.groupBox9.Size = new System.Drawing.Size(1174, 316); this.groupBox9.TabIndex = 2; this.groupBox9.TabStop = false; this.groupBox9.Text = "Solicitudes de descarga"; // // BuscarSolicitud // - this.BuscarSolicitud.Location = new System.Drawing.Point(595, 85); - this.BuscarSolicitud.Margin = new System.Windows.Forms.Padding(4); + this.BuscarSolicitud.Location = new System.Drawing.Point(892, 133); + this.BuscarSolicitud.Margin = new System.Windows.Forms.Padding(6); this.BuscarSolicitud.Name = "BuscarSolicitud"; - this.BuscarSolicitud.Size = new System.Drawing.Size(139, 54); + this.BuscarSolicitud.Size = new System.Drawing.Size(208, 84); this.BuscarSolicitud.TabIndex = 11; this.BuscarSolicitud.Text = "Buscar Solicitud"; this.BuscarSolicitud.UseVisualStyleBackColor = true; @@ -840,10 +668,10 @@ private void InitializeComponent() // // EliminarSolicitud // - this.EliminarSolicitud.Location = new System.Drawing.Point(448, 85); - this.EliminarSolicitud.Margin = new System.Windows.Forms.Padding(4); + this.EliminarSolicitud.Location = new System.Drawing.Point(672, 133); + this.EliminarSolicitud.Margin = new System.Windows.Forms.Padding(6); this.EliminarSolicitud.Name = "EliminarSolicitud"; - this.EliminarSolicitud.Size = new System.Drawing.Size(139, 54); + this.EliminarSolicitud.Size = new System.Drawing.Size(208, 84); this.EliminarSolicitud.TabIndex = 10; this.EliminarSolicitud.Text = "Eliminar Solicitud"; this.EliminarSolicitud.UseVisualStyleBackColor = true; @@ -851,10 +679,10 @@ private void InitializeComponent() // // CrearSolicitud // - this.CrearSolicitud.Location = new System.Drawing.Point(301, 85); - this.CrearSolicitud.Margin = new System.Windows.Forms.Padding(4); + this.CrearSolicitud.Location = new System.Drawing.Point(452, 133); + this.CrearSolicitud.Margin = new System.Windows.Forms.Padding(6); this.CrearSolicitud.Name = "CrearSolicitud"; - this.CrearSolicitud.Size = new System.Drawing.Size(139, 54); + this.CrearSolicitud.Size = new System.Drawing.Size(208, 84); this.CrearSolicitud.TabIndex = 9; this.CrearSolicitud.Text = "Crear Solicitud"; this.CrearSolicitud.UseVisualStyleBackColor = true; @@ -862,10 +690,10 @@ private void InitializeComponent() // // ObtenerSATResponsePorSolicitudID // - this.ObtenerSATResponsePorSolicitudID.Location = new System.Drawing.Point(155, 85); - this.ObtenerSATResponsePorSolicitudID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerSATResponsePorSolicitudID.Location = new System.Drawing.Point(232, 133); + this.ObtenerSATResponsePorSolicitudID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerSATResponsePorSolicitudID.Name = "ObtenerSATResponsePorSolicitudID"; - this.ObtenerSATResponsePorSolicitudID.Size = new System.Drawing.Size(139, 54); + this.ObtenerSATResponsePorSolicitudID.Size = new System.Drawing.Size(208, 84); this.ObtenerSATResponsePorSolicitudID.TabIndex = 8; this.ObtenerSATResponsePorSolicitudID.Text = "Obtener SAT response por solicitud ID"; this.ObtenerSATResponsePorSolicitudID.UseVisualStyleBackColor = true; @@ -873,10 +701,10 @@ private void InitializeComponent() // // ObtenerSATRequestPorSolicitudID // - this.ObtenerSATRequestPorSolicitudID.Location = new System.Drawing.Point(8, 85); - this.ObtenerSATRequestPorSolicitudID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerSATRequestPorSolicitudID.Location = new System.Drawing.Point(12, 133); + this.ObtenerSATRequestPorSolicitudID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerSATRequestPorSolicitudID.Name = "ObtenerSATRequestPorSolicitudID"; - this.ObtenerSATRequestPorSolicitudID.Size = new System.Drawing.Size(139, 54); + this.ObtenerSATRequestPorSolicitudID.Size = new System.Drawing.Size(208, 84); this.ObtenerSATRequestPorSolicitudID.TabIndex = 7; this.ObtenerSATRequestPorSolicitudID.Text = "Obtener SAT request por solicitud ID"; this.ObtenerSATRequestPorSolicitudID.UseVisualStyleBackColor = true; @@ -884,10 +712,10 @@ private void InitializeComponent() // // DescargarPaquetePorSolicitudID // - this.DescargarPaquetePorSolicitudID.Location = new System.Drawing.Point(595, 23); - this.DescargarPaquetePorSolicitudID.Margin = new System.Windows.Forms.Padding(4); + this.DescargarPaquetePorSolicitudID.Location = new System.Drawing.Point(892, 36); + this.DescargarPaquetePorSolicitudID.Margin = new System.Windows.Forms.Padding(6); this.DescargarPaquetePorSolicitudID.Name = "DescargarPaquetePorSolicitudID"; - this.DescargarPaquetePorSolicitudID.Size = new System.Drawing.Size(139, 54); + this.DescargarPaquetePorSolicitudID.Size = new System.Drawing.Size(208, 84); this.DescargarPaquetePorSolicitudID.TabIndex = 6; this.DescargarPaquetePorSolicitudID.Text = "Descargar paquete por solicitud ID"; this.DescargarPaquetePorSolicitudID.UseVisualStyleBackColor = true; @@ -895,10 +723,10 @@ private void InitializeComponent() // // ListarMetaItemsPorSolicitudID // - this.ListarMetaItemsPorSolicitudID.Location = new System.Drawing.Point(448, 23); - this.ListarMetaItemsPorSolicitudID.Margin = new System.Windows.Forms.Padding(4); + this.ListarMetaItemsPorSolicitudID.Location = new System.Drawing.Point(672, 36); + this.ListarMetaItemsPorSolicitudID.Margin = new System.Windows.Forms.Padding(6); this.ListarMetaItemsPorSolicitudID.Name = "ListarMetaItemsPorSolicitudID"; - this.ListarMetaItemsPorSolicitudID.Size = new System.Drawing.Size(139, 54); + this.ListarMetaItemsPorSolicitudID.Size = new System.Drawing.Size(208, 84); this.ListarMetaItemsPorSolicitudID.TabIndex = 5; this.ListarMetaItemsPorSolicitudID.Text = "Listar meta-items por solicitud ID"; this.ListarMetaItemsPorSolicitudID.UseVisualStyleBackColor = true; @@ -906,10 +734,10 @@ private void InitializeComponent() // // ListarXmlsPorSolicitudID // - this.ListarXmlsPorSolicitudID.Location = new System.Drawing.Point(301, 23); - this.ListarXmlsPorSolicitudID.Margin = new System.Windows.Forms.Padding(4); + this.ListarXmlsPorSolicitudID.Location = new System.Drawing.Point(452, 36); + this.ListarXmlsPorSolicitudID.Margin = new System.Windows.Forms.Padding(6); this.ListarXmlsPorSolicitudID.Name = "ListarXmlsPorSolicitudID"; - this.ListarXmlsPorSolicitudID.Size = new System.Drawing.Size(139, 54); + this.ListarXmlsPorSolicitudID.Size = new System.Drawing.Size(208, 84); this.ListarXmlsPorSolicitudID.TabIndex = 4; this.ListarXmlsPorSolicitudID.Text = "Listar xmls por solicitud ID"; this.ListarXmlsPorSolicitudID.UseVisualStyleBackColor = true; @@ -917,10 +745,10 @@ private void InitializeComponent() // // ObtenerSolicitudporID // - this.ObtenerSolicitudporID.Location = new System.Drawing.Point(155, 23); - this.ObtenerSolicitudporID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerSolicitudporID.Location = new System.Drawing.Point(232, 36); + this.ObtenerSolicitudporID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerSolicitudporID.Name = "ObtenerSolicitudporID"; - this.ObtenerSolicitudporID.Size = new System.Drawing.Size(139, 54); + this.ObtenerSolicitudporID.Size = new System.Drawing.Size(208, 84); this.ObtenerSolicitudporID.TabIndex = 3; this.ObtenerSolicitudporID.Text = "Obtener solicitud por ID"; this.ObtenerSolicitudporID.UseVisualStyleBackColor = true; @@ -928,10 +756,10 @@ private void InitializeComponent() // // ListarSolicitudes // - this.ListarSolicitudes.Location = new System.Drawing.Point(8, 23); - this.ListarSolicitudes.Margin = new System.Windows.Forms.Padding(4); + this.ListarSolicitudes.Location = new System.Drawing.Point(12, 36); + this.ListarSolicitudes.Margin = new System.Windows.Forms.Padding(6); this.ListarSolicitudes.Name = "ListarSolicitudes"; - this.ListarSolicitudes.Size = new System.Drawing.Size(139, 54); + this.ListarSolicitudes.Size = new System.Drawing.Size(208, 84); this.ListarSolicitudes.TabIndex = 2; this.ListarSolicitudes.Text = "Listar solicitudes"; this.ListarSolicitudes.UseVisualStyleBackColor = true; @@ -945,21 +773,21 @@ private void InitializeComponent() this.groupBox8.Controls.Add(this.CrearRegla); this.groupBox8.Controls.Add(this.ObtenerReglaporID); this.groupBox8.Controls.Add(this.ListarReglas); - this.groupBox8.Location = new System.Drawing.Point(336, 7); - this.groupBox8.Margin = new System.Windows.Forms.Padding(4); + this.groupBox8.Location = new System.Drawing.Point(504, 11); + this.groupBox8.Margin = new System.Windows.Forms.Padding(6); this.groupBox8.Name = "groupBox8"; - this.groupBox8.Padding = new System.Windows.Forms.Padding(4); - this.groupBox8.Size = new System.Drawing.Size(457, 155); + this.groupBox8.Padding = new System.Windows.Forms.Padding(6); + this.groupBox8.Size = new System.Drawing.Size(686, 242); this.groupBox8.TabIndex = 1; this.groupBox8.TabStop = false; this.groupBox8.Text = "Reglas de descarga"; // // EliminarRegla // - this.EliminarRegla.Location = new System.Drawing.Point(301, 85); - this.EliminarRegla.Margin = new System.Windows.Forms.Padding(4); + this.EliminarRegla.Location = new System.Drawing.Point(452, 133); + this.EliminarRegla.Margin = new System.Windows.Forms.Padding(6); this.EliminarRegla.Name = "EliminarRegla"; - this.EliminarRegla.Size = new System.Drawing.Size(139, 54); + this.EliminarRegla.Size = new System.Drawing.Size(208, 84); this.EliminarRegla.TabIndex = 6; this.EliminarRegla.Text = "Eliminar Regla"; this.EliminarRegla.UseVisualStyleBackColor = true; @@ -967,10 +795,10 @@ private void InitializeComponent() // // ActualizarRegla // - this.ActualizarRegla.Location = new System.Drawing.Point(155, 85); - this.ActualizarRegla.Margin = new System.Windows.Forms.Padding(4); + this.ActualizarRegla.Location = new System.Drawing.Point(232, 133); + this.ActualizarRegla.Margin = new System.Windows.Forms.Padding(6); this.ActualizarRegla.Name = "ActualizarRegla"; - this.ActualizarRegla.Size = new System.Drawing.Size(139, 54); + this.ActualizarRegla.Size = new System.Drawing.Size(208, 84); this.ActualizarRegla.TabIndex = 5; this.ActualizarRegla.Text = "Actualizar Regla"; this.ActualizarRegla.UseVisualStyleBackColor = true; @@ -978,10 +806,10 @@ private void InitializeComponent() // // CrearReglaSolicituddePrueba // - this.CrearReglaSolicituddePrueba.Location = new System.Drawing.Point(8, 85); - this.CrearReglaSolicituddePrueba.Margin = new System.Windows.Forms.Padding(4); + this.CrearReglaSolicituddePrueba.Location = new System.Drawing.Point(12, 133); + this.CrearReglaSolicituddePrueba.Margin = new System.Windows.Forms.Padding(6); this.CrearReglaSolicituddePrueba.Name = "CrearReglaSolicituddePrueba"; - this.CrearReglaSolicituddePrueba.Size = new System.Drawing.Size(139, 54); + this.CrearReglaSolicituddePrueba.Size = new System.Drawing.Size(208, 84); this.CrearReglaSolicituddePrueba.TabIndex = 4; this.CrearReglaSolicituddePrueba.Text = "Crear regla y solicitud de prueba"; this.CrearReglaSolicituddePrueba.UseVisualStyleBackColor = true; @@ -989,10 +817,10 @@ private void InitializeComponent() // // CrearRegla // - this.CrearRegla.Location = new System.Drawing.Point(301, 23); - this.CrearRegla.Margin = new System.Windows.Forms.Padding(4); + this.CrearRegla.Location = new System.Drawing.Point(452, 36); + this.CrearRegla.Margin = new System.Windows.Forms.Padding(6); this.CrearRegla.Name = "CrearRegla"; - this.CrearRegla.Size = new System.Drawing.Size(139, 54); + this.CrearRegla.Size = new System.Drawing.Size(208, 84); this.CrearRegla.TabIndex = 3; this.CrearRegla.Text = "Crear Regla"; this.CrearRegla.UseVisualStyleBackColor = true; @@ -1000,10 +828,10 @@ private void InitializeComponent() // // ObtenerReglaporID // - this.ObtenerReglaporID.Location = new System.Drawing.Point(155, 23); - this.ObtenerReglaporID.Margin = new System.Windows.Forms.Padding(4); + this.ObtenerReglaporID.Location = new System.Drawing.Point(232, 36); + this.ObtenerReglaporID.Margin = new System.Windows.Forms.Padding(6); this.ObtenerReglaporID.Name = "ObtenerReglaporID"; - this.ObtenerReglaporID.Size = new System.Drawing.Size(139, 54); + this.ObtenerReglaporID.Size = new System.Drawing.Size(208, 84); this.ObtenerReglaporID.TabIndex = 2; this.ObtenerReglaporID.Text = "Obtener Regla por ID"; this.ObtenerReglaporID.UseVisualStyleBackColor = true; @@ -1011,10 +839,10 @@ private void InitializeComponent() // // ListarReglas // - this.ListarReglas.Location = new System.Drawing.Point(8, 23); - this.ListarReglas.Margin = new System.Windows.Forms.Padding(4); + this.ListarReglas.Location = new System.Drawing.Point(12, 36); + this.ListarReglas.Margin = new System.Windows.Forms.Padding(6); this.ListarReglas.Name = "ListarReglas"; - this.ListarReglas.Size = new System.Drawing.Size(139, 54); + this.ListarReglas.Size = new System.Drawing.Size(208, 84); this.ListarReglas.TabIndex = 1; this.ListarReglas.Text = "Listar Reglas"; this.ListarReglas.UseVisualStyleBackColor = true; @@ -1024,21 +852,21 @@ private void InitializeComponent() // this.groupBox7.Controls.Add(this.ListarDownloadCatalogo); this.groupBox7.Controls.Add(this.ListarDownloadCatalogos); - this.groupBox7.Location = new System.Drawing.Point(11, 7); - this.groupBox7.Margin = new System.Windows.Forms.Padding(4); + this.groupBox7.Location = new System.Drawing.Point(16, 11); + this.groupBox7.Margin = new System.Windows.Forms.Padding(6); this.groupBox7.Name = "groupBox7"; - this.groupBox7.Padding = new System.Windows.Forms.Padding(4); - this.groupBox7.Size = new System.Drawing.Size(317, 155); + this.groupBox7.Padding = new System.Windows.Forms.Padding(6); + this.groupBox7.Size = new System.Drawing.Size(476, 242); this.groupBox7.TabIndex = 0; this.groupBox7.TabStop = false; this.groupBox7.Text = "Catalogos descarga masiva"; // // ListarDownloadCatalogo // - this.ListarDownloadCatalogo.Location = new System.Drawing.Point(155, 23); - this.ListarDownloadCatalogo.Margin = new System.Windows.Forms.Padding(4); + this.ListarDownloadCatalogo.Location = new System.Drawing.Point(232, 36); + this.ListarDownloadCatalogo.Margin = new System.Windows.Forms.Padding(6); this.ListarDownloadCatalogo.Name = "ListarDownloadCatalogo"; - this.ListarDownloadCatalogo.Size = new System.Drawing.Size(139, 54); + this.ListarDownloadCatalogo.Size = new System.Drawing.Size(208, 84); this.ListarDownloadCatalogo.TabIndex = 1; this.ListarDownloadCatalogo.Text = "Listar catálogo"; this.ListarDownloadCatalogo.UseVisualStyleBackColor = true; @@ -1046,22 +874,231 @@ private void InitializeComponent() // // ListarDownloadCatalogos // - this.ListarDownloadCatalogos.Location = new System.Drawing.Point(8, 23); - this.ListarDownloadCatalogos.Margin = new System.Windows.Forms.Padding(4); + this.ListarDownloadCatalogos.Location = new System.Drawing.Point(12, 36); + this.ListarDownloadCatalogos.Margin = new System.Windows.Forms.Padding(6); this.ListarDownloadCatalogos.Name = "ListarDownloadCatalogos"; - this.ListarDownloadCatalogos.Size = new System.Drawing.Size(139, 54); + this.ListarDownloadCatalogos.Size = new System.Drawing.Size(208, 84); this.ListarDownloadCatalogos.TabIndex = 0; this.ListarDownloadCatalogos.Text = "Listar catálogos"; this.ListarDownloadCatalogos.UseVisualStyleBackColor = true; this.ListarDownloadCatalogos.Click += new System.EventHandler(this.ListarDownloadCatalogos_Click); // + // tabPage1 + // + this.tabPage1.Controls.Add(this.groupBox14); + this.tabPage1.Controls.Add(this.groupBox10); + this.tabPage1.Controls.Add(this.groupBox13); + this.tabPage1.Controls.Add(this.groupBox12); + this.tabPage1.Controls.Add(this.groupBox2); + this.tabPage1.Controls.Add(this.groupBox6); + this.tabPage1.Controls.Add(this.groupBox3); + this.tabPage1.Controls.Add(this.groupBox4); + this.tabPage1.Controls.Add(this.groupBox1); + this.tabPage1.Controls.Add(this.groupBox5); + this.tabPage1.Location = new System.Drawing.Point(8, 39); + this.tabPage1.Margin = new System.Windows.Forms.Padding(6); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(6); + this.tabPage1.Size = new System.Drawing.Size(1943, 1278); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "FACTURACION"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // groupBox14 + // + this.groupBox14.Controls.Add(this.FirmarButton); + this.groupBox14.Location = new System.Drawing.Point(1350, 22); + this.groupBox14.Margin = new System.Windows.Forms.Padding(6); + this.groupBox14.Name = "groupBox14"; + this.groupBox14.Padding = new System.Windows.Forms.Padding(6); + this.groupBox14.Size = new System.Drawing.Size(257, 484); + this.groupBox14.TabIndex = 25; + this.groupBox14.TabStop = false; + this.groupBox14.Text = "Firmar manifiesto"; + // + // FirmarButton + // + this.FirmarButton.Anchor = System.Windows.Forms.AnchorStyles.None; + this.FirmarButton.Location = new System.Drawing.Point(12, 36); + this.FirmarButton.Margin = new System.Windows.Forms.Padding(6); + this.FirmarButton.Name = "FirmarButton"; + this.FirmarButton.Size = new System.Drawing.Size(220, 94); + this.FirmarButton.TabIndex = 10; + this.FirmarButton.Text = "Firmar"; + this.FirmarButton.UseVisualStyleBackColor = true; + this.FirmarButton.Click += new System.EventHandler(this.FirmarButton_Click); + // + // groupBox10 + // + this.groupBox10.Controls.Add(this.groupBox11); + this.groupBox10.Controls.Add(this.button5); + this.groupBox10.Controls.Add(this.button4); + this.groupBox10.Location = new System.Drawing.Point(1068, 12); + this.groupBox10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox10.Size = new System.Drawing.Size(272, 509); + this.groupBox10.TabIndex = 24; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "Descarga masiva"; + // + // groupBox11 + // + this.groupBox11.Controls.Add(this.button6); + this.groupBox11.Controls.Add(this.button3); + this.groupBox11.Location = new System.Drawing.Point(10, 34); + this.groupBox11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox11.Name = "groupBox11"; + this.groupBox11.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox11.Size = new System.Drawing.Size(243, 248); + this.groupBox11.TabIndex = 21; + this.groupBox11.TabStop = false; + this.groupBox11.Text = "Catálogos"; + // + // button6 + // + this.button6.Location = new System.Drawing.Point(10, 141); + this.button6.Margin = new System.Windows.Forms.Padding(6); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(220, 94); + this.button6.TabIndex = 19; + this.button6.Text = "Listar catálogo"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.button6_Click_1); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(10, 34); + this.button3.Margin = new System.Windows.Forms.Padding(6); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(220, 94); + this.button3.TabIndex = 18; + this.button3.Text = "Listar catálogos"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click_1); + // + // button5 + // + this.button5.Location = new System.Drawing.Point(21, 400); + this.button5.Margin = new System.Windows.Forms.Padding(6); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(220, 94); + this.button5.TabIndex = 20; + this.button5.Text = "Solicitudes de descarga"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click_1); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(21, 294); + this.button4.Margin = new System.Windows.Forms.Padding(6); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(220, 94); + this.button4.TabIndex = 19; + this.button4.Text = "Reglas de descarga"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click_1); + // + // groupBox13 + // + this.groupBox13.Controls.Add(this.button17); + this.groupBox13.Controls.Add(this.button16); + this.groupBox13.Controls.Add(this.button15); + this.groupBox13.Controls.Add(this.button14); + this.groupBox13.Location = new System.Drawing.Point(6, 1008); + this.groupBox13.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox13.Name = "groupBox13"; + this.groupBox13.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox13.Size = new System.Drawing.Size(480, 247); + this.groupBox13.TabIndex = 23; + this.groupBox13.TabStop = false; + this.groupBox13.Text = "TIMBRES"; + // + // button17 + // + this.button17.Location = new System.Drawing.Point(243, 141); + this.button17.Margin = new System.Windows.Forms.Padding(6); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(220, 94); + this.button17.TabIndex = 17; + this.button17.Text = "Retirar timbres"; + this.button17.UseVisualStyleBackColor = true; + this.button17.Click += new System.EventHandler(this.button17_Click); + // + // button16 + // + this.button16.Location = new System.Drawing.Point(243, 34); + this.button16.Margin = new System.Windows.Forms.Padding(6); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(220, 94); + this.button16.TabIndex = 16; + this.button16.Text = "Transferir timbres"; + this.button16.UseVisualStyleBackColor = true; + this.button16.Click += new System.EventHandler(this.button16_Click); + // + // button15 + // + this.button15.Location = new System.Drawing.Point(10, 141); + this.button15.Margin = new System.Windows.Forms.Padding(6); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(220, 94); + this.button15.TabIndex = 15; + this.button15.Text = "Obtener movimiento por ID"; + this.button15.UseVisualStyleBackColor = true; + this.button15.Click += new System.EventHandler(this.button15_Click); + // + // button14 + // + this.button14.Location = new System.Drawing.Point(10, 34); + this.button14.Margin = new System.Windows.Forms.Padding(6); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(220, 94); + this.button14.TabIndex = 14; + this.button14.Text = "Listar movimientos"; + this.button14.UseVisualStyleBackColor = true; + this.button14.Click += new System.EventHandler(this.button14_Click); + // + // groupBox12 + // + this.groupBox12.Controls.Add(this.button13); + this.groupBox12.Controls.Add(this.button1); + this.groupBox12.Location = new System.Drawing.Point(6, 372); + this.groupBox12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox12.Name = "groupBox12"; + this.groupBox12.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.groupBox12.Size = new System.Drawing.Size(480, 125); + this.groupBox12.TabIndex = 22; + this.groupBox12.TabStop = false; + this.groupBox12.Text = "CUENTA"; + // + // button13 + // + this.button13.Location = new System.Drawing.Point(10, 23); + this.button13.Margin = new System.Windows.Forms.Padding(6); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(220, 94); + this.button13.TabIndex = 13; + this.button13.Text = "Crear cuenta"; + this.button13.UseVisualStyleBackColor = true; + this.button13.Click += new System.EventHandler(this.button13_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(243, 23); + this.button1.Margin = new System.Windows.Forms.Padding(6); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(220, 94); + this.button1.TabIndex = 12; + this.button1.Text = "Iniciar sesión"; + this.button1.UseVisualStyleBackColor = true; + // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(906, 848); + this.ClientSize = new System.Drawing.Size(1959, 1325); this.Controls.Add(this.tabControl1); - this.Margin = new System.Windows.Forms.Padding(4); + this.Margin = new System.Windows.Forms.Padding(6); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; @@ -1072,15 +1109,16 @@ private void InitializeComponent() this.groupBox5.ResumeLayout(false); this.groupBox6.ResumeLayout(false); this.tabControl1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.groupBox9.ResumeLayout(false); + this.groupBox8.ResumeLayout(false); + this.groupBox7.ResumeLayout(false); this.tabPage1.ResumeLayout(false); + this.groupBox14.ResumeLayout(false); this.groupBox10.ResumeLayout(false); this.groupBox11.ResumeLayout(false); this.groupBox13.ResumeLayout(false); this.groupBox12.ResumeLayout(false); - this.tabPage2.ResumeLayout(false); - this.groupBox9.ResumeLayout(false); - this.groupBox8.ResumeLayout(false); - this.groupBox7.ResumeLayout(false); this.ResumeLayout(false); } @@ -1165,6 +1203,8 @@ private void InitializeComponent() private System.Windows.Forms.Button button5; private System.Windows.Forms.GroupBox groupBox11; private System.Windows.Forms.Button button6; + private System.Windows.Forms.GroupBox groupBox14; + private System.Windows.Forms.Button FirmarButton; } } diff --git a/FiscalApi.Samples.NetFramework/Form1.cs b/FiscalApi.Samples.NetFramework/Form1.cs index 7babf0d..c2655b1 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 @@ -3036,5 +3036,31 @@ private async void button17_Click(object sender, EventArgs e) MessageBox.Show(apiResponse.Details); } } + + private async void FirmarButton_Click(object sender, EventArgs e) + { + var fiscalapi = FiscalApiClient.Create(Settings); + + // Fiel (EKU9001283C9) + var requestModel = new SignManifestRequest + { + Base64Cer = "MIIGBDCCA+ygAwIBAgIUMzAwMDEwMDAwMDA1MDAwMDM0MTUwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWxpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQUNBTjERMA8GA1UELRMIMi41LjQuNDUxJTAjBgkqhkiG9w0BCQITFnJlc3BvbnNhYmxlOiBBQ0RNQS1TQVQwHhcNMjMwNTE4MDQzNzE0WhcNMjcwNTE3MDQzNzE0WjCB+TEnMCUGA1UEAxMeRVNDVUVMQSBLRU1QRVIgVVJHQVRFIFNBIERFIENWMScwJQYDVQQpEx5FU0NVRUxBIEtFTVBFUiBVUkdBVEUgU0EgREUgQ1YxJzAlBgNVBAoTHkVTQ1VFTEEgS0VNUEVSIFVSR0FURSBTQSBERSBDVjELMAkGA1UEBhMCTVgxKDAmBgkqhkiG9w0BCQEWGVNBVHBydWViYXNAcHJ1ZWJhcy5nb2IubXgxJTAjBgNVBC0THEVLVTkwMDMxNzNDOSAvIFZBREE4MDA5MjdESjMxHjAcBgNVBAUTFSAvIFZBREE4MDA5MjdIU1JTUkwwNTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANGvrdNGWRoqw2vVRPwA3oL5g5oEoTV3YufXF/1xzM4/vk7Nyt7m10+OStBdk0tKJ+DtOXdBFnYauwkq3ts1iOH2yr69CqLfHwPjQ9zKLn+A17ZUJK7UImHHgiVP0LkbLWc0rKtU2LnSlTvWoysOljm+4pn1OUMWbTpnxNDzjl4SoFcmKZ6WhyXIDM6oV3Aqt5zjRyFTFcRiZ8Etx0Nf62PwHpwBK+lxa0FwdVv/aj4a13vbtHS2MrDU7HquPkEtYILlTaGQKt7fljGWKgfJa9UKUg3xSzy+Wc2AuyjYBsg9igP/Q1b1fsJ+lzLsNdRJnAb/aDIXbbrFR/YfxIdo2lcCAwEAAaNPME0wDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCA9gwEQYJYIZIAYb4QgEBBAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMEBggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAgEAtaZpEeckrtGhCHn/7TjipPsCgf5UAw6FSqaQALL1cQt6M+XkEqeZQEJHBfSHLhdJw/FziELA2Qc7hv7dv6M5muA0wiFTRdxNT5faD8Dh3SomOmOxcGG4RSX7Yxm3AohSU2ktbImZB1Ku8zszMfBGGBVuJM5tUzRaGO/8313T/GN5Bu/ficBaUKGMKLqPVCmhHmHLphP++rnq1W04hOhdZ1GwdfEMlPJJTxGzKevfesTX1kTAAOkvJ7efWm3+FHOosyTUZsBplAPX6v5lPs8dTjyOuPsqJNELXDamJ7+ALhwkvYTTjpINUkG8UZZ/gllu0T12CqC7z/dHckZTyevJ8IfZYOJOXa63GIABcrSB/vatzQHJ1f1MS+psMQIrVbLuv0S0n6IlGe17NI6Mzu8sUXku+pcICElqrfs7hoTvSpl33gDOgb/AH9/KQHv5izWs94C+taXeHd+ZhZxzlr6FLIJjzc7EP+a9x8ntJELUYgpLuehuGvMOJtJT/cOhnyZ79sGPq8LEsTma0Hse/mujtJNbN8ZlhnrGnIsMONvRUJm6LFpU5rPqG8zKJZliKJGBj/4zKNKx3jc8Jy5pMcaqnG0W5Q8QcYorTKMIsPBKlTVOF7x2E9kvRbQuVL36MmljSVOsK73gm4OZ6ORKM+K4wZKrOoz9uGvSzVyDIgytCvg=", + Base64Key = "MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS9AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucRBAKNQXH8t0f2aSYkk74BKjNDtQ2u5LylXUf6MrOHJZV3J/U8IVU02MuKmvSb5kIvEKE3FZ/OSKoZC58sLQ/+m1joBEHn2QgMld3NsSRA6rv5Jv7Gyl8URb3XT6W7qr/nznufyuxyBSTj68+HgdJt/EeGp3Ud1Sk/1mY8PEt7tT86UjH+20/07ZVIhik6fQDFxELrm4jCJkTrQenqEykHVy/w5mJgrqwfS4SsGaNY9J5TUJNauyw193y/6C48SxwpTjA2GYtpxIUl9GNtXbUHUvsbVTZ06gnnCXUx3IOj+wFI9qUvPYl2DVSfV3iVAYsTXG/R5gOIw4k6s235gZEfJpoQZ4eq1LiYbKXqTjR9ntCEit0RyWirwt/2UcrRNgnXFU58xYUzY45noSR6QD8u05ZGsGT1Q3xesanSxCmsjrfh26a5EoH3voFhpI99/M2CyhwIm63ab2CKz8DMrhCPWxUgKDn2xZgW79zBgQ6qN0t9iqJ69guwG4rkWNqs/5vyYdK5PbJSt9KmeHZNYl1/wBMP4PDomA0iHiRQ2Jpc7tdedQXPid3DSIrk9XqMwB6SBThGOSzJ4Tkb78ybsHTjx3apF4ZHH6U66WzRbjggt2H0XmCbKLvNbAPqfA+vZzpIZK0LrsUGvG/wtoqFedZ/AV3wBvQTIRkwHImvFqoDd7fMCg8MLV3yJJGNcgcsI1RSV0EAJ5YafNHR9IPNl6pI7X6RDT7jobeyelyE5xepJklnNCIGLkYTGmXgXG0cYxtWYqvT7jQuEeseFSlxScxbvWI1vTzRpuis2YiZYteX4f+kGnMq6eOw+qtqXwB2bsw48ZGC9Ar34znqX/iOogQD+I2zWfllEdhQWdBF11m5YmwfnfQyoOOhx5s2bdqWv+XN6BMtRxfG7UOvB0p9ki1FdGOBD9BsSaF0etF8HPmy9zHPugCRQH50eVbqNnxPAnyaucPR/8ZEJXVuQ99KkhZRwr5brR9WP6ooDnws+yMe3q95hVVXWd4zDWPuh2JcT4ZzVzm9iwB7EZDYYCq/UXTg07Bb8hL0pw7UJFDelNMr4HOsarJZyUZferGQ62Ki7d/9xGOF4aL/lmni5okXU+fUKWkT7UhJCcxr3zeCnbe5FTNZgjIbieAMPtJiS30ow1EtxUsQF32f14lDdsi8twTT0GsILvZwNvGk/KZRlQU2iLm4hr44w6gmyg1J7m5ivL/MwbQ/DIf4djcOqckWBqtLCAp/HwSYjIXxrlPF1pICnzbfxTc6gLyTOsvoCngSnP2feOMTMMpFXVC1h0mfObxOhcbwxCC18AnNqfxh5rCvNxKYi0yqa5g9UFBOOKyxrhvP/eMdnPpd1DtvzP79zMQCQ+NlXt/XtmDRNUpPc7nPwhdPbRJTsetDqZK9NQf6cZ4/2cDIMd1/QomTmzKU9cjNXZgMcDSY7UYrN+n8CrETwu9dgNDuYjynh4XYlm0x9/Rx5r+77d1nzE6rkBH17/lH3fb8p4MWDlr6HIIgXxYCmeAhiws8tthJoD/nk1n6fvrxTFrEmEE1XG7JrNrDP1dLnjH+paHXy0thdQ8lpBMM4Wtqk0KVPn2SyaY3dslkdHg=", + Password = "12345678a" + }; + + var apiResponse = await fiscalapi.Manifests.SignAsync(requestModel); + + if (apiResponse.Succeeded) + { + MessageBox.Show("Manifiesto Firmado para el RFC EKU9001283C9"); + // apiResponse.Data contiene el manifiesto firmado (PDF) en formato Base64. Puedes decodificarlo y guardarlo según sea necesario. + } + else + { + MessageBox.Show(apiResponse.Message); + MessageBox.Show(apiResponse.Details); + } + } } } \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.Designer.cs b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.Designer.cs index 69f3485..ed1e3bb 100644 --- a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.Designer.cs +++ b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.Designer.cs @@ -39,15 +39,16 @@ private void InitializeComponent() this.button10 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // button5 // - this.button5.Location = new System.Drawing.Point(203, 87); - this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button5.Location = new System.Drawing.Point(304, 136); + this.button5.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(189, 60); + this.button5.Size = new System.Drawing.Size(284, 94); this.button5.TabIndex = 4; this.button5.Text = "Consultar estado de factura"; this.button5.UseVisualStyleBackColor = true; @@ -55,10 +56,10 @@ private void InitializeComponent() // // button6 // - this.button6.Location = new System.Drawing.Point(203, 219); - this.button6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button6.Location = new System.Drawing.Point(304, 342); + this.button6.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(189, 60); + this.button6.Size = new System.Drawing.Size(284, 94); this.button6.TabIndex = 5; this.button6.Text = "Enviar factura por email"; this.button6.UseVisualStyleBackColor = true; @@ -66,10 +67,10 @@ private void InitializeComponent() // // button7 // - this.button7.Location = new System.Drawing.Point(203, 286); - this.button7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button7.Location = new System.Drawing.Point(304, 447); + this.button7.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(189, 60); + this.button7.Size = new System.Drawing.Size(284, 94); this.button7.TabIndex = 6; this.button7.Text = "Cancelar factura"; this.button7.UseVisualStyleBackColor = true; @@ -80,6 +81,7 @@ private void InitializeComponent() 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.button14); this.groupBox1.Controls.Add(this.button13); this.groupBox1.Controls.Add(this.button12); @@ -90,21 +92,21 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.button7); this.groupBox1.Controls.Add(this.button6); this.groupBox1.Controls.Add(this.button5); - this.groupBox1.Location = new System.Drawing.Point(12, 12); - this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Location = new System.Drawing.Point(18, 19); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.groupBox1.Size = new System.Drawing.Size(401, 359); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.groupBox1.Size = new System.Drawing.Size(602, 737); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Facturación por referencias"; // // button14 // - this.button14.Location = new System.Drawing.Point(203, 21); - this.button14.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button14.Location = new System.Drawing.Point(304, 33); + this.button14.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button14.Name = "button14"; - this.button14.Size = new System.Drawing.Size(189, 60); + this.button14.Size = new System.Drawing.Size(284, 94); this.button14.TabIndex = 13; this.button14.Text = "Complemento carta porte"; this.button14.UseVisualStyleBackColor = true; @@ -112,10 +114,10 @@ private void InitializeComponent() // // button13 // - this.button13.Location = new System.Drawing.Point(5, 286); - this.button13.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button13.Location = new System.Drawing.Point(8, 447); + this.button13.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button13.Name = "button13"; - this.button13.Size = new System.Drawing.Size(189, 60); + this.button13.Size = new System.Drawing.Size(284, 94); this.button13.TabIndex = 12; this.button13.Text = "Complemento de impuestos locales"; this.button13.UseVisualStyleBackColor = true; @@ -123,10 +125,10 @@ private void InitializeComponent() // // button12 // - this.button12.Location = new System.Drawing.Point(5, 219); - this.button12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button12.Location = new System.Drawing.Point(8, 342); + this.button12.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button12.Name = "button12"; - this.button12.Size = new System.Drawing.Size(189, 60); + this.button12.Size = new System.Drawing.Size(284, 94); this.button12.TabIndex = 11; this.button12.Text = "Complemento de nómina"; this.button12.UseVisualStyleBackColor = true; @@ -134,10 +136,10 @@ private void InitializeComponent() // // button11 // - this.button11.Location = new System.Drawing.Point(5, 153); - this.button11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button11.Location = new System.Drawing.Point(8, 239); + this.button11.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button11.Name = "button11"; - this.button11.Size = new System.Drawing.Size(189, 60); + this.button11.Size = new System.Drawing.Size(284, 94); this.button11.TabIndex = 10; this.button11.Text = "Complemento de pago"; this.button11.UseVisualStyleBackColor = true; @@ -145,10 +147,10 @@ private void InitializeComponent() // // button10 // - this.button10.Location = new System.Drawing.Point(5, 87); - this.button10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button10.Location = new System.Drawing.Point(8, 136); + this.button10.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button10.Name = "button10"; - this.button10.Size = new System.Drawing.Size(189, 60); + this.button10.Size = new System.Drawing.Size(284, 94); this.button10.TabIndex = 9; this.button10.Text = "Facturas de egreso"; this.button10.UseVisualStyleBackColor = true; @@ -156,10 +158,10 @@ private void InitializeComponent() // // button9 // - this.button9.Location = new System.Drawing.Point(5, 21); - this.button9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button9.Location = new System.Drawing.Point(8, 33); + this.button9.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button9.Name = "button9"; - this.button9.Size = new System.Drawing.Size(189, 60); + this.button9.Size = new System.Drawing.Size(284, 94); this.button9.TabIndex = 8; this.button9.Text = "Facturas de ingreso"; this.button9.UseVisualStyleBackColor = true; @@ -167,23 +169,35 @@ private void InitializeComponent() // // button8 // - this.button8.Location = new System.Drawing.Point(203, 153); - this.button8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.button8.Location = new System.Drawing.Point(304, 239); + this.button8.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(189, 60); + this.button8.Size = new System.Drawing.Size(284, 94); this.button8.TabIndex = 7; this.button8.Text = "Generar PDF"; this.button8.UseVisualStyleBackColor = true; this.button8.Click += new System.EventHandler(this.button8_Click); // + // button1 + // + this.button1.Location = new System.Drawing.Point(8, 547); + this.button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(284, 94); + this.button1.TabIndex = 14; + this.button1.Text = "Complemento Comercio Exterior"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // // InvoiceReferenceForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(425, 384); + this.ClientSize = new System.Drawing.Size(638, 776); this.Controls.Add(this.groupBox1); - this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Name = "InvoiceReferenceForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "InvoiceReferenceForm"; this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); @@ -202,5 +216,6 @@ private void InitializeComponent() private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button14; + private System.Windows.Forms.Button button1; } } \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs index 51b049d..e95edf5 100644 --- a/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs +++ b/FiscalApi.Samples.NetFramework/InvoiceReferenceForm.cs @@ -173,7 +173,14 @@ private void button13_Click(object sender, EventArgs e) private void button14_Click(object sender, EventArgs e) { + BillOfLadingReferenceForm billOfLadingReferenceForm = new BillOfLadingReferenceForm(_settings); + billOfLadingReferenceForm.ShowDialog(); + } + private void button1_Click(object sender, EventArgs e) + { + ComercioExteriorReferenceForm comercioExteriorReferenceForm = new ComercioExteriorReferenceForm(_settings); + comercioExteriorReferenceForm.Show(); } } } diff --git a/FiscalApi.Samples.NetFramework/InvoiceValueForm.Designer.cs b/FiscalApi.Samples.NetFramework/InvoiceValueForm.Designer.cs index f95717f..15b0c5f 100644 --- a/FiscalApi.Samples.NetFramework/InvoiceValueForm.Designer.cs +++ b/FiscalApi.Samples.NetFramework/InvoiceValueForm.Designer.cs @@ -32,6 +32,7 @@ private void InitializeComponent() this.button6 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.ComplementoComercioExteriorButton = new System.Windows.Forms.Button(); this.button13 = new System.Windows.Forms.Button(); this.button12 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); @@ -44,10 +45,10 @@ private void InitializeComponent() // // button5 // - this.button5.Location = new System.Drawing.Point(152, 71); - this.button5.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button5.Location = new System.Drawing.Point(304, 137); + this.button5.Margin = new System.Windows.Forms.Padding(4); this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(142, 49); + this.button5.Size = new System.Drawing.Size(284, 94); this.button5.TabIndex = 4; this.button5.Text = "Cancelar factura"; this.button5.UseVisualStyleBackColor = true; @@ -55,10 +56,10 @@ private void InitializeComponent() // // button6 // - this.button6.Location = new System.Drawing.Point(152, 124); - this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button6.Location = new System.Drawing.Point(304, 238); + this.button6.Margin = new System.Windows.Forms.Padding(4); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(142, 49); + this.button6.Size = new System.Drawing.Size(284, 94); this.button6.TabIndex = 5; this.button6.Text = "Consultar estado de factura"; this.button6.UseVisualStyleBackColor = true; @@ -66,10 +67,10 @@ private void InitializeComponent() // // button7 // - this.button7.Location = new System.Drawing.Point(152, 232); - this.button7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button7.Location = new System.Drawing.Point(304, 446); + this.button7.Margin = new System.Windows.Forms.Padding(4); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(142, 49); + this.button7.Size = new System.Drawing.Size(284, 94); this.button7.TabIndex = 6; this.button7.Text = "Enviar factura por Email"; this.button7.UseVisualStyleBackColor = true; @@ -80,6 +81,7 @@ private void InitializeComponent() 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.ComplementoComercioExteriorButton); this.groupBox1.Controls.Add(this.button13); this.groupBox1.Controls.Add(this.button12); this.groupBox1.Controls.Add(this.button11); @@ -90,21 +92,32 @@ private void InitializeComponent() this.groupBox1.Controls.Add(this.button7); this.groupBox1.Controls.Add(this.button6); this.groupBox1.Controls.Add(this.button5); - this.groupBox1.Location = new System.Drawing.Point(9, 10); - this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.groupBox1.Location = new System.Drawing.Point(18, 19); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.groupBox1.Size = new System.Drawing.Size(300, 288); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4); + this.groupBox1.Size = new System.Drawing.Size(600, 798); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Facturación por valores"; // + // ComplementoComercioExteriorButton + // + this.ComplementoComercioExteriorButton.Location = new System.Drawing.Point(0, 548); + this.ComplementoComercioExteriorButton.Margin = new System.Windows.Forms.Padding(4); + this.ComplementoComercioExteriorButton.Name = "ComplementoComercioExteriorButton"; + this.ComplementoComercioExteriorButton.Size = new System.Drawing.Size(284, 94); + this.ComplementoComercioExteriorButton.TabIndex = 14; + this.ComplementoComercioExteriorButton.Text = "Complemento Comercio Exterior"; + this.ComplementoComercioExteriorButton.UseVisualStyleBackColor = true; + this.ComplementoComercioExteriorButton.Click += new System.EventHandler(this.ComplementoComercioExteriorButton_Click); + // // button13 // - this.button13.Location = new System.Drawing.Point(152, 17); - this.button13.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button13.Location = new System.Drawing.Point(304, 33); + this.button13.Margin = new System.Windows.Forms.Padding(4); this.button13.Name = "button13"; - this.button13.Size = new System.Drawing.Size(142, 49); + this.button13.Size = new System.Drawing.Size(284, 94); this.button13.TabIndex = 13; this.button13.Text = "Complemento carta porte"; this.button13.UseVisualStyleBackColor = true; @@ -112,10 +125,10 @@ private void InitializeComponent() // // button12 // - this.button12.Location = new System.Drawing.Point(4, 232); - this.button12.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button12.Location = new System.Drawing.Point(8, 446); + this.button12.Margin = new System.Windows.Forms.Padding(4); this.button12.Name = "button12"; - this.button12.Size = new System.Drawing.Size(142, 49); + this.button12.Size = new System.Drawing.Size(284, 94); this.button12.TabIndex = 12; this.button12.Text = "Complemento impuestos locales"; this.button12.UseVisualStyleBackColor = true; @@ -123,10 +136,10 @@ private void InitializeComponent() // // button11 // - this.button11.Location = new System.Drawing.Point(4, 178); - this.button11.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button11.Location = new System.Drawing.Point(8, 342); + this.button11.Margin = new System.Windows.Forms.Padding(4); this.button11.Name = "button11"; - this.button11.Size = new System.Drawing.Size(142, 49); + this.button11.Size = new System.Drawing.Size(284, 94); this.button11.TabIndex = 11; this.button11.Text = "Complemento de nómina"; this.button11.UseVisualStyleBackColor = true; @@ -134,10 +147,10 @@ private void InitializeComponent() // // button10 // - this.button10.Location = new System.Drawing.Point(4, 124); - this.button10.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button10.Location = new System.Drawing.Point(8, 238); + this.button10.Margin = new System.Windows.Forms.Padding(4); this.button10.Name = "button10"; - this.button10.Size = new System.Drawing.Size(142, 49); + this.button10.Size = new System.Drawing.Size(284, 94); this.button10.TabIndex = 10; this.button10.Text = "Complemento de pago"; this.button10.UseVisualStyleBackColor = true; @@ -145,10 +158,10 @@ private void InitializeComponent() // // button9 // - this.button9.Location = new System.Drawing.Point(4, 71); - this.button9.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button9.Location = new System.Drawing.Point(8, 137); + this.button9.Margin = new System.Windows.Forms.Padding(4); this.button9.Name = "button9"; - this.button9.Size = new System.Drawing.Size(142, 49); + this.button9.Size = new System.Drawing.Size(284, 94); this.button9.TabIndex = 9; this.button9.Text = "Facturas de egreso"; this.button9.UseVisualStyleBackColor = true; @@ -156,10 +169,10 @@ private void InitializeComponent() // // button1 // - this.button1.Location = new System.Drawing.Point(4, 17); - this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button1.Location = new System.Drawing.Point(8, 33); + this.button1.Margin = new System.Windows.Forms.Padding(4); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(142, 49); + this.button1.Size = new System.Drawing.Size(284, 94); this.button1.TabIndex = 8; this.button1.Text = "Facturas de ingreso"; this.button1.UseVisualStyleBackColor = true; @@ -167,10 +180,10 @@ private void InitializeComponent() // // button8 // - this.button8.Location = new System.Drawing.Point(152, 178); - this.button8.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button8.Location = new System.Drawing.Point(304, 342); + this.button8.Margin = new System.Windows.Forms.Padding(4); this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(142, 49); + this.button8.Size = new System.Drawing.Size(284, 94); this.button8.TabIndex = 7; this.button8.Text = "Generar PDF"; this.button8.UseVisualStyleBackColor = true; @@ -178,12 +191,13 @@ private void InitializeComponent() // // InvoiceValueForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(318, 307); + this.ClientSize = new System.Drawing.Size(636, 834); this.Controls.Add(this.groupBox1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "InvoiceValueForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "InvoiceValueForm"; this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); @@ -202,5 +216,6 @@ private void InitializeComponent() private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button13; + private System.Windows.Forms.Button ComplementoComercioExteriorButton; } } \ No newline at end of file diff --git a/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs b/FiscalApi.Samples.NetFramework/InvoiceValueForm.cs index 0a7858c..4f95947 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) @@ -776,5 +777,11 @@ private void button12_Click_1(object sender, EventArgs e) LocalTaxesComplementValueForm localTaxesComplementForm = new LocalTaxesComplementValueForm(_settings); localTaxesComplementForm.ShowDialog(); } + + private void ComplementoComercioExteriorButton_Click(object sender, EventArgs e) + { + ComercioExteriorValuesForm comercioExteriorValuesForm = new ComercioExteriorValuesForm(_settings); + comercioExteriorValuesForm.ShowDialog(); + } } } diff --git a/FiscalApi.Samples.NetFramework/packages.config b/FiscalApi.Samples.NetFramework/packages.config index 949191e..362f92f 100644 --- a/FiscalApi.Samples.NetFramework/packages.config +++ b/FiscalApi.Samples.NetFramework/packages.config @@ -1,6 +1,6 @@  - + @@ -20,4 +20,5 @@ + \ No newline at end of file