ProvPrimer.SendInvoice Method

Use this function to send invoices to myDATA through Primer Invoicing Provider
Public Function SendInvoice( _ 
ByVal inv As invoice, _ 
ByVal primerData As primerData, _ 
Optional ByVal extraPrimer As extraPrimer = Nothing _ 
) As Dictionary(Of String, String)
This language is not supported or no code example is available.
public Dictionary<string, string> SendInvoice( 
invoice inv
primerData primerData
extraPrimer extraPrimer = Nothing 
)
This language is not supported or no code example is available.

Parameters

inv
invoice

The invoice type of invoice

primerData
primerData

The provider's data, type of primerData

extraPrimer
extraPrimer

The extra fields required by Primer Invoicing Provider, type of extraPrimer

Return Value

Dictionary<string, string>
Example
 
  var pri = new ProvPrimer("primerUser", "primerParssowrd", false);
  invoice invoice = sni.newInvoice;
 
  #region issuer and counterpart
  		invoice.issuer.vatNumber = "555777003";
  		invoice.issuer.country = "GR";
  		
  		invoice.counterpart.vatNumber = "555777001";
  		invoice.counterpart.country = "GR";
  #endregion
 
  #region elements
  		invoice.elements.series = "IZ";
  		invoice.elements.aa = 8;
  		invoice.elements.issueDate = DateTime.Now;
  		invoice.elements.invoiceType = "1.1";
  		
  		var tr = default(otherTransportDetails);
  		tr.vehicleNumber = "BD51 SMR";
  		invoice.transportDetails.Add(tr);
  #endregion
 
  #region Lines
  		invoiceLine ln = sni.newLine;
  		ln.netValue = 100.0d;
  		ln.VatCategory = 1;
  		ln.VatAmount = 24.0d;
  		ln.lineComments = "line comment";
  		ln.classification.Type = "E3_561_001"; // This field refers to the E3 code
  		ln.classification.Category = "category1_1";
  		
  		invoice.lines.Add(ln);
  #endregion
 
  #region payments
  		paymentMethod tmpPay = sni.newPaymentMethod;
  		tmpPay.@type = 1;
  		tmpPay.amount = 124.0d;
  		invoice.payments.Add(tmpPay);
  #endregion
 
  #region Primer Data
  		var pri = default(primerData);
  		pri.extraDetails.issuerName = "George M.";
  		pri.extraDetails.issuerAddress = "New Street 111";
  		pri.extraDetails.issuerPostalCode = "12345";
  		pri.extraDetails.issuerCity = "Thessaloniki";
  		pri.extraDetails.issuerEmail = "issuer@myemail.com";
  		pri.extraDetails.issuerPhone = "00302101111111";
  		
  		pri.extraDetails.counterpartName = "Papadopoulos G.";
  		pri.extraDetails.counterpartAddress = "New street 57";
  		pri.extraDetails.counterpartPostalCode = "12345";
  		pri.extraDetails.counterpartCity = "Athens";
  		pri.extraDetails.counterpartEmail = "counterpart@myemail.gr";
  		pri.extraDetails.counterpartPhone = "00302101111111";
  		
  		pri.extraDetails.paymentTerms = "E-Banking";
  		
  		var pLines = new List<provLine>();
  		var pline = new provLine();
  		pline.discountPercentage = 0.0d;
  		pline.discountAmount = 0.0d;
  		pline.itemName = "TEST PRODUCT";
  		pline.itemCode = "123";
  		pline.countryOfOrigin = "US";
  		pline.peppolTaxCategory = "S";
  		pline.peppolMeasurementUnit = "XUN";
  		
  		var pItems = new List<peppolItemClass>();
  		var pItem = default(peppolItemClass);
  		pItem.itemID = "03100000-2";
  		pItem.itemClass = "STI";
  		pItems.Add(pItem);
  		pline.itemClass = pItems;
  		
  		pLines.Add(pline);
  		ily.invoiceLines = pLines;
  #endregion
 
  #region Primer Extra Data
  		var extPrimer = new ProvPrimer.extraPrimer();
  		extPrimer.loadFriendlyName = "Test Storage";
  		extPrimer.notes = "";
  		extPrimer.counterpartCode = "1000001";
  		extPrimer.counterpartJob = "Online Services and Software";
  #endregion
 
  Dictionary<string, string> result = pri.SendInvoice(invoice, ext, extPrimer);
  string qrUL = pri.getQRUrl;
  Image qrImage = pri.getQRImage(500);
  					
