diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs index a7b69d5..f0050fb 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ReportLogic.cs @@ -148,13 +148,13 @@ namespace ComputersShopBusinessLogic.BusinessLogics public List GetGroupedByDateOrders() { return _orderStorage.GetFullList().GroupBy(x => x.DateCreate.Date) - .Select(x => new ReportOrdersGroupedByDateViewModel - { - Date = x.Key, - Count = x.Count(), - Sum = x.Sum(y => y.Sum) - }) - .ToList(); + .Select(x => new ReportOrdersGroupedByDateViewModel + { + Date = x.Key, + Count = x.Count(), + Sum = x.Sum(y => y.Sum) + }) + .ToList(); } public void SaveGroupedByDateOrders(ReportBindingModel model) diff --git a/ComputersShop/ComputersShopView/ComputersShopView.csproj b/ComputersShop/ComputersShopView/ComputersShopView.csproj index 7a00995..24a82ea 100644 --- a/ComputersShop/ComputersShopView/ComputersShopView.csproj +++ b/ComputersShop/ComputersShopView/ComputersShopView.csproj @@ -29,6 +29,9 @@ + + Always + Always diff --git a/ComputersShop/ComputersShopView/FormMain.Designer.cs b/ComputersShop/ComputersShopView/FormMain.Designer.cs index d27feef..7c1f46d 100644 --- a/ComputersShop/ComputersShopView/FormMain.Designer.cs +++ b/ComputersShop/ComputersShopView/FormMain.Designer.cs @@ -45,6 +45,9 @@ buttonOrderReady = new Button(); buttonIssuedOrder = new Button(); buttonRef = new Button(); + списокМагазиновToolStripMenuItem = new ToolStripMenuItem(); + загруженостьМагазиновToolStripMenuItem = new ToolStripMenuItem(); + заказыВМагазинахToolStripMenuItem = new ToolStripMenuItem(); menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -68,27 +71,27 @@ // computerToolStripMenuItem // computerToolStripMenuItem.Name = "computerToolStripMenuItem"; - computerToolStripMenuItem.Size = new Size(180, 22); + computerToolStripMenuItem.Size = new Size(146, 22); computerToolStripMenuItem.Text = "компьютеры"; computerToolStripMenuItem.Click += ComputersToolStripMenuItem_Click; // // componentsToolStripMenuItem // componentsToolStripMenuItem.Name = "componentsToolStripMenuItem"; - componentsToolStripMenuItem.Size = new Size(180, 22); + componentsToolStripMenuItem.Size = new Size(146, 22); componentsToolStripMenuItem.Text = "компоненты"; componentsToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click; // // shopToolStripMenuItem // shopToolStripMenuItem.Name = "shopToolStripMenuItem"; - shopToolStripMenuItem.Size = new Size(180, 22); + shopToolStripMenuItem.Size = new Size(146, 22); shopToolStripMenuItem.Text = "магазины"; shopToolStripMenuItem.Click += ShopToolStripMenuItem_Click; // // отчётыToolStripMenuItem // - отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокКомпонентовToolStripMenuItem, компонентыПоКомпьютерамToolStripMenuItem, списокЗаказовToolStripMenuItem }); + отчётыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокКомпонентовToolStripMenuItem, компонентыПоКомпьютерамToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженостьМагазиновToolStripMenuItem, заказыВМагазинахToolStripMenuItem }); отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem"; отчётыToolStripMenuItem.Size = new Size(58, 20); отчётыToolStripMenuItem.Text = "отчёты"; @@ -187,6 +190,27 @@ buttonRef.UseVisualStyleBackColor = true; buttonRef.Click += ButtonRef_Click; // + // списокМагазиновToolStripMenuItem + // + списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem"; + списокМагазиновToolStripMenuItem.Size = new Size(242, 22); + списокМагазиновToolStripMenuItem.Text = "список магазинов"; + списокМагазиновToolStripMenuItem.Click += ListOfShopsToolStripMenuItem_Click; + // + // загруженостьМагазиновToolStripMenuItem + // + загруженостьМагазиновToolStripMenuItem.Name = "загруженостьМагазиновToolStripMenuItem"; + загруженостьМагазиновToolStripMenuItem.Size = new Size(242, 22); + загруженостьМагазиновToolStripMenuItem.Text = "загруженость магазинов"; + загруженостьМагазиновToolStripMenuItem.Click += ReportShopComputersMenuItem_Click; + // + // заказыВМагазинахToolStripMenuItem + // + заказыВМагазинахToolStripMenuItem.Name = "заказыВМагазинахToolStripMenuItem"; + заказыВМагазинахToolStripMenuItem.Size = new Size(242, 22); + заказыВМагазинахToolStripMenuItem.Text = "заказы в магазинах"; + заказыВМагазинахToolStripMenuItem.Click += OrdersByDateToolStripMenuItem_Click; + // // FormMain // AutoScaleDimensions = new SizeF(7F, 15F); @@ -229,5 +253,8 @@ private ToolStripMenuItem shopToolStripMenuItem; private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem; private ToolStripMenuItem продатьКомпьютерToolStripMenuItem; + private ToolStripMenuItem списокМагазиновToolStripMenuItem; + private ToolStripMenuItem загруженостьМагазиновToolStripMenuItem; + private ToolStripMenuItem заказыВМагазинахToolStripMenuItem; } } \ No newline at end of file diff --git a/ComputersShop/ComputersShopView/FormMain.cs b/ComputersShop/ComputersShopView/FormMain.cs index 16b11a1..13a09c5 100644 --- a/ComputersShop/ComputersShopView/FormMain.cs +++ b/ComputersShop/ComputersShopView/FormMain.cs @@ -229,5 +229,33 @@ namespace ComputersShopView LoadData(); } } + + private void OrdersByDateToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); + if (service is FormReportGroupedOrders form) + { + form.ShowDialog(); + } + } + + private void ListOfShopsToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void ReportShopComputersMenuItem_Click(Object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportShopComputers)); + if (service is FormReportShopComputers form) + { + form.ShowDialog(); + } + } } } diff --git a/ComputersShop/ComputersShopView/FormReportGroupedOrders.Designer.cs b/ComputersShop/ComputersShopView/FormReportGroupedOrders.Designer.cs new file mode 100644 index 0000000..fe8fc95 --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportGroupedOrders.Designer.cs @@ -0,0 +1,86 @@ +namespace ComputersShopView +{ + partial class FormReportGroupedOrders + { + /// + /// 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.panel = new System.Windows.Forms.Panel(); + this.buttonToPdf = new System.Windows.Forms.Button(); + this.buttonMake = new System.Windows.Forms.Button(); + this.panel.SuspendLayout(); + this.SuspendLayout(); + // + // panel + // + this.panel.Controls.Add(this.buttonToPdf); + this.panel.Controls.Add(this.buttonMake); + this.panel.Dock = System.Windows.Forms.DockStyle.Top; + this.panel.Location = new System.Drawing.Point(0, 0); + this.panel.Name = "panel"; + this.panel.Size = new System.Drawing.Size(800, 44); + this.panel.TabIndex = 0; + // + // buttonToPdf + // + this.buttonToPdf.Location = new System.Drawing.Point(171, 12); + this.buttonToPdf.Name = "buttonToPdf"; + this.buttonToPdf.Size = new System.Drawing.Size(160, 29); + this.buttonToPdf.TabIndex = 1; + this.buttonToPdf.Text = "Сохранить в pdf"; + this.buttonToPdf.UseVisualStyleBackColor = true; + this.buttonToPdf.Click += new System.EventHandler(this.ButtonToPdf_Click); + // + // buttonMake + // + this.buttonMake.Location = new System.Drawing.Point(12, 12); + this.buttonMake.Name = "buttonMake"; + this.buttonMake.Size = new System.Drawing.Size(141, 29); + this.buttonMake.TabIndex = 0; + this.buttonMake.Text = "Сформировать"; + this.buttonMake.UseVisualStyleBackColor = true; + this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click); + // + // FormReportGroupedOrders + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.panel); + this.Name = "FormReportGroupedOrders"; + this.Text = "Заказы по дате"; + this.panel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Panel panel; + private Button buttonMake; + private Button buttonToPdf; + } +} \ No newline at end of file diff --git a/ComputersShop/ComputersShopView/FormReportGroupedOrders.cs b/ComputersShop/ComputersShopView/FormReportGroupedOrders.cs new file mode 100644 index 0000000..1ae2bad --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportGroupedOrders.cs @@ -0,0 +1,82 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; +using ComputersShopContracts.BindingModels; +using ComputersShopContracts.BusinessLogicContracts; +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 ComputersShopView +{ + public partial class FormReportGroupedOrders : Form + { + private readonly ReportViewer reportViewer; + + private readonly ILogger _logger; + + private readonly IReportLogic _logic; + + public FormReportGroupedOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportGroupedOrders.rdlc", FileMode.Open)); + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(panel); + } + + private void ButtonMake_Click(object sender, EventArgs e) + { + try + { + var dataSource = _logic.GetGroupedByDateOrders(); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка заказов сгрупированных по дате"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка заказов сгрупированных по дате"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonToPdf_Click(object sender, EventArgs e) + { + System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveGroupedByDateOrders(new ReportBindingModel + { + FileName = dialog.FileName, + }); + _logger.LogInformation("Сохранение списка заказов сгрупированных по дате"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка заказов сгрупированных по дате"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} diff --git a/ComputersShop/ComputersShopView/FormReportGroupedOrders.resx b/ComputersShop/ComputersShopView/FormReportGroupedOrders.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportGroupedOrders.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/ComputersShop/ComputersShopView/FormReportShopComputers.Designer.cs b/ComputersShop/ComputersShopView/FormReportShopComputers.Designer.cs new file mode 100644 index 0000000..342e565 --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportShopComputers.Designer.cs @@ -0,0 +1,104 @@ +namespace ComputersShopView +{ + partial class FormReportShopComputers + { + /// + /// 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() + { + ButtonSaveToExcel = new Button(); + dataGridView = new DataGridView(); + ShopColumn = new DataGridViewTextBoxColumn(); + DocumentColumn = new DataGridViewTextBoxColumn(); + CountColumn = new DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // ButtonSaveToExcel + // + ButtonSaveToExcel.Location = new Point(12, 12); + ButtonSaveToExcel.Name = "ButtonSaveToExcel"; + ButtonSaveToExcel.Size = new Size(145, 29); + ButtonSaveToExcel.TabIndex = 0; + ButtonSaveToExcel.Text = "Сохранить в excel"; + ButtonSaveToExcel.UseVisualStyleBackColor = true; + ButtonSaveToExcel.Click += ButtonSaveToExcel_Click; + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Columns.AddRange(new DataGridViewColumn[] { ShopColumn, DocumentColumn, CountColumn }); + dataGridView.Dock = DockStyle.Bottom; + dataGridView.Location = new Point(0, 64); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.Size = new Size(504, 417); + dataGridView.TabIndex = 1; + // + // ShopColumn + // + ShopColumn.HeaderText = "Магазин"; + ShopColumn.MinimumWidth = 6; + ShopColumn.Name = "ShopColumn"; + ShopColumn.Width = 125; + // + // DocumentColumn + // + DocumentColumn.HeaderText = "Документ"; + DocumentColumn.MinimumWidth = 6; + DocumentColumn.Name = "DocumentColumn"; + DocumentColumn.Width = 125; + // + // CountColumn + // + CountColumn.HeaderText = "Количество"; + CountColumn.MinimumWidth = 6; + CountColumn.Name = "CountColumn"; + CountColumn.Width = 125; + // + // FormReportShopDocuments + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(504, 481); + Controls.Add(dataGridView); + Controls.Add(ButtonSaveToExcel); + Name = "FormReportShopDocuments"; + Text = "Магазины и документы"; + Load += FormReportShopDocuments_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private Button ButtonSaveToExcel; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn ShopColumn; + private DataGridViewTextBoxColumn DocumentColumn; + private DataGridViewTextBoxColumn CountColumn; + } +} \ No newline at end of file diff --git a/ComputersShop/ComputersShopView/FormReportShopComputers.cs b/ComputersShop/ComputersShopView/FormReportShopComputers.cs new file mode 100644 index 0000000..67c6ca3 --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportShopComputers.cs @@ -0,0 +1,79 @@ +using Microsoft.Extensions.Logging; +using ComputersShopContracts.BindingModels; +using ComputersShopContracts.BusinessLogicContracts; +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 ComputersShopView +{ + public partial class FormReportShopComputers : Form + { + private readonly ILogger _logger; + + private readonly IReportLogic _logic; + + public FormReportShopComputers(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormReportShopDocuments_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetShopComputers(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" }); + foreach (var listElem in elem.Computers) + { + dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); + } + dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount }); + dataGridView.Rows.Add(Array.Empty()); + } + } + _logger.LogInformation("Загрузка списка загруженности магазина"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка загруженности магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonSaveToExcel_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveShopComputerToExcelFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Сохранение списка загруженности магазина"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка загруженности магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} diff --git a/ComputersShop/ComputersShopView/FormReportShopComputers.resx b/ComputersShop/ComputersShopView/FormReportShopComputers.resx new file mode 100644 index 0000000..73e3fa1 --- /dev/null +++ b/ComputersShop/ComputersShopView/FormReportShopComputers.resx @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ComputersShop/ComputersShopView/Program.cs b/ComputersShop/ComputersShopView/Program.cs index ef1040d..7b5f456 100644 --- a/ComputersShop/ComputersShopView/Program.cs +++ b/ComputersShop/ComputersShopView/Program.cs @@ -45,6 +45,7 @@ namespace ComputersShopView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -62,6 +63,8 @@ namespace ComputersShopView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); } } diff --git a/ComputersShop/ComputersShopView/ReportGroupedOrders.rdlc b/ComputersShop/ComputersShopView/ReportGroupedOrders.rdlc new file mode 100644 index 0000000..1b635a5 --- /dev/null +++ b/ComputersShop/ComputersShopView/ReportGroupedOrders.rdlc @@ -0,0 +1,410 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + ComputersShopContractsViewModels + /* Local Query */ + + + + Date + System.DateTime + + + Count + System.Int32 + + + Sum + System.Decimal + + + + ComputersShopContracts.ViewModels + ReportOrdersGroupedByDateViewModel + ComputersShopContracts.ViewModels.ReportOrdersGroupedByDateViewModel, ComputersShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + true + true + + + + + Заказы + + + + + + + Textbox1 + 0.70583cm + 19.67885cm + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 4.56494cm + + + 4.56494cm + + + 2.5cm + + + + + 0.74083cm + + + + + true + true + + + + + Date + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Count + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sum + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.74083cm + + + + + true + true + + + + + =Fields!Date.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Count.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 1.87537cm + 4.83399cm + 1.48166cm + 11.62988cm + 1 + + + + + + true + true + + + + + Итого: + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!Sum.Value, "DataSetOrders") + + + 2pt + 2pt + 2pt + 2pt + + + + 2in +