private MyXmlDoc MakeXMLv1() { var xdoc = new MyXmlDoc(); XmlElement DokZDNv1 = xdoc.CreateElement("DokZDNv1"); DokZDNv1.SetAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");; DokZDNv1.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); xdoc.AppendChild(DokZDNv1); var s = MyData.Params.CompRegNrPVNx; if (s.Length != 11) { MyMainForm.ShowError("Nekorekts PVN reģ.nr."); return(null); } xdoc.XE(DokZDNv1, "NmrKods", s); s = MyData.Params.CompAccName; xdoc.XE(DokZDNv1, "NmNosaukums", s); xdoc.XE(DokZDNv1, "Vaditajs", tbName.Text); xdoc.XE(DokZDNv1, "Talrunis", tbPhoneNr.Text); xdoc.XE(DokZDNv1, "DatumsAizp", RepDate, true); var tab = xdoc.CreateElement("Tab"); DokZDNv1.AppendChild(tab); var rs = xdoc.CreateElement("Rs"); tab.AppendChild(rs); foreach (var row in ReportRows) { var r = xdoc.CreateElement("R"); rs.AppendChild(r); xdoc.XE(r, "Npk", row.Nr); xdoc.XE(r, "PersonasKods", row.PK); xdoc.XE(r, "VardsUzvards", row.Name); xdoc.XE(r, "IzmDatums", row.RDate, true); xdoc.XE(r, "ZinuKods", row.Code); xdoc.XENZ(r, "ProfKods", row.ProfessionCode); } return(xdoc); }
private MyXmlDoc MakeXMLV2() { var xdoc = new MyXmlDoc(); XmlElement DokDDZv2 = xdoc.CreateElement("DokDDZv3"); DokDDZv2.SetAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");; DokDDZv2.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); xdoc.AppendChild(DokDDZv2); xdoc.XE(DokDDZv2, "Precizejums", "false"); xdoc.XE(DokDDZv2, "ParskGads", Year); xdoc.XE(DokDDZv2, "ParskMen", Month); var s = MyData.Params.CompRegNrPVNx; if (s.Length != 11) { MyMainForm.ShowError("Nekorekts PVN reģ.nr."); return(null); } xdoc.XE(DokDDZv2, "NmrKods", s); xdoc.XE(DokDDZv2, "IzmaksasDatums", PayDay); xdoc.XE(DokDDZv2, "Sagatavotajs", tbName.Text); xdoc.XENZ(DokDDZv2, "Talrunis", tbPhoneNr.Text); if (ReportData == null || ReportData.Rows1.Count == 0) { return(xdoc); } xdoc.XE(DokDDZv2, "Ienakumi", ReportData.TotalRow.Income); xdoc.XE(DokDDZv2, "Iemaksas", ReportData.TotalRow.SAI); xdoc.XE(DokDDZv2, "PrecizetieIenakumi", ReportData.TotalRow.IncomeCorrected); xdoc.XE(DokDDZv2, "PrecizetasIemaksas", ReportData.TotalRow.SAICorrected); xdoc.XE(DokDDZv2, "IeturetaisNodoklis", ReportData.TotalRow.IIN); xdoc.XE(DokDDZv2, "RiskaNodeva", ReportData.TotalRow.URVN); for (int i = 0; i < 6; i++) { var rows = ReportData.RowsX[i]; if (rows.Count == 0) { continue; } var tab = xdoc.CreateElement("Tab" + (i + 1)); DokDDZv2.AppendChild(tab); foreach (var row in rows) { var r = xdoc.CreateElement("R"); tab.AppendChild(r); xdoc.XE(r, "PersonasKods", row.PK); xdoc.XE(r, "VardsUzvards", row.Name); xdoc.XE(r, "Statuss", row.Tp2s); if (row.Tp != 4) { xdoc.XE(r, "Ienakumi", row.Income); xdoc.XE(r, "Iemaksas", row.SAI); xdoc.XENZ(r, "PrecizetieIenakumi", row.IncomeCorrected); xdoc.XENZ(r, "PrecizetasIemaksas", row.SAICorrected); } xdoc.XENZ(r, "IeturetaisNodoklis", row.IIN); xdoc.XE(r, "DarbaVeids", "1"); xdoc.XE(r, "RiskaNodevasPazime", row.HasURVN ? "1" : "0"); xdoc.XEIF(row.HasURVN, r, "RiskaNodeva", row.URVN); xdoc.XE(r, "Stundas", (int)row.Hours); } } return(xdoc); }
private MyXmlDoc MakeXML() { var xdoc = new MyXmlDoc(); XmlElement DokDDZv1 = xdoc.CreateElement("DokDDZv1"); DokDDZv1.SetAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");; DokDDZv1.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); xdoc.AppendChild(DokDDZv1); xdoc.XE(DokDDZv1, "TaksGads", Year); xdoc.XE(DokDDZv1, "TaksMenesis", Month); var s = MyData.Params.CompRegNrPVNx; if (s.Length != 11) { MyMainForm.ShowError("Nekorekts PVN reģ.nr."); return(null); } xdoc.XE(DokDDZv1, "NmrKods", s); s = MyData.Params.CompAccName; xdoc.XE(DokDDZv1, "NmNosaukums", s); xdoc.XE(DokDDZv1, "IzmaksasDatums", PayDay); xdoc.XE(DokDDZv1, "AtbildPers", tbName.Text); DateTime dt; if (!string.IsNullOrEmpty(tbDate.Text) && DateTime.TryParse(tbDate.Text, out dt)) { xdoc.XE(DokDDZv1, "DatumsAizp", dt); } xdoc.XENZ(DokDDZv1, "Talrunis", tbPhoneNr.Text); if (ReportData.Rows1.Count == 0) { return(xdoc); } xdoc.XE(DokDDZv1, "Ienakumi", ReportData.TotalRow.Income); xdoc.XE(DokDDZv1, "Iemaksas", ReportData.TotalRow.SAI); xdoc.XE(DokDDZv1, "PrecizetieIenakumi", ReportData.TotalRow.IncomeCorrected); xdoc.XE(DokDDZv1, "PrecizetasIemaksas", ReportData.TotalRow.SAICorrected); xdoc.XE(DokDDZv1, "IetIedzNodoklis", ReportData.TotalRow.IIN); xdoc.XE(DokDDZv1, "RiskaNod", ReportData.TotalRow.URVN); for (int i = 0; i < 6; i++) { var rows = ReportData.RowsX[i]; if (rows.Count == 0) { continue; } var tab = xdoc.CreateElement("Tab" + (i + 1)); DokDDZv1.AppendChild(tab); var rs = xdoc.CreateElement("Rs"); tab.AppendChild(rs); foreach (var row in rows) { var r = xdoc.CreateElement("R"); rs.AppendChild(r); xdoc.XE(r, "Npk", row.Nr); xdoc.XE(r, "PersonasKods", row.PK); xdoc.XE(r, "VardsUzvards", row.Name); xdoc.XE(r, "SamStat", row.Tp2s); if (row.Tp != 4) { xdoc.XE(r, "Ienakumi", row.Income); xdoc.XE(r, "Iemaksas", row.SAI); xdoc.XENZ(r, "PrecizetieIenakumi", row.IncomeCorrected); xdoc.XENZ(r, "PrecizetasIemaksas", row.SAICorrected); } xdoc.XENZ(r, "IetIedzNodoklis", row.IIN); xdoc.XE(r, "DarbaVeids", "1"); xdoc.XE(r, "RiskaNodPazime", row.HasURVN ? "1" : "0"); xdoc.XEIF(row.HasURVN, r, "RiskaNod", row.URVN); xdoc.XE(r, "Stundas", (int)row.Hours); } var trow = ReportData.TotalRowsX[i]; xdoc.XE(tab, "Ienakumi", trow.Income); xdoc.XE(tab, "Iemaksas", trow.SAI); xdoc.XENZ(tab, "PrecizetieIenakumi", trow.IncomeCorrected); xdoc.XENZ(tab, "PrecizetasIemaksas", trow.SAICorrected); xdoc.XENZ(tab, "IetIedzNodoklis", trow.IIN); xdoc.XENZ(tab, "RiskaNod", trow.URVN); } return(xdoc); }
private MyXmlDoc MakeXML2() { var xdoc = new MyXmlDoc(); XmlElement DokPFPISKv3 = xdoc.CreateElement("DokPFPISKv3"); DokPFPISKv3.SetAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");; DokPFPISKv3.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); xdoc.AppendChild(DokPFPISKv3); var smt = ReportTP == Report_IINk.EReportType.ForMonth ? string.Format("{0:00}", Month) : "00"; xdoc.XE(DokPFPISKv3, "ParskGads", Year); xdoc.XE(DokPFPISKv3, "ParskMen", smt); var s = MyData.Params.CompRegNrPVNx; if (s.Length != 11) { MyMainForm.ShowError("Nekorekts PVN reģ.nr."); return(null); } xdoc.XE(DokPFPISKv3, "NmrKods", s); xdoc.XE(DokPFPISKv3, "IesniegsanasVeids", 1); //xdoc.XE(DokPFPISKv2, "Epasts", ""); xdoc.XENZ(DokPFPISKv3, "Talrunis", tbPhoneNr.Text); xdoc.XENZ(DokPFPISKv3, "Sagatavotajs", tbName.Text); if (ReportData.Rows.Count == 0) { return(xdoc); } var rows = ReportData.Rows; var tab = xdoc.CreateElement("Tab"); DokPFPISKv3.AppendChild(tab); foreach (var row in rows) { var r = xdoc.CreateElement("R"); tab.AppendChild(r); xdoc.XE(r, "PersonasKods", row.PK); xdoc.XE(r, "VardsUzvards", row.Name); xdoc.XE(r, "IenakumaVeids", row.IncomeType); xdoc.XE(r, "IenakumuPeriodsNo", row.Date1); xdoc.XE(r, "IenakumuPeriodsLidz", row.Date2); //xdoc.XE(r, "IzmaksasDatums", row.Date2); if (row.IncomeType != "1001") { xdoc.XE(r, "IzmaksasMenesis", row.Date2.Month.ToString("00")); } xdoc.XE(r, "Ienemumi", row.income); xdoc.XENZ(r, "NeapliekamieIenakumi", row.income_nottaxed); xdoc.XENZ(r, "NeapliekamaisMinimums", row.untaxed_minimum); xdoc.XENZ(r, "AtvieglojumiParApgadajamiem", row.iin_exempt_dependants); xdoc.XEIF(row.iin_exempt_x0 > 0.0M, r, "AtvieglojumaKods", row.iin_exempt_x_code); xdoc.XENZ(r, "AtvieglojumaSumma", row.iin_exempt_x); xdoc.XENZ(r, "VSAObligatasIemaksa", row.dnsn_amount); xdoc.XENZ(r, "IemaksasPPF", row.plus_pf_nottaxed); xdoc.XENZ(r, "ApdrosinasanasSummaArUzkrasanu", row.plus_li_nottaxed); xdoc.XENZ(r, "ApdrosinasanasSummaBezUzkrasanas", row.plus_hi_nottaxed); xdoc.XENZ(r, "Izdevumi", row.iin_exempt_expenses); xdoc.XENZ(r, "Nodoklis", row.iin_amount); } return(xdoc); }