This language is not supported or no code example is available.
  Dim pri As ProvPrimer = New ProvPrimer("primerUser", "primerParssowrd", False)
  Dim invoice As invoice = sni.newInvoice
 
  #Region "issuer and counterpart"
         invoice.issuer.vatNumber = "555777003"
         invoice.issuer.country = "GR"
 
         invoice.counterpart.vatNumber = "555777001"
         invoice.counterpart.country = "GR"
  #End Region
 
  #Region "elements"
         invoice.elements.series = "IZ"
         invoice.elements.aa = 8
         invoice.elements.issueDate = Date.Now
         invoice.elements.invoiceType = "1.1"
 
         Dim tr As otherTransportDetails
         tr.vehicleNumber = "BD51 SMR"
         invoice.transportDetails.Add(tr)
  #End Region
 
  #Region "Lines"
         Dim ln As invoiceLine = sni.newLine
         ln.netValue = 100.0
         ln.VatCategory = 1
         ln.VatAmount = 24.0
         ln.lineComments = "line comment"
         ln.classification.Type = "E3_561_001" ' This field refers to the E3 code
         ln.classification.Category = "category1_1"
 
         invoice.lines.Add(ln)
  #End Region
 
  #Region "payments"
         Dim tmpPay As paymentMethod = sni.newPaymentMethod
         tmpPay.type = 1
         tmpPay.amount = 124.0
         invoice.payments.Add(tmpPay)
  #End Region
 
  #Region "Primer Data"
      Dim pri As primerData
      pri.extraDetails.issuerName = "George M."
      pri.extraDetails.issuerAddress = "New Street 111"
      pri.extraDetails.issuerPostalCode = "12345"
      pri.extraDetails.issuerCity = "Thessaloniki"
      pri.extraDetails.issuerEmail = "issuer@myemail.com"
      pri.extraDetails.issuerPhone = "00302101111111"
 
      pri.extraDetails.counterpartName = "Papadopoulos G."
      pri.extraDetails.counterpartAddress = "New street 57"
      pri.extraDetails.counterpartPostalCode = "12345"
      pri.extraDetails.counterpartCity = "Athens"
      pri.extraDetails.counterpartEmail = "counterpart@myemail.gr"
      pri.extraDetails.counterpartPhone = "00302101111111"
 
      pri.extraDetails.paymentTerms = "E-Banking"
 
      Dim pLines As New List(Of provLine)
      Dim pline As New provLine
      pline.discountPercentage = 0.0
      pline.discountAmount = 0.0
      pline.itemName = "TEST PRODUCT"
      pline.itemCode = "123"
      pline.countryOfOrigin = "US"
      pline.peppolTaxCategory = "S"
      pline.peppolMeasurementUnit = "XUN"
 
      Dim pItems As New List(Of peppolItemClass)
      Dim pItem As peppolItemClass
      pItem.itemID = "03100000-2"
      pItem.itemClass = "STI"
      pItems.Add(pItem)
      pline.itemClass = pItems
 
      pLines.Add(pline)
      ily.invoiceLines = pLines
  #End Region
 
  #Region "Primer Extra Data"
      Dim extPrimer As ProvPrimer.extraPrimer = New ProvPrimer.extraPrimer
      extPrimer.loadFriendlyName = "Test Storage"
      extPrimer.notes = ""
      extPrimer.counterpartCode = "1000001"
      extPrimer.counterpartJob = "Online Services and Software"
  #End Region
 
  Dim result As Dictionary(Of String, String) = pri.SendInvoice(invoice, ext, extPrimer)
  Dim qrUL As String = pri.getQRUrl
  Dim qrImage As Image = pri.getQRImage(500)
  					
This language is not supported or no code example is available.

.NET Framework

Supported in: 3.5 or newer

In this article

Definition