public static void insertPagamenti(Pagamenti item) { using (MySqlConnection cnMySql = new MySqlConnection(connectionString)) { cnMySql.Open(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("INSERT INTO antique.pagamenti(`id_pagamenti`, `data_ultimo_pagamento`, `totale_pagamento`, `numero_fattura`, `anno_fattura`, `tipo_fattura`, `numregpn`, `annocom`)"); sb.Append("VALUES "); sb.Append("(?id_pagamenti, ?data_ultimo_pagamento, ?totale_pagamento, ?numero_fattura, ?anno_fattura, ?tipo_fattura, ?numregpn, ?annocom)"); using (MySqlCommand cmd = new MySqlCommand(sb.ToString(), cnMySql)) { try { cmd.ExecuteNonQuery(); } catch (MySqlException ex) { EventLogger.LogError("Errore durante l'inserimento dell'oggetto Pagamenti nel database.", ex); } } cnMySql.Close(); } }
public void Load() { #region Pagamento1 MinValue-1/1/2013 Pagamenti.GetInstance().AddPagamento(new DateTime(2014, 1, 1)); #endregion #region Pagamento2 1/1/2014-1/6/2014 Pagamenti.GetInstance().AddPagamento(new DateTime(2014, 6, 1)); #endregion }
/// <summary> /// Replace per Pagamenti /// </summary> public static string Replace(this string text, Pagamenti pagamenti) { if (pagamenti == null) return text; if (string.IsNullOrEmpty(text)) return string.Empty; text = text.Replace("[ID]", pagamenti.Id.ToString()); text = text.Replace("[PCREDITI]", pagamenti.Crediti.ToString()); text = text.Replace("[PDATA]", pagamenti.Data.ToString()); text = text.Replace("[PPREZZO]", pagamenti.Prezzo.ToString()); return text; }
private void buttonSalva_Click(object sender, EventArgs e) { try { Pagamenti.GetInstance().AddPagamento(dateTimePickerDataPagamento.Value); this.Hide(); } catch (ArgumentException exc) { MessageBox.Show(exc.Message); } }
private void PopolaCampiPagam(int idPagam, bool enableControls) { //Rendo i textbox abilitati/disabilitati in base al parametro enableControls EnableDisableControls(enableControls, pnlGestPagam); Pagamenti p = PagamentiDAO.GetSingle(idPagam); ddlScegliCant.SelectedItem.Value = p.IdTblCantieri.ToString(); txtDataDDT.Text = p.Data.ToString("yyyy-MM-dd"); txtDataDDT.TextMode = TextBoxMode.Date; txtImportoPagam.Text = p.Imporo.ToString(); txtDescrPagam.Text = p.DescriPagamenti.ToString(); chkSaldo.Checked = p.Saldo; chkAcconto.Checked = p.Acconto; }
protected Pagamenti getPagamentiFromReader(IDataReader reader) { Pagamenti item = new Pagamenti(); item.Id_pagamenti = ConvertDBObjectToInt(reader["id_pagamenti"]); item.Data_ultimo_pagamento = ConvertDBObjectToDateTime(reader["data_ultimo_pagamento"]); item.Totale_pagamento = (reader["totale_pagamento"]); item.Numero_fattura = ConvertDBObjectToInt(reader["numero_fattura"]); item.Anno_fattura = ConvertDBObjectToInt(reader["anno_fattura"]); item.Tipo_fattura = ConvertDBObjectToInt(reader["tipo_fattura"]); item.Numregpn = ConvertDBObjectToInt(reader["numregpn"]); item.Annocom = ConvertDBObjectToString(reader["annocom"]); return item; }
static void Main(string[] args) { Impianto.GetInstance().Load(); #region Stampe Impianto //foreach (Settore s in Impianto.GetInstance().Settori) // Console.WriteLine(s); //foreach (Lavoro l in Impianto.GetInstance().Lavori) // Console.WriteLine(l); #endregion PersonaleFactory.Load(); #region Stampe Personale //Console.WriteLine("Numero Coordinatori: " + PersonaleFactory.GetPersonaleQualificato(Qualifica.Coordinatore).Count); //Console.WriteLine("Numero Capi Unita: " + (PersonaleFactory.GetPersonaleQualificato(Qualifica.CapoUnita).Count - // PersonaleFactory.GetPersonaleQualificato(Qualifica.Coordinatore).Count)); //Console.WriteLine("Numero Steward: " + (PersonaleFactory.GetPersonaleQualificato(Qualifica.Steward).Count - // PersonaleFactory.GetPersonaleQualificato(Qualifica.CapoUnita).Count)); //foreach (IPersonale p in PersonaleFactory.GetTuttoPersonale()) // Console.WriteLine(p); #endregion MansioneFactory.Load(); #region Stampe Mansione //foreach (Mansione m in MansioneFactory.GetMansioni()) //{ // Console.WriteLine(m); // foreach (RetribuzioneMansione rm in m.Retribuzioni) // Console.WriteLine(rm); //} #endregion Eventi.GetInstance().Load(); #region Stampe Eventi //foreach (Evento e in Eventi.GetInstance().ListaEventi) // Console.WriteLine(e); #endregion Pagamenti.GetInstance().Load(); #region Stampe Pagamenti //foreach (Pagamento p in Pagamenti.GetInstance().ListaPagamenti) // Console.WriteLine(p); #endregion Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
//INSERT public static bool InserisciPagamento(Pagamenti pag) { bool ret = false; StringBuilder sql = new StringBuilder(); sql.AppendLine($"INSERT INTO TblPagamenti (IdTblCantieri, data, Imporo, DescriPagamenti, Acconto, Saldo)"); sql.AppendLine($"VALUES (@IdTblCantieri, @data, @Imporo, @DescriPagamenti, @Acconto, @Saldo)"); try { using (SqlConnection cn = GetConnection()) { ret = cn.Execute(sql.ToString(), pag) > 0; } } catch (Exception ex) { throw new Exception("Errore durante l'inserimento di un pagamento", ex); } return(ret); }
public static Pagamenti GetSingle(int idPagamenti) { Pagamenti ret = new Pagamenti(); StringBuilder sql = new StringBuilder(); sql.AppendLine($"SELECT *"); sql.AppendLine($"FROM TblPagamenti"); sql.AppendLine($"WHERE IdPagamenti = @idPagamenti"); try { using (SqlConnection cn = GetConnection()) { ret = cn.Query <Pagamenti>(sql.ToString(), new { idPagamenti }).FirstOrDefault(); } } catch (Exception ex) { throw new Exception("Errore durante il recupero del singolo pagamento", ex); } return(ret); }
//UPDATE public static bool UpdatePagamento(Pagamenti pag) { bool ret = false; StringBuilder sql = new StringBuilder(); sql.AppendLine($"UPDATE TblPagamenti"); sql.AppendLine($"SET IdTblCantieri = @IdTblCantieri, data = @data, Imporo = @Imporo,"); sql.AppendLine($"DescriPagamenti = @DescriPagamenti, Acconto = @Acconto, Saldo = @Saldo"); sql.AppendLine($"WHERE IdPagamenti = @IdPagamenti"); try { using (SqlConnection cn = GetConnection()) { ret = cn.Execute(sql.ToString(), pag) > 0; } } catch (Exception ex) { throw new Exception("Errore durante la modifica di un pagamento", ex); } return(ret); }
public static void updatePagamenti(Pagamenti item) { using (MySqlConnection cnMySql = new MySqlConnection(connectionString)) { cnMySql.Open(); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("UPDATE antique.pagamenti "); sb.Append("SET "); sb.Append("`id_pagamenti` = ?id_pagamenti, "); sb.Append("`data_ultimo_pagamento` = ?data_ultimo_pagamento, "); sb.Append("`totale_pagamento` = ?totale_pagamento, "); sb.Append("`numero_fattura` = ?numero_fattura, "); sb.Append("`anno_fattura` = ?anno_fattura, "); sb.Append("`tipo_fattura` = ?tipo_fattura, "); sb.Append("`numregpn` = ?numregpn, "); sb.Append("`annocom` = ?annocom, "); sb.Append("WHERE id=?id;"); using (MySqlCommand cmd = new MySqlCommand(sb.ToString(), cnMySql)) { //lista parametri comando try { cmd.ExecuteNonQuery(); } catch (MySqlException ex) { EventLogger.LogError("Errore durante l'aggiornamento dell'oggetto Pagamenti nel database.", ex); } } cnMySql.Close(); } }
/// <summary> /// Email inviata all'utente che conferma il pagamento, confermato da IPN /// </summary> internal static void PagamentoEffettuato(Pagamenti pagamenti) { if (pagamenti == null) return; string oggetto = Configurazione.GetItem(Configurazione.ConfigurazioneEnum.EmailPagamentoOggetto).Valore.Replace(pagamenti).Replace(pagamenti.Utenti); string contenuto = Configurazione.GetItem(Configurazione.ConfigurazioneEnum.EmailPagamentoContenuto).Valore.Replace(pagamenti).Replace(pagamenti.Utenti); ; InviaEmail(Settings.Config.Email.SenderNoReply, pagamenti.Utenti.Email, oggetto, contenuto); }
// // Lunghezza piede 55 mm // public async Task <int> PrintDocFooterAsync(Fatture doc, int row, bool stprice) { string num = ""; string str = ""; Pagamenti pag = null; if (doc.fat_pag != 0) { pag = await dbcon_.GetAsync <Pagamenti>(doc.fat_pag); } if ((row + 55 * 8) < _mod_len) { row = _mod_len - 55 * 8; } // Disegniamo il Box int col = 0; str = str + $"^FO{col},{row}" + $"^GB800,{40 * 8},2^FS"; // Disegniamo la linea str = str + $"^FO{col},{row + 30 * 8}" + $"^GB800,1,2^FS"; // Stampiamo il codice del pagamento col = 1; str = str + $"^FO{col},{row + 31 * 8}" + "^A0,N,19,19" + $"^FDCod. Pag.^FS"; if (pag != null) { col = 2 * 8; num = string.Format("{0,5}", doc.fat_pag); str = str + $"^FO{col},{row + 35 * 8}" + "^A0,N,23,23" + $"^FB{7 * 8},1,0,R,0^FD{num}^FS"; } // Stampiamo la Linea Vericale col = 10 * 8; str = str + $"^FO{col},{row + 30 * 8}" + $"^GB1,{10 * 8},2^FS"; col = 11 * 8; str = str + $"^FO{col},{row + 31 * 8}" + "^A0,N,19,19" + $"^FDDes. Pag.^FS"; if (pag != null) { str = str + $"^FO{col},{row + 35 * 8}" + "^A0,N,23,23" + $"^FD{pag.pag_desc.Trim()}^FS"; } // Stampiamo la Linea Vericale col = 57 * 8; str = str + $"^FO{col},{row + 30 * 8}" + $"^GB1,{10 * 8},2^FS"; col = 58 * 8; str = str + $"^FO{col},{row + 31 * 8}" + "^A0,N,19,19" + $"^FDFirma per Accettazione di Quanto Sopra^FS"; if (doc.fat_tipo == (int)DocTipo.TIPO_FAT) { col = 35 * 8; str = str + $"^FO{col},{row + 41 * 8}" + "^A0,N,19,19" + $"^FDCONTRIBUTO CONAI ASSOLTO^FS"; } if (doc.fat_tipo != (int)DocTipo.TIPO_DDT) { // // Prima Riga Totali Fattura // col = 0; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB800,1,2^FS"; col = 20 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; // Sconto col = 30 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; // Totale Netto col = 50 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; // Trasporto Imballo col = 66 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; // Varie col = 83 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; // Incasso Effetti col = 1 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDTotale Merce^FS"; col = 21 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDSconto %^FS"; col = 31 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDTotale Netto^FS"; col = 51 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDTrasp. Imballo^FS"; col = 67 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDVarie^FS"; col = 84 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDInc. Effetti^FS"; col = 2 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_merce); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{17 * 8},1,0,R,0^FD{num}^FS"; if (!doc.fat_sconto.TestIfZero(2)) { col = 22 * 8; num = string.Format("{0:0.00}", doc.fat_sconto); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{7 * 8},1,0,R,0^FD{num}^FS"; } col = 32 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_netto); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{17 * 8},1,0,R,0^FD{num}^FS"; if (!doc.fat_imballo.TestIfZero(2)) { col = 52 * 8; num = string.Format("{0:#,##0.00}", doc.fat_imballo); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{13 * 8},1,0,R,0^FD{num}^FS"; } if (!doc.fat_varie.TestIfZero(2)) { col = 68 * 8; num = string.Format("{0:#,##0.00}", doc.fat_varie); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{14 * 8},1,0,R,0^FD{num}^FS"; } if (!doc.fat_inc_eff.TestIfZero(2)) { col = 85 * 8; num = string.Format("{0:#,##0.00}", doc.fat_inc_eff); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FB{13 * 8},1,0,R,0^FD{num}^FS"; } // // Castelletto IVA // col = 2 * 8; str = str + $"^FO{col},{row + 8 * 8}" + "^A0,N,19,19" + $"^FDCod.^FS"; col = 11 * 8; str = str + $"^FO{col},{row + 8 * 8}" + "^A0,N,19,19" + $"^FDImponibile^FS"; col = 25 * 8; str = str + $"^FO{col},{row + 8 * 8}" + "^A0,N,19,19" + $"^FDDescrizione^FS"; col = 53 * 8; str = str + $"^FO{col},{row + 8 * 8}" + "^A0,N,19,19" + $"^FDImposta^FS"; col = 0; str = str + $"^FO{col},{row + 10 * 8}" + $"^GB{66 * 8},1,2^FS"; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB800,1,2^FS"; col = 7 * 8; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB1,{16 * 8},2^FS"; // Codice Iva col = 24 * 8; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB1,{16 * 8},2^FS"; // Imponibile col = 49 * 8; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB1,{16 * 8},2^FS"; // Descrizione col = 66 * 8; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB1,{16 * 8},2^FS"; // Imposta col = 1 * 8; num = string.Format("{0:#}", doc.fat_cod_iva_0); str = str + $"^FO{col},{row + 11 * 8}" + "^A0,N,23,23" + $"^FB{5 * 8},1,0,R,0^FD{num}^FS"; num = string.Format("{0:#}", doc.fat_cod_iva_1); str = str + $"^FO{col},{row + 14 * 8}" + "^A0,N,23,23" + $"^FB{5 * 8},1,0,R,0^FD{num}^FS"; num = string.Format("{0:#}", doc.fat_cod_iva_2); str = str + $"^FO{col},{row + 17 * 8}" + "^A0,N,23,23" + $"^FB{5 * 8},1,0,R,0^FD{num}^FS"; num = string.Format("{0:#}", doc.fat_cod_iva_3); str = str + $"^FO{col},{row + 20 * 8}" + "^A0,N,23,23" + $"^FB{5 * 8},1,0,R,0^FD{num}^FS"; col = 8 * 8; if (doc.fat_cod_iva_0 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_ripartizione_0 + doc.fat_importo_0); str = str + $"^FO{col},{row + 11 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_1 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_ripartizione_1 + doc.fat_importo_1); str = str + $"^FO{col},{row + 14 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_2 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_ripartizione_2 + doc.fat_importo_2); str = str + $"^FO{col},{row + 17 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_3 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_ripartizione_3 + doc.fat_importo_3); str = str + $"^FO{col},{row + 20 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } col = 25 * 8; str = str + $"^FO{col},{row + 11 * 8}" + "^A0,N,23,23" + $"^FB{23 * 8},1,0,L,0^FD{doc.fat_desc_iva_0.Trim()}^FS"; str = str + $"^FO{col},{row + 14 * 8}" + "^A0,N,23,23" + $"^FB{23 * 8},1,0,L,0^FD{doc.fat_desc_iva_1.Trim()}^FS"; str = str + $"^FO{col},{row + 17 * 8}" + "^A0,N,23,23" + $"^FB{23 * 8},1,0,L,0^FD{doc.fat_desc_iva_2.Trim()}^FS"; str = str + $"^FO{col},{row + 20 * 8}" + "^A0,N,23,23" + $"^FB{23 * 8},1,0,L,0^FD{doc.fat_desc_iva_3.Trim()}^FS"; col = 50 * 8; if (doc.fat_cod_iva_0 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_importo_iva_0); str = str + $"^FO{col},{row + 11 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_1 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_importo_iva_1); str = str + $"^FO{col},{row + 14 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_2 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_importo_iva_2); str = str + $"^FO{col},{row + 17 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } if (doc.fat_cod_iva_3 != 0) { num = string.Format("{0:#,##0.00}", doc.fat_importo_iva_3); str = str + $"^FO{col},{row + 20 * 8}" + "^A0,N,23,23" + $"^FB{15 * 8},1,0,R,0^FD{num}^FS"; } // // Ultima riga totali // col = 1 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDTot. Imponibile^FS"; col = 17 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDTot. IVA^FS"; col = 33 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDTot. Bolli Eff.^FS"; col = 49 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDAcconto^FS"; col = 65 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDAbbuoni^FS"; col = 81 * 8; str = str + $"^FO{col},{row + 24 * 8}" + "^A0,N,19,19" + $"^FDTotale da Pagare^FS"; // // Tracciamo le linee verticali // col = 16 * 8; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB1,{7 * 8},2^FS"; // Totale Iva col = 32 * 8; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB1,{7 * 8},2^FS"; // Totale Bolli Effetti col = 48 * 8; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB1,{7 * 8},2^FS"; // Anticipo col = 64 * 8; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB1,{7 * 8},2^FS"; // Abbuoni col = 80 * 8; str = str + $"^FO{col},{row + 23 * 8}" + $"^GB1,{7 * 8},2^FS"; // Totale da Pagare // // Stampiamo i Valori // col = 2 * 8; num = string.Format("{0:#,##0.00}", doc.fat_totale_imponibile); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{13 * 8},1,0,R,0^FD{num}^FS"; col = 17 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_iva); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{14 * 8},1,0,R,0^FD{num}^FS"; if (!doc.fat_bolli_eff.TestIfZero(2)) { col = 33 * 8; num = string.Format("{0:#,##0.00}", doc.fat_bolli_eff); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{14 * 8},1,0,R,0^FD{num}^FS"; } if (!doc.fat_anticipo.TestIfZero(2)) { col = 49 * 8; num = string.Format("{0:#,##0.00}", doc.fat_anticipo); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{14 * 8},1,0,R,0^FD{num}^FS"; } if (!doc.fat_abbuoni.TestIfZero(2)) { col = 65 * 8; num = string.Format("{0:#,##0.00}", doc.fat_abbuoni); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{14 * 8},1,0,R,0^FD{num}^FS"; } col = 81 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_pagare); str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FB{16 * 8},1,0,R,0^FD{num}^FS"; // // Scriviamo il Totale // col = 66 * 8; str = str + $"^FO{col},{row + 10 * 8}" + "^A0,N,25,25" + $"^FB{34 * 8},1,0,C,0^FDTOTALE DOCUMENTO ^FS"; col = 66 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_fattura); str = str + $"^FO{col},{row + 16 * 8}" + "^A0,N,35,35" + $"^FB{34 * 8},1,0,C,0^FD{num}^FS"; } else // DDT { Trasporti tra = null; if (doc.fat_tra != 0) { tra = await dbcon_.GetAsync <Trasporti>(doc.fat_tra); } if (stprice) { col = 1 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDCausale Trasporto^FS"; col = 60 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDColli^FS"; col = 75 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDTOTALE DOCUMENTO^FS"; col = 59 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; col = 74 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; } else { col = 1 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDCausale Trasporto^FS"; col = 84 * 8; str = str + $"^FO{col},{row + 1 * 8}" + "^A0,N,19,19" + $"^FDColli^FS"; col = 83 * 8; str = str + $"^FO{col},{row}" + $"^GB1,{7 * 8},2^FS"; } col = 0; str = str + $"^FO{col},{row + 7 * 8}" + $"^GB800,1,2^FS"; col = 1 * 8; str = str + $"^FO{col},{row + 8 * 8}" + "^A0,N,19,19" + $"^FDAnnotazioni^FS"; if (tra != null) { col = 2 * 8; str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FD{tra.tra_desc}^FS"; } if (stprice) { col = 60 * 8; num = string.Format("{0,5:#######}", doc.fat_colli); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FD{num}^FS"; col = 75 * 8; num = string.Format("{0,5:#######}", doc.fat_colli); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FD{num}^FS"; col = 75 * 8; num = string.Format("{0:#,##0.00}", doc.fat_tot_fattura); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,28,28" + $"^FB{23 * 8},1,0,C,0^FD{num}^FS"; } else { col = 84 * 8; num = string.Format("{0,5:#######}", doc.fat_colli); str = str + $"^FO{col},{row + 4 * 8}" + "^A0,N,23,23" + $"^FD{num}^FS"; } col = 2 * 8; str = str + $"^FO{col},{row + 11 * 8}" + "^A0,N,23,23" + $"^FD{doc.fat_annotaz}^FS"; str = str + $"^FO{col},{row + 14 * 8}" + "^A0,N,23,23" + $"^FD{doc.fat_desc_varie_0}^FS"; str = str + $"^FO{col},{row + 17 * 8}" + "^A0,N,23,23" + $"^FD{doc.fat_desc_varie_1}^FS"; str = str + $"^FO{col},{row + 20 * 8}" + "^A0,N,23,23" + $"^FD{doc.fat_desc_varie_2}^FS"; str = str + $"^FO{col},{row + 23 * 8}" + "^A0,N,23,23" + $"^FD{doc.fat_desc_varie_3}^FS"; // VEN_CARICO 4 // VEN_RIMANENZA 5 if ((doc.fat_tipo_ven != 4) && (doc.fat_tipo_ven != 5)) { col = 64 * 8; str = str + $"^FO{col},{row + 27 * 8}" + "^A0,N,23,23" + $"^FDSEGUE REGOLARE FATTURA^FS"; } } if ((doc.fat_tipo == (int)DocTipo.TIPO_FAT) || (doc.fat_tipo == (int)DocTipo.TIPO_DDT)) { if (pag.pag_nota_alimentari) { col = 20 * 8; str = str + $"^FO{col},{row + 44 * 8}" + "^A0,N,19,19" + $"^FDAssolve agli obblighi di cui all' art. 62 co. 1 D.L 24/1/2012 n. 1^FS"; col = 23 * 8; str = str + $"^FO{col},{row + 47 * 8}" + "^A0,N,19,19" + $"^FDconvertito con modificazioni dalla legge 24/3/2012 n. 27^FS"; col = 20 * 8; if (doc.fat_tipo == (int)DocTipo.TIPO_FAT) { str = str + $"^FO{col},{row + 50 * 8}" + "^A0,N,19,19" + $"^FDLa durata del rapporto commerciale si riferisce alla singola fattura^FS"; } else { str = str + $"^FO{col},{row + 50 * 8}" + "^A0,N,19,19" + $"^FDLa durata del rapporto commerciale si riferisce al singolo documento^FS"; } } } str = str + "^XZ"; var t = new UTF8Encoding().GetBytes(str); _con.Write(t); str = "^XA" + // Inizializziamo la stampa "^PW800" + // Settiamo la Larghezza "^MNN" + // Settiamo la stampa in continuos mode "^LH0,0" + // Settiamo la posizione Iniziale "^LL80" + // Settiamo la posizione Iniziale "^XZ"; t = new UTF8Encoding().GetBytes(str); _con.Write(t); return(row); }