Online NAV süti LENSTAR!

This commit is contained in:
2018-08-07 14:52:26 +02:00
parent 2b6c1301f8
commit 37c9ce7495
13 changed files with 168 additions and 8 deletions
@@ -0,0 +1,93 @@
namespace Nuvolar.Module.Controllers
{
partial class NAV_Online_VC
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.aNAV_queryInvoiceStatus = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
this.aNAV_manageInvoice = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
this.aNAV_queryTaxpayer = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
this.aNAV_queryInvoiceData = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
//
// aNAV_queryInvoiceStatus
//
this.aNAV_queryInvoiceStatus.Caption = "aNAV_queryInvoiceStatus";
this.aNAV_queryInvoiceStatus.ConfirmationMessage = null;
this.aNAV_queryInvoiceStatus.Id = "aNAV_queryInvoiceStatus";
this.aNAV_queryInvoiceStatus.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aNAV_queryInvoiceStatus.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
this.aNAV_queryInvoiceStatus.ToolTip = null;
this.aNAV_queryInvoiceStatus.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryInvoiceStatus_Execute);
//
// aNAV_manageInvoice
//
this.aNAV_manageInvoice.Caption = "aNAV_manageInvoice";
this.aNAV_manageInvoice.ConfirmationMessage = null;
this.aNAV_manageInvoice.Id = "aNAV_manageInvoice";
this.aNAV_manageInvoice.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aNAV_manageInvoice.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
this.aNAV_manageInvoice.ToolTip = null;
this.aNAV_manageInvoice.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_manageInvoice_Execute);
//
// aNAV_queryTaxpayer
//
this.aNAV_queryTaxpayer.Caption = "aNAV_queryTaxpayer";
this.aNAV_queryTaxpayer.ConfirmationMessage = null;
this.aNAV_queryTaxpayer.Id = "aNAV_queryTaxpayer";
this.aNAV_queryTaxpayer.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aNAV_queryTaxpayer.TargetObjectType = typeof(Nuvolar.Module.Customers);
this.aNAV_queryTaxpayer.ToolTip = null;
this.aNAV_queryTaxpayer.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryTaxpayer_Execute);
//
// aNAV_queryInvoiceData
//
this.aNAV_queryInvoiceData.Caption = "aNAV_queryInvoiceData";
this.aNAV_queryInvoiceData.ConfirmationMessage = null;
this.aNAV_queryInvoiceData.Id = "aNAV_queryInvoiceData";
this.aNAV_queryInvoiceData.SelectionDependencyType = DevExpress.ExpressApp.Actions.SelectionDependencyType.RequireSingleObject;
this.aNAV_queryInvoiceData.TargetObjectType = typeof(Nuvolar.Module.InvoiceHeader);
this.aNAV_queryInvoiceData.ToolTip = null;
this.aNAV_queryInvoiceData.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aNAV_queryInvoiceData_Execute);
//
// NAV_Online_VC
//
this.Actions.Add(this.aNAV_queryInvoiceStatus);
this.Actions.Add(this.aNAV_manageInvoice);
this.Actions.Add(this.aNAV_queryTaxpayer);
this.Actions.Add(this.aNAV_queryInvoiceData);
}
#endregion
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryInvoiceStatus;
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_manageInvoice;
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryTaxpayer;
private DevExpress.ExpressApp.Actions.SimpleAction aNAV_queryInvoiceData;
}
}
@@ -0,0 +1,271 @@
using DevExpress.Data.Filtering;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Xpo;
using Newtonsoft.Json;
using Nuvolar.Module.StaticClass;
namespace Nuvolar.Module.Controllers
{
public partial class NAV_Online_VC : ViewController
{
public NAV_Online_VC()
{
InitializeComponent();
// Target required Views (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target View.
}
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
/// <summary>
/// Adószám ellenőrzése a kiválasztott ügyfelek alapján
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void aNAV_queryTaxpayer_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
Customers _Customers = View.SelectedObjects[0] as Customers;
CustomersFrom _CustomersFrom = _ocur.FindObject<CustomersFrom>(CriteriaOperator.Parse("IsDefault=True"));
var _postData = new
{
customersfrom = _CustomersFrom.Oid.ToString(),
taxPayer = _Customers.VATNumber.Substring(0, 8),
softwareId = "123456789123456789",
softwareName = "3C ERP System",
softwareOperation = "ONLINE_SERVICE",
softwareMainVersion = "17.2.3",
softwareDevName = "3C Távközlési Kft.",
softwareDevContact = "http:\\3ctelecom.hu",
softwareDevCountryCode = "HU",
softwareDevTaxNumber = "10644209-2-43"
};
RestAPI.ExecuteRootePOST("onlineinvoice/querytaxpayer", true, JsonConvert.SerializeObject(_postData));
var _StatusCode = RestAPI.StatusCode;
var _StatusDescription = RestAPI.StatusMessage;
if (_StatusCode == 200)
{
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
if (_ResultJSON.status.ToString() == "OK")
{
if (_ResultJSON.taxpayerValidity["0"].ToString() == "false")
{
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE Customers set NAV_valid = 0,NAV_queryDate=NOW() WHERE Oid = '{0}'",
_Customers.Oid.ToString()));
}
if (_ResultJSON.taxpayerValidity["0"].ToString() == "true")
{
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE Customers set NAV_valid = 1,NAV_queryDate=NOW() WHERE Oid = '{0}'",
_Customers.Oid.ToString()));
}
Application.ShowViewStrategy.ShowMessage("Adószám ellenőrzés megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
}
if (_ResultJSON.status.ToString() == "ERROR")
{
string _ERROR = "Adószám ellenőrzés nem történt meg !";
_ERROR += " [" + _ResultJSON.xml.result.message.ToString() + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
else
{
string _ERROR = "Adószám ellenőrzés nem történt meg !";
_ERROR += " [" + _StatusDescription.ToString() + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
private void aNAV_manageInvoice_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
string _operation = "CREATE";
if (_InvoiceHeader.IsStorno)
{
_operation = "STORNO";
}
var _postData = new
{
documentnumber = _InvoiceHeader.DocumentNumber,
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
operation = _operation,
technicalAnnulment = false,
softwareId = "123456789123456789",
softwareName = "3C ERP System",
softwareOperation = "ONLINE_SERVICE",
softwareMainVersion = "17.2.3",
softwareDevName = "3C Távközlési Kft.",
softwareDevContact = "http:\\3ctelecom.hu",
softwareDevCountryCode = "HU",
softwareDevTaxNumber = "10644209-2-43"
};
RestAPI.ExecuteRootePOST("onlineinvoice/manageinvoice", true, JsonConvert.SerializeObject(_postData));
var _StatusCode = RestAPI.StatusCode;
var _StatusDescription = RestAPI.StatusMessage;
if (_StatusCode == 200)
{
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
if (_ResultJSON.status.ToString() == "OK")
{
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE InvoiceHeader set NAV_transactionID='{0}' WHERE Oid = '{1}'", _ResultJSON.transactionId["0"].ToString(), _InvoiceHeader.Oid.ToString()));
Application.ShowViewStrategy.ShowMessage("A számla beküldése megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
}
if (_ResultJSON.status.ToString() == "ERROR")
{
string _ERROR = "A számla beküldése nem történt meg !";
_ERROR += " [" + _ResultJSON.xml.result.message.ToString() + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
else
{
string _ERROR = "A számla beküldése nem történt meg !";
_ERROR += " [" + _StatusDescription + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
(View as ListView).CollectionSource.Reload();
}
private void aNAV_queryInvoiceStatus_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = View.ObjectSpace as XPObjectSpace;
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
var _postData = new
{
documentnumber = _InvoiceHeader.DocumentNumber,
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
transactionId = _InvoiceHeader.NAV_transactionId,
softwareId = "123456789123456789",
softwareName = "3C ERP System",
softwareOperation = "ONLINE_SERVICE",
softwareMainVersion = "17.2.3",
softwareDevName = "3C Távközlési Kft.",
softwareDevContact = "http:\\3ctelecom.hu",
softwareDevCountryCode = "HU",
softwareDevTaxNumber = "10644209-2-43"
};
RestAPI.ExecuteRootePOST("onlineinvoice/queryinvoicestatus", true, JsonConvert.SerializeObject(_postData));
var _StatusCode = RestAPI.StatusCode;
var _StatusDescription = RestAPI.StatusMessage;
if (_StatusCode == 200)
{
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
if (_ResultJSON.status.ToString() == "OK")
{
_ocur.Session.ExecuteNonQuery(string.Format("UPDATE InvoiceHeader set NAV_InvoiceStatus='{0}',NAV_queryDate=NOW() WHERE Oid = '{1}'",
_ResultJSON.processingResults.processingResult.invoiceStatus.ToString(), _InvoiceHeader.Oid.ToString()));
//_ResultJSON.processingResults.processingResult.technicalValidationMessages[0].message.ToString()
if (_ResultJSON.processingResults.processingResult.technicalValidationMessages != null)
{
Application.ShowViewStrategy.ShowMessage(_ResultJSON.processingResults.processingResult.technicalValidationMessages[0].message.ToString(),
InformationType.Error, 10000, InformationPosition.Bottom);
}
if (_ResultJSON.processingResults.processingResult.businessValidationMessages != null)
{
Application.ShowViewStrategy.ShowMessage(_ResultJSON.processingResults.processingResult.businessValidationMessages.message.ToString(),
InformationType.Error, 10000, InformationPosition.Bottom);
}
Application.ShowViewStrategy.ShowMessage("A számla státusz lekérdezése megtörtént !", InformationType.Success, 2000, InformationPosition.Bottom);
}
if (_ResultJSON.status.ToString() == "ERROR")
{
}
}
else
{
string _ERROR = "A számla státusz ellenőrzés nem történt meg !";
_ERROR += " [" + _StatusDescription + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
private void aNAV_queryInvoiceData_Execute(object sender, SimpleActionExecuteEventArgs e)
{
InvoiceHeader _InvoiceHeader = View.SelectedObjects[0] as InvoiceHeader;
var _postData = new
{
invoiceNumber = _InvoiceHeader.DocumentNumber,
customersfrom = _InvoiceHeader.CustomersFrom.Oid.ToString(),
softwareId = "123456789123456789",
softwareName = "3C ERP System",
softwareOperation = "ONLINE_SERVICE",
softwareMainVersion = "17.2.3",
softwareDevName = "3C Távközlési Kft.",
softwareDevContact = "http:\\3ctelecom.hu",
softwareDevCountryCode = "HU",
softwareDevTaxNumber = "10644209-2-43"
};
RestAPI.ExecuteRootePOST("onlineinvoice/queryinvoicedata", true, JsonConvert.SerializeObject(_postData));
var _StatusCode = RestAPI.StatusCode;
var _StatusDescription = RestAPI.StatusMessage;
if (_StatusCode == 200)
{
dynamic _ResultJSON = JsonConvert.DeserializeObject(_StatusDescription);
if (_ResultJSON.status.ToString() == "OK")
{
if (_ResultJSON.queryResults.availablePage.ToString() == "0")
{
string _ERROR = "A számla adat ellenőrzés megtörtént ! Nincs elérhető adat!";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Warning, 5000, InformationPosition.Bottom);
}
if (_ResultJSON.queryResults.availablePage.ToString() != "0")
{
string _ERROR = "A számla adat ellenőrzés megtörtént !";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Success, 5000, InformationPosition.Bottom);
}
}
if (_ResultJSON.status.ToString() == "ERROR")
{
string _ERROR = "A számla adat ellenőrzés nem történt meg !";
_ERROR += " [" + _ResultJSON.technicalValidationMessages.message.ToString() + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
else
{
string _ERROR = "A számla státusz ellenőrzés nem történt meg !";
_ERROR += " [" + _StatusDescription + "]";
Application.ShowViewStrategy.ShowMessage(_ERROR, InformationType.Error, 5000, InformationPosition.Bottom);
}
}
}
}
@@ -0,0 +1,54 @@
namespace Nuvolar.Module
{
partial class NavInvoiceReportVC
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.aCreateNAVInvoiceReportXML = new DevExpress.ExpressApp.Actions.SimpleAction(this.components);
//
// aCreateNAVInvoiceReportXML
//
this.aCreateNAVInvoiceReportXML.ActionMeaning = DevExpress.ExpressApp.Actions.ActionMeaning.Accept;
this.aCreateNAVInvoiceReportXML.Caption = "aCreate NAVInvoice Report XML";
this.aCreateNAVInvoiceReportXML.ConfirmationMessage = "aCreateNAVInvoiceReportXML";
this.aCreateNAVInvoiceReportXML.Id = "aCreateNAVInvoiceReportXML";
this.aCreateNAVInvoiceReportXML.TargetObjectType = typeof(Nuvolar.Module.NAVInvoiceReport);
this.aCreateNAVInvoiceReportXML.ToolTip = null;
this.aCreateNAVInvoiceReportXML.Execute += new DevExpress.ExpressApp.Actions.SimpleActionExecuteEventHandler(this.aCreateNAVInvoiceReportXML_Execute);
//
// NavInvoiceReportVC
//
this.Actions.Add(this.aCreateNAVInvoiceReportXML);
}
#endregion
private DevExpress.ExpressApp.Actions.SimpleAction aCreateNAVInvoiceReportXML;
}
}
@@ -0,0 +1,204 @@
using System;
using System.Linq;
using DevExpress.ExpressApp;
using System.Collections.Generic;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Validation;
using System.Xml;
using DevExpress.Xpo;
using DevExpress.ExpressApp.Xpo;
using DevExpress.Data.Filtering;
using Nuvolar.Module;
using System.Globalization;
using System.Windows.Forms;
namespace Nuvolar.Module
{
// For more typical usage scenarios, be sure to check out http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppViewControllertopic.
public partial class NavInvoiceReportVC : ViewController
{
public NavInvoiceReportVC()
{
InitializeComponent();
RegisterActions(components);
// Target required Views (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target View.
}
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}
private void aCreateNAVInvoiceReportXML_Execute(object sender, SimpleActionExecuteEventArgs e)
{
XPObjectSpace _ocur = (XPObjectSpace)View.ObjectSpace;
XPObjectSpace _onew = (XPObjectSpace)Application.CreateObjectSpace();
NAVInvoiceReport _NAVInvoiceReport = (NAVInvoiceReport)View.SelectedObjects[0];
//Kritéria a törzsbõl
System.String _Criteria=" IsEditable=false and IsProforma=false and DocumentNumber!='' and IsNull(DocumentNumber)=false";
if (string.IsNullOrEmpty(_NAVInvoiceReport.DocumentNumberFrom)==false & string.IsNullOrEmpty(_NAVInvoiceReport.DocumentNumberTo)==false)
{
_Criteria += string.Format(" and (DocumentNumber>='{0}' and DocumentNumber <='{1}')", _NAVInvoiceReport.DocumentNumberFrom, _NAVInvoiceReport.DocumentNumberTo);
}
_Criteria += " and (GetDate(DateCreated)>=? and GetDate(DateCreated)<=?)";
XPCollection<InvoiceHeader> _InvoiceHeader_Collection = new XPCollection<InvoiceHeader>(_onew.Session, CriteriaOperator.Parse(_Criteria, _NAVInvoiceReport.FromDate, _NAVInvoiceReport.ToDate));
_InvoiceHeader_Collection.Sorting.Add(new SortProperty("DateCreated", DevExpress.Xpo.DB.SortingDirection.Ascending));
System.String _Filename = string.Format(@"NR{0:yyyyMMddHHmm}.xml", System.DateTime.Now);
if (Validator.RuleSet.ValidateAll(View.ObjectSpace, View.SelectedObjects, DefaultContexts.Save))
{
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true, NewLineOnAttributes = true };
using (XmlWriter writer = XmlWriter.Create(string.Format(@"{0}\{1}",_NAVInvoiceReport.OutputPath,_Filename), settings))
{
writer.WriteStartDocument();
writer.WriteStartElement("szamlak", @"http://schemas.nav.gov.hu/2013/szamla");
writer.WriteElementString("export_datuma", DateTime.Now.ToString(@"yyyy-MM-dd"));
writer.WriteElementString("export_szla_db", _InvoiceHeader_Collection.Count.ToString());
writer.WriteElementString("kezdo_ido", _NAVInvoiceReport.FromDate.ToString(@"yyyy-MM-dd"));
writer.WriteElementString("zaro_ido", _NAVInvoiceReport.ToDate.ToString(@"yyyy-MM-dd"));
writer.WriteElementString("kezdo_szamlaszam", _NAVInvoiceReport.DocumentNumberFrom);
writer.WriteElementString("zaro_szamlaszam", _NAVInvoiceReport.DocumentNumberTo);
foreach (InvoiceHeader _InvoiceHeader in _InvoiceHeader_Collection)
{
writer.WriteStartElement("szamla");
writer.WriteStartElement("fejlec");
writer.WriteElementString("szlasorszam", _InvoiceHeader.DocumentNumber);
writer.WriteElementString("szlatipus", "1");
writer.WriteElementString("szladatum", _InvoiceHeader.DateCreated.ToString(@"yyyy-MM-dd"));
writer.WriteElementString("teljdatum", _InvoiceHeader.DateExecution.ToString(@"yyyy-MM-dd"));
writer.WriteEndElement();//fejlec
writer.WriteStartElement("szamlakibocsato");
writer.WriteElementString("adoszam", _InvoiceHeader.Saved_CustomersFrom_VATNumber);
writer.WriteElementString("kisadozo", "false");
writer.WriteElementString("nev", _InvoiceHeader.Saved_CustomersFrom_Name);
writer.WriteStartElement("cim");
writer.WriteElementString("iranyitoszam", _InvoiceHeader.Saved_CustomersFrom_Address_ZipPostal);
writer.WriteElementString("telepules", _InvoiceHeader.Saved_CustomersFrom_Address_City);
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NameOfStreet") != null)
{ writer.WriteElementString("kozterulet_neve", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NameOfStreet").ToString()); }
else
{ writer.WriteElementString("kozterulet_neve", _InvoiceHeader.Saved_CustomersFrom_Address_Street); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("District") != null) { writer.WriteElementString("kerulet", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("District").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("TypeOfStreet") != null) { writer.WriteElementString("kozterulet_jellege", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("TypeOfStreet").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NumberOfStreet") != null) { writer.WriteElementString("hazszam", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NumberOfStreet").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("Building") != null) { writer.WriteElementString("epulet", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("Building").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("StairCase") != null) { writer.WriteElementString("lepcsohaz", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("StairCase").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("Floor") != null) { writer.WriteElementString("szint", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("Floor").ToString()); }
if (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NumberOfDoor") != null) { writer.WriteElementString("ajto", _InvoiceHeader.CustomersFrom.Address1.GetMemberValue("NumberOfDoor").ToString()); }
//writer.WriteElementString("kerulet", (_InvoiceHeader.CustomersFrom.Address1.GetMemberValue("District") ?? "").ToString());
writer.WriteElementString("egyeni_vallalkozo", "");
writer.WriteElementString("ev_nyilv_tart_szam", "");
writer.WriteElementString("ev_neve", "");
writer.WriteEndElement();//cim
writer.WriteEndElement();//szamlakibocsato
writer.WriteStartElement("vevo");
writer.WriteElementString("nev", _InvoiceHeader.Saved_Customers_Name);
writer.WriteStartElement("cim");
writer.WriteElementString("iranyitoszam", _InvoiceHeader.Saved_Customers_Address_ZipPostal);
writer.WriteElementString("telepules", _InvoiceHeader.Saved_Customers_Address_City);
if (_InvoiceHeader.Customers.Address1.GetMemberValue("NameOfStreet") != null)
{ writer.WriteElementString("kozterulet_neve", _InvoiceHeader.Customers.Address1.GetMemberValue("NameOfStreet").ToString()); }
else
{ writer.WriteElementString("kozterulet_neve", _InvoiceHeader.Saved_Customers_Address_Street); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("District") != null) { writer.WriteElementString("kerulet", _InvoiceHeader.Customers.Address1.GetMemberValue("District").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("TypeOfStreet") != null) { writer.WriteElementString("kozterulet_jellege", _InvoiceHeader.Customers.Address1.GetMemberValue("TypeOfStreet").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("NumberOfStreet") != null) { writer.WriteElementString("hazszam", _InvoiceHeader.Customers.Address1.GetMemberValue("NumberOfStreet").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("Building") != null) { writer.WriteElementString("epulet", _InvoiceHeader.Customers.Address1.GetMemberValue("Building").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("StairCase") != null) { writer.WriteElementString("lepcsohaz", _InvoiceHeader.Customers.Address1.GetMemberValue("StairCase").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("Floor") != null) { writer.WriteElementString("szint", _InvoiceHeader.Customers.Address1.GetMemberValue("Floor").ToString()); }
if (_InvoiceHeader.Customers.Address1.GetMemberValue("NumberOfDoor") != null) { writer.WriteElementString("ajto", _InvoiceHeader.Customers.Address1.GetMemberValue("NumberOfDoor").ToString()); }
writer.WriteEndElement();//cim
writer.WriteEndElement();//vevo
foreach (InvoiceRows _InvoiceRows in _InvoiceHeader.InvoiceRows)
{
writer.WriteStartElement("termek_szolgaltatas_tetelek");
writer.WriteElementString("termeknev", _InvoiceRows.ShortName);
writer.WriteElementString("menny", _InvoiceRows.QTT.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("mertekegys", _InvoiceRows.Units.ShortName);
writer.WriteElementString("nettoar", _InvoiceRows.SumPriceHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("nettoegysar", _InvoiceRows.ListPriceHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("adokulcs", _InvoiceRows.VAT.KeyValue.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("adoertek", (_InvoiceRows.SumPriceBruttoHUF - _InvoiceRows.SumPriceHUF).ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("bruttoar", _InvoiceRows.SumPriceBruttoHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteEndElement();//termek_szolgaltatas_tetelek
}
writer.WriteStartElement("zaradekok");
writer.WriteElementString("adoment_hiv", "false");
writer.WriteEndElement(); //zaradekok
writer.WriteStartElement("nem_kotelezo");
writer.WriteElementString("fiz_hatarido", _InvoiceHeader.DatePayment.ToString(@"yyyy-MM-dd"));
writer.WriteElementString("fiz_mod", _InvoiceHeader.PaymentOption.ShortName);
writer.WriteElementString("penznem", _InvoiceHeader.CurrencyName.ShortName);
writer.WriteEndElement(); //nem_kotelezo
writer.WriteStartElement("osszesites");
foreach (InvoiceVATRows _InvoiceVATRows in _InvoiceHeader.InvoiceVATRows)
{
writer.WriteStartElement("afarovat");
writer.WriteElementString("nettoar", _InvoiceVATRows.AmountNettoHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("adokulcs", _InvoiceVATRows.VAT.KeyValue.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("adoertek", _InvoiceVATRows.AmountVATHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("bruttoar", _InvoiceVATRows.AmountBruttoHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteEndElement(); //afarovat
}
writer.WriteStartElement("vegosszeg");
writer.WriteElementString("nettoarossz", _InvoiceHeader.TotalNettoHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("afaertekossz", _InvoiceHeader.TotalVATHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteElementString("bruttoarossz", _InvoiceHeader.TotalBruttoHUF.ToString("F", CultureInfo.InvariantCulture));
writer.WriteEndElement(); //vegosszeg
writer.WriteEndElement(); //osszesites
writer.WriteEndElement(); //szamla
}
writer.WriteEndElement();
writer.WriteEndDocument();
MessageBox.Show(string.Format("A letöltés befejezõdött !\nA fájl a következõ helyen :\n{0}", string.Format(@"{0}\{1}", _NAVInvoiceReport.OutputPath, _Filename)), "Adatletöltés állapota", MessageBoxButtons.OK);
}
}
}
private void simpleAction1_Execute(object sender, SimpleActionExecuteEventArgs e)
{
DevExpress.ExpressApp.Reports.Win.ReportsController _ReportsController = Frame.GetController<DevExpress.ExpressApp.Reports.Win.ReportsController>();
_ReportsController.ShowReportDesignerAction.DoExecute();
}
}
}
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aCreateNAVInvoiceReportXML.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>146, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>