This commit is contained in:
@@ -111,6 +111,12 @@
|
|||||||
<Compile Include="SetQBChargeAs.Designer.cs">
|
<Compile Include="SetQBChargeAs.Designer.cs">
|
||||||
<DependentUpon>SetQBChargeAs.cs</DependentUpon>
|
<DependentUpon>SetQBChargeAs.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="SetQBClass.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="SetQBClass.Designer.cs">
|
||||||
|
<DependentUpon>SetQBClass.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="SetWOStatus.cs">
|
<Compile Include="SetWOStatus.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -158,6 +164,9 @@
|
|||||||
<EmbeddedResource Include="SetQBChargeAs.resx">
|
<EmbeddedResource Include="SetQBChargeAs.resx">
|
||||||
<DependentUpon>SetQBChargeAs.cs</DependentUpon>
|
<DependentUpon>SetQBChargeAs.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="SetQBClass.resx">
|
||||||
|
<DependentUpon>SetQBClass.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="SetWOStatus.resx">
|
<EmbeddedResource Include="SetWOStatus.resx">
|
||||||
<DependentUpon>SetWOStatus.cs</DependentUpon>
|
<DependentUpon>SetWOStatus.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
127
AyaNovaQBI/SetQBClass.Designer.cs
generated
Normal file
127
AyaNovaQBI/SetQBClass.Designer.cs
generated
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
namespace AyaNovaQBI
|
||||||
|
{
|
||||||
|
partial class SetQBClass
|
||||||
|
{
|
||||||
|
/// <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 Windows Form 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.btnOK = new System.Windows.Forms.Button();
|
||||||
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
|
this.lblTitle = new System.Windows.Forms.Label();
|
||||||
|
this.lblDescription = new System.Windows.Forms.Label();
|
||||||
|
this.lblStatus = new System.Windows.Forms.Label();
|
||||||
|
this.cbQBClasses = new System.Windows.Forms.ComboBox();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// btnOK
|
||||||
|
//
|
||||||
|
this.btnOK.Location = new System.Drawing.Point(550, 368);
|
||||||
|
this.btnOK.Name = "btnOK";
|
||||||
|
this.btnOK.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnOK.TabIndex = 6;
|
||||||
|
this.btnOK.Text = "OK";
|
||||||
|
this.btnOK.UseVisualStyleBackColor = true;
|
||||||
|
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.btnCancel.Location = new System.Drawing.Point(4, 368);
|
||||||
|
this.btnCancel.Name = "btnCancel";
|
||||||
|
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.btnCancel.TabIndex = 5;
|
||||||
|
this.btnCancel.Text = "Cancel";
|
||||||
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// lblTitle
|
||||||
|
//
|
||||||
|
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.lblTitle.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.lblTitle.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.lblTitle.Name = "lblTitle";
|
||||||
|
this.lblTitle.Size = new System.Drawing.Size(637, 30);
|
||||||
|
this.lblTitle.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// lblDescription
|
||||||
|
//
|
||||||
|
this.lblDescription.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.lblDescription.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.lblDescription.Location = new System.Drawing.Point(0, 30);
|
||||||
|
this.lblDescription.Name = "lblDescription";
|
||||||
|
this.lblDescription.Size = new System.Drawing.Size(637, 165);
|
||||||
|
this.lblDescription.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// lblStatus
|
||||||
|
//
|
||||||
|
this.lblStatus.AutoSize = true;
|
||||||
|
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.lblStatus.Location = new System.Drawing.Point(0, 195);
|
||||||
|
this.lblStatus.Name = "lblStatus";
|
||||||
|
this.lblStatus.Size = new System.Drawing.Size(0, 13);
|
||||||
|
this.lblStatus.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// cbQBClasses
|
||||||
|
//
|
||||||
|
this.cbQBClasses.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.cbQBClasses.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbQBClasses.FormattingEnabled = true;
|
||||||
|
this.cbQBClasses.Location = new System.Drawing.Point(0, 208);
|
||||||
|
this.cbQBClasses.Name = "cbQBClasses";
|
||||||
|
this.cbQBClasses.Size = new System.Drawing.Size(637, 21);
|
||||||
|
this.cbQBClasses.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// SetQBClass
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.btnCancel;
|
||||||
|
this.ClientSize = new System.Drawing.Size(637, 403);
|
||||||
|
this.Controls.Add(this.cbQBClasses);
|
||||||
|
this.Controls.Add(this.lblStatus);
|
||||||
|
this.Controls.Add(this.lblDescription);
|
||||||
|
this.Controls.Add(this.lblTitle);
|
||||||
|
this.Controls.Add(this.btnOK);
|
||||||
|
this.Controls.Add(this.btnCancel);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||||
|
this.Name = "SetQBClass";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "SetQBClass";
|
||||||
|
this.Load += new System.EventHandler(this.SetQBClass_load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button btnOK;
|
||||||
|
private System.Windows.Forms.Button btnCancel;
|
||||||
|
private System.Windows.Forms.Label lblTitle;
|
||||||
|
private System.Windows.Forms.Label lblDescription;
|
||||||
|
private System.Windows.Forms.Label lblStatus;
|
||||||
|
private System.Windows.Forms.ComboBox cbQBClasses;
|
||||||
|
}
|
||||||
|
}
|
||||||
49
AyaNovaQBI/SetQBClass.cs
Normal file
49
AyaNovaQBI/SetQBClass.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace AyaNovaQBI
|
||||||
|
{
|
||||||
|
public partial class SetQBClass : Form
|
||||||
|
{
|
||||||
|
public SetQBClass()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string DialogTitle { get; set; }
|
||||||
|
|
||||||
|
public string OptionTitle { get; set; }
|
||||||
|
|
||||||
|
public string OptionDescription { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public DataTable QBClasses { get; set; }
|
||||||
|
public string SelectedQBClass { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
private void SetQBClass_load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Text = DialogTitle;
|
||||||
|
lblDescription.Text = OptionDescription;
|
||||||
|
lblTitle.Text = OptionTitle;
|
||||||
|
btnCancel.Text = util.AyaTranslations["Cancel"];
|
||||||
|
btnOK.Text = util.AyaTranslations["OK"];
|
||||||
|
|
||||||
|
cbQBClasses.DataSource = QBClasses;
|
||||||
|
cbQBClasses.DisplayMember = "FullName";
|
||||||
|
cbQBClasses.ValueMember = "ID";
|
||||||
|
// cbQBClasses.SelectedValue = SelectedQBClass;
|
||||||
|
lblStatus.Text = "QuickBooks transaction class";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
AyaNovaQBI/SetQBClass.resx
Normal file
120
AyaNovaQBI/SetQBClass.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?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>
|
||||||
|
</root>
|
||||||
@@ -983,354 +983,355 @@ namespace AyaNovaQBI
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// #region QB Transaction class
|
#region QB Transaction class
|
||||||
// //Validate any existing
|
//Validate any existing
|
||||||
// if (SetEverything == false && QDat.TransactionClass != null && QDat.TransactionClass != "")
|
if (SetEverything == false && QDat.TransactionClass != null && QDat.TransactionClass != "")
|
||||||
// {
|
{
|
||||||
// //if something is set but there are no tr classes
|
//if something is set but there are no tr classes
|
||||||
// //then just clear it and move along
|
//then just clear it and move along
|
||||||
// if (QBClasses.Rows.Count == 1)
|
if (QBClasses.Rows.Count == 1)
|
||||||
// {
|
{
|
||||||
// QDat.TransactionClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;//case 3268
|
QDat.TransactionClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;//case 3268
|
||||||
// goto TRCLASSOK;
|
goto TRCLASSOK;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //Something is set and there *are* tr classes so
|
//Something is set and there *are* tr classes so
|
||||||
// //let's validate it...
|
//let's validate it...
|
||||||
|
|
||||||
// if (QBClasses.Rows.Contains(QDat.TransactionClass))
|
if (QBClasses.Rows.Contains(QDat.TransactionClass))
|
||||||
// goto TRCLASSOK;
|
goto TRCLASSOK;
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// MessageBox.Show("The QuickBooks transaction class previously set for invoicing\r\n" +
|
MessageBox.Show("The QuickBooks transaction class previously set for invoicing\r\n" +
|
||||||
// "no longer appears to be valid. You will next be prompted to re-select it.");
|
"no longer appears to be valid. You will next be prompted to re-select it.");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //Perhaps there are no transaction classes, this is the default
|
//Perhaps there are no transaction classes, this is the default
|
||||||
// //if not then don't prompt for it obviously :)
|
//if not then don't prompt for it obviously :)
|
||||||
// //also if it was empty and were not in first setup mode then
|
//also if it was empty and were not in first setup mode then
|
||||||
// //don't bother prompting it might be the users choice.
|
//don't bother prompting it might be the users choice.
|
||||||
|
|
||||||
// //case 3228 commented out the following as it's a bad idea
|
//case 3228 commented out the following as it's a bad idea
|
||||||
// //if (QBClasses.Rows.Count == 1 || SetEverything == false)
|
//if (QBClasses.Rows.Count == 1 || SetEverything == false)
|
||||||
// // goto TRCLASSOK;
|
// goto TRCLASSOK;
|
||||||
|
|
||||||
|
|
||||||
// //We've arrived here because there is no setting for transaction classes
|
//We've arrived here because there is no setting for transaction classes
|
||||||
// //but there are some defined in QB
|
//but there are some defined in QB
|
||||||
// SetQBClass s3 = new SetQBClass();
|
SetQBClass s3 = new SetQBClass();
|
||||||
// s3.DialogTitle = "AyaNova QBI setup - Transaction class";
|
s3.DialogTitle = "AyaNova QBI setup - Transaction class";
|
||||||
// s3.OptionTitle = "Transaction class";
|
s3.OptionTitle = "Transaction class";
|
||||||
// s3.OptionDescription = "QBI needs to know what QuickBooks Transaction Class you want \r\n" +
|
s3.OptionDescription = "QBI needs to know what QuickBooks Transaction Class you want \r\n" +
|
||||||
// "to use when invoicing Work orders.\r\n\r\n" +
|
"to use when invoicing Work orders.\r\n\r\n" +
|
||||||
// "If you do not use transaction classes or are not sure what they are\r\n" +
|
"If you do not use transaction classes or are not sure what they are\r\n" +
|
||||||
// "select < Do not use classes> from the list below. Classes are off by default in QuickBooks.\r\n\r\n" +
|
"select < Do not use classes> from the list below. Classes are off by default in QuickBooks.\r\n\r\n" +
|
||||||
// "This setting is Optional and not required.";
|
"This setting is Optional and not required.";
|
||||||
// s3.QBClasses = QBClasses;
|
s3.QBClasses = QBClasses;
|
||||||
|
// s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;
|
||||||
// if (s3.ShowDialog() == DialogResult.Cancel)
|
|
||||||
// {
|
if (s3.ShowDialog() == DialogResult.Cancel)
|
||||||
// return pfstat.Cancel;
|
{
|
||||||
|
return pfstat.Cancel;
|
||||||
// }
|
|
||||||
// else
|
}
|
||||||
// QDat.TransactionClass = s3.SelectedQBClass;
|
else
|
||||||
// s3.Dispose();
|
QDat.TransactionClass = s3.SelectedQBClass;
|
||||||
// s3 = null;
|
s3.Dispose();
|
||||||
|
s3 = null;
|
||||||
//TRCLASSOK:
|
|
||||||
|
TRCLASSOK:
|
||||||
// #endregion
|
|
||||||
|
#endregion
|
||||||
// #region QB InvoiceTemplate
|
|
||||||
// //Templates are only supported in xml 3 or greater (all countries)
|
// #region QB InvoiceTemplate
|
||||||
// //if Set everything (first run) then display a dialog about it
|
// //Templates are only supported in xml 3 or greater (all countries)
|
||||||
// if (QVersion < 3 && SetEverything == true)
|
// //if Set everything (first run) then display a dialog about it
|
||||||
// {
|
// if (QVersion < 3 && SetEverything == true)
|
||||||
|
// {
|
||||||
// SetInfoOnly s3a = new SetInfoOnly();
|
|
||||||
// s3a.DialogTitle = "AyaNova QBI setup - Invoice template";
|
// SetInfoOnly s3a = new SetInfoOnly();
|
||||||
// s3a.OptionTitle = "Invoice template - NOT SUPPORTED";
|
// s3a.DialogTitle = "AyaNova QBI setup - Invoice template";
|
||||||
// s3a.OptionDescription =
|
// s3a.OptionTitle = "Invoice template - NOT SUPPORTED";
|
||||||
// "QBI can use a specific QuickBooks Invoice template for printing work orders.\r\n" +
|
// s3a.OptionDescription =
|
||||||
// "However, your version of QuickBooks does not support integrating this \r\n" +
|
// "QBI can use a specific QuickBooks Invoice template for printing work orders.\r\n" +
|
||||||
// "feature with 3rd party applications such as AyaNova QBI.\r\n" +
|
// "However, your version of QuickBooks does not support integrating this \r\n" +
|
||||||
|
// "feature with 3rd party applications such as AyaNova QBI.\r\n" +
|
||||||
// "Supported versions of QuickBooks for using Invoice templates with QBI are:\r\n\r\n" +
|
|
||||||
// "U.S., Canadian or U.K. QuickBooks 2004 or newer\r\n\r\n" +
|
// "Supported versions of QuickBooks for using Invoice templates with QBI are:\r\n\r\n" +
|
||||||
|
// "U.S., Canadian or U.K. QuickBooks 2004 or newer\r\n\r\n" +
|
||||||
// "If you upgrade your QuickBooks in future you will be able to select this option\r\n" +
|
|
||||||
// "for now it is disabled and the default invoice template will be used";
|
// "If you upgrade your QuickBooks in future you will be able to select this option\r\n" +
|
||||||
|
// "for now it is disabled and the default invoice template will be used";
|
||||||
// s3a.ShowDialog();
|
|
||||||
|
// s3a.ShowDialog();
|
||||||
// goto TRInvoiceTemplateOK;
|
|
||||||
// }
|
// goto TRInvoiceTemplateOK;
|
||||||
|
// }
|
||||||
// //Subsequent, non-setup, runs with unsupported version
|
|
||||||
// if (QVersion < 3)
|
// //Subsequent, non-setup, runs with unsupported version
|
||||||
// goto TRInvoiceTemplateOK;
|
// if (QVersion < 3)
|
||||||
|
// goto TRInvoiceTemplateOK;
|
||||||
|
|
||||||
// //Validate any existing
|
|
||||||
// if (QDat.QBInvoiceTemplate != null && QDat.QBInvoiceTemplate != "")
|
// //Validate any existing
|
||||||
// {
|
// if (QDat.QBInvoiceTemplate != null && QDat.QBInvoiceTemplate != "")
|
||||||
// //if something is set but there are no InvoiceTemplates
|
// {
|
||||||
// //then just clear it and move along
|
// //if something is set but there are no InvoiceTemplates
|
||||||
// if (QBInvoiceTemplates.Rows.Count == 1)
|
// //then just clear it and move along
|
||||||
// {
|
// if (QBInvoiceTemplates.Rows.Count == 1)
|
||||||
// QDat.QBInvoiceTemplate = "";
|
// {
|
||||||
// goto TRInvoiceTemplateOK;
|
// QDat.QBInvoiceTemplate = "";
|
||||||
// }
|
// goto TRInvoiceTemplateOK;
|
||||||
|
// }
|
||||||
// //Something is set and there *are* tr InvoiceTemplates so
|
|
||||||
// //let's validate it...
|
// //Something is set and there *are* tr InvoiceTemplates so
|
||||||
// if (QBInvoiceTemplates.Rows.Contains(QDat.QBInvoiceTemplate))
|
// //let's validate it...
|
||||||
// {
|
// if (QBInvoiceTemplates.Rows.Contains(QDat.QBInvoiceTemplate))
|
||||||
// if (!SetEverything)
|
// {
|
||||||
// goto TRInvoiceTemplateOK;
|
// if (!SetEverything)
|
||||||
// }
|
// goto TRInvoiceTemplateOK;
|
||||||
// else
|
// }
|
||||||
// {
|
// else
|
||||||
// MessageBox.Show("The QuickBooks Invoice Template previously set for invoicing\r\n" +
|
// {
|
||||||
// "no longer appears to be valid. You will next be prompted to re-select it.");
|
// MessageBox.Show("The QuickBooks Invoice Template previously set for invoicing\r\n" +
|
||||||
// }
|
// "no longer appears to be valid. You will next be prompted to re-select it.");
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
// //Perhaps there are no InvoiceTemplates, this is the default
|
|
||||||
// //if not then don't prompt for it obviously :)
|
// //Perhaps there are no InvoiceTemplates, this is the default
|
||||||
// //also if it was empty and were not in first setup mode then
|
// //if not then don't prompt for it obviously :)
|
||||||
// //don't bother prompting it might be the users choice.
|
// //also if it was empty and were not in first setup mode then
|
||||||
// //todo: make something besides and empty string to indicate
|
// //don't bother prompting it might be the users choice.
|
||||||
// //deliberately non selected items
|
// //todo: make something besides and empty string to indicate
|
||||||
// if (QBInvoiceTemplates.Rows.Count == 1 || SetEverything == false)
|
// //deliberately non selected items
|
||||||
// goto TRInvoiceTemplateOK;
|
// if (QBInvoiceTemplates.Rows.Count == 1 || SetEverything == false)
|
||||||
|
// goto TRInvoiceTemplateOK;
|
||||||
|
|
||||||
// //We've arrived here because there is no setting for InvoiceTemplates
|
|
||||||
// //Or the user want's to change it
|
// //We've arrived here because there is no setting for InvoiceTemplates
|
||||||
// //and there are some defined in QB
|
// //Or the user want's to change it
|
||||||
// SetQBInvoiceTemplate s3b = new SetQBInvoiceTemplate();
|
// //and there are some defined in QB
|
||||||
// s3b.DialogTitle = "AyaNova QBI setup - Invoice template";
|
// SetQBInvoiceTemplate s3b = new SetQBInvoiceTemplate();
|
||||||
// s3b.OptionTitle = "Invoice template";
|
// s3b.DialogTitle = "AyaNova QBI setup - Invoice template";
|
||||||
// s3b.OptionDescription = "QBI needs to know what QuickBooks Invoice template you want \r\n" +
|
// s3b.OptionTitle = "Invoice template";
|
||||||
// "QBI to set for invoices created from Work orders.\r\n\r\n" +
|
// s3b.OptionDescription = "QBI needs to know what QuickBooks Invoice template you want \r\n" +
|
||||||
// "QuickBooks Invoice templates are used in QuickBooks to specify different print formats\r\n" +
|
// "QBI to set for invoices created from Work orders.\r\n\r\n" +
|
||||||
// "for invoices. If you do not use Invoice templates or are not sure what they are\r\n" +
|
// "QuickBooks Invoice templates are used in QuickBooks to specify different print formats\r\n" +
|
||||||
// "select < Use default > from the list below.\r\n\r\n" +
|
// "for invoices. If you do not use Invoice templates or are not sure what they are\r\n" +
|
||||||
// "This setting is required.";
|
// "select < Use default > from the list below.\r\n\r\n" +
|
||||||
// s3b.QBInvoiceTemplates = QBInvoiceTemplates;
|
// "This setting is required.";
|
||||||
|
// s3b.QBInvoiceTemplates = QBInvoiceTemplates;
|
||||||
// s3b.SelectedQBInvoiceTemplate = QDat.QBInvoiceTemplate;
|
|
||||||
|
// s3b.SelectedQBInvoiceTemplate = QDat.QBInvoiceTemplate;
|
||||||
// if (s3b.ShowDialog() == DialogResult.Cancel)
|
|
||||||
// {
|
// if (s3b.ShowDialog() == DialogResult.Cancel)
|
||||||
// return pfstat.Cancel;
|
// {
|
||||||
|
// return pfstat.Cancel;
|
||||||
// }
|
|
||||||
// else
|
// }
|
||||||
// QDat.QBInvoiceTemplate = s3b.SelectedQBInvoiceTemplate;
|
// else
|
||||||
// s3b.Dispose();
|
// QDat.QBInvoiceTemplate = s3b.SelectedQBInvoiceTemplate;
|
||||||
// s3b = null;
|
// s3b.Dispose();
|
||||||
|
// s3b = null;
|
||||||
//TRInvoiceTemplateOK:
|
|
||||||
|
//TRInvoiceTemplateOK:
|
||||||
|
|
||||||
// #endregion
|
|
||||||
|
// #endregion
|
||||||
// #region QB Terms
|
|
||||||
|
// #region QB Terms
|
||||||
|
|
||||||
|
|
||||||
// //Validate any existing
|
|
||||||
// //case 3228 added extra condition set everything is false
|
// //Validate any existing
|
||||||
// if (SetEverything == false && !string.IsNullOrEmpty(QDat.TermsDefault))
|
// //case 3228 added extra condition set everything is false
|
||||||
// {
|
// if (SetEverything == false && !string.IsNullOrEmpty(QDat.TermsDefault))
|
||||||
// //if something is set but there are no terms
|
// {
|
||||||
// //then just clear it and move along
|
// //if something is set but there are no terms
|
||||||
// if (QBTerms.Rows.Count == 1)
|
// //then just clear it and move along
|
||||||
// {
|
// if (QBTerms.Rows.Count == 1)
|
||||||
// QDat.TermsDefault = "";
|
// {
|
||||||
// goto TermsOK;
|
// QDat.TermsDefault = "";
|
||||||
// }
|
// goto TermsOK;
|
||||||
|
// }
|
||||||
// //Something is set and there *are* terms so
|
|
||||||
// //let's validate it...
|
// //Something is set and there *are* terms so
|
||||||
// if (QBTerms.Rows.Contains(QDat.TermsDefault))
|
// //let's validate it...
|
||||||
// {
|
// if (QBTerms.Rows.Contains(QDat.TermsDefault))
|
||||||
// if (!SetEverything)
|
// {
|
||||||
// goto TermsOK;
|
// if (!SetEverything)
|
||||||
// }
|
// goto TermsOK;
|
||||||
// else
|
// }
|
||||||
// {
|
// else
|
||||||
// MessageBox.Show("The QuickBooks default terms previously set for invoicing\r\n" +
|
// {
|
||||||
// "no longer appears to be valid. You will next be prompted to re-select it.");
|
// MessageBox.Show("The QuickBooks default terms previously set for invoicing\r\n" +
|
||||||
// }
|
// "no longer appears to be valid. You will next be prompted to re-select it.");
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //We've arrived here because there is no setting for Terms
|
|
||||||
// //Or the user want's to change it
|
// //We've arrived here because there is no setting for Terms
|
||||||
// //and there are some defined in QB
|
// //Or the user want's to change it
|
||||||
// SetQBTerms termsdialog = new SetQBTerms();
|
// //and there are some defined in QB
|
||||||
// termsdialog.DialogTitle = "AyaNova QBI setup - Customer default invoice terms";
|
// SetQBTerms termsdialog = new SetQBTerms();
|
||||||
// termsdialog.OptionTitle = "Default terms";
|
// termsdialog.DialogTitle = "AyaNova QBI setup - Customer default invoice terms";
|
||||||
// termsdialog.OptionDescription = "QBI needs to know what QuickBooks terms you want \r\n" +
|
// termsdialog.OptionTitle = "Default terms";
|
||||||
// "QBI to set for customers imported from AyaNova.\r\n\r\n" +
|
// termsdialog.OptionDescription = "QBI needs to know what QuickBooks terms you want \r\n" +
|
||||||
// "When an invoice for a customer is created the selected terms will be applied.\r\n\r\n" +
|
// "QBI to set for customers imported from AyaNova.\r\n\r\n" +
|
||||||
// "This setting is required.";
|
// "When an invoice for a customer is created the selected terms will be applied.\r\n\r\n" +
|
||||||
// termsdialog.QBTerms = QBTerms;
|
// "This setting is required.";
|
||||||
|
// termsdialog.QBTerms = QBTerms;
|
||||||
// termsdialog.SelectedQBTerm = QDat.TermsDefault;
|
|
||||||
|
// termsdialog.SelectedQBTerm = QDat.TermsDefault;
|
||||||
// if (termsdialog.ShowDialog() == DialogResult.Cancel)
|
|
||||||
// {
|
// if (termsdialog.ShowDialog() == DialogResult.Cancel)
|
||||||
// return pfstat.Cancel;
|
// {
|
||||||
|
// return pfstat.Cancel;
|
||||||
// }
|
|
||||||
// else
|
// }
|
||||||
// QDat.TermsDefault = termsdialog.SelectedQBTerm;
|
// else
|
||||||
// termsdialog.Dispose();
|
// QDat.TermsDefault = termsdialog.SelectedQBTerm;
|
||||||
// termsdialog = null;
|
// termsdialog.Dispose();
|
||||||
|
// termsdialog = null;
|
||||||
//TermsOK:
|
|
||||||
|
//TermsOK:
|
||||||
|
|
||||||
// #endregion
|
|
||||||
|
// #endregion
|
||||||
// #region ToBePrinted
|
|
||||||
// //No validation possible
|
// #region ToBePrinted
|
||||||
// //so prompt only if not setup yet
|
// //No validation possible
|
||||||
// if (!SetEverything)
|
// //so prompt only if not setup yet
|
||||||
// {
|
// if (!SetEverything)
|
||||||
// //if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
// {
|
||||||
// goto TBPOK;
|
// //if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
||||||
// // else
|
// goto TBPOK;
|
||||||
// // {
|
// // else
|
||||||
// // MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
// // {
|
||||||
// // "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
// // MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
||||||
// // "QuickBooks Item.");
|
// // "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
||||||
// // }
|
// // "QuickBooks Item.");
|
||||||
// }
|
// // }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// SetToBePrinted s4 = new SetToBePrinted();
|
// SetToBePrinted s4 = new SetToBePrinted();
|
||||||
// s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?";
|
// s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?";
|
||||||
// s4.OptionTitle = "Invoice to be printed";
|
// s4.OptionTitle = "Invoice to be printed";
|
||||||
// s4.OptionDescription = "QBI needs to know if you want invoices that it creates \r\n" +
|
// s4.OptionDescription = "QBI needs to know if you want invoices that it creates \r\n" +
|
||||||
// "in QuickBooks to be set to \"To be printed\".\r\n\r\n" +
|
// "in QuickBooks to be set to \"To be printed\".\r\n\r\n" +
|
||||||
// "(Please note that \"To be emailed\" which is available in some\r\n" +
|
// "(Please note that \"To be emailed\" which is available in some\r\n" +
|
||||||
// "versions of QuickBooks is not an option at this time as\r\n" +
|
// "versions of QuickBooks is not an option at this time as\r\n" +
|
||||||
// "QuickBooks has not exposed that property to developers)";
|
// "QuickBooks has not exposed that property to developers)";
|
||||||
// s4.ToBePrinted = QDat.ToBePrinted;
|
// s4.ToBePrinted = QDat.ToBePrinted;
|
||||||
|
|
||||||
// if (s4.ShowDialog() == DialogResult.Cancel)
|
// if (s4.ShowDialog() == DialogResult.Cancel)
|
||||||
// {
|
// {
|
||||||
// return pfstat.Cancel;
|
// return pfstat.Cancel;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// QDat.ToBePrinted = s4.ToBePrinted;
|
// QDat.ToBePrinted = s4.ToBePrinted;
|
||||||
// s4.Dispose();
|
// s4.Dispose();
|
||||||
// s4 = null;
|
// s4 = null;
|
||||||
|
|
||||||
//TBPOK:
|
//TBPOK:
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region SetMemoField
|
// #region SetMemoField
|
||||||
// //No validation possible
|
// //No validation possible
|
||||||
// //so prompt only if not setup yet
|
// //so prompt only if not setup yet
|
||||||
// if (!SetEverything)
|
// if (!SetEverything)
|
||||||
// {
|
// {
|
||||||
// //if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
// //if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
||||||
// goto SETMEMOOK;
|
// goto SETMEMOOK;
|
||||||
// // else
|
// // else
|
||||||
// // {
|
// // {
|
||||||
// // MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
// // MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
||||||
// // "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
// // "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
||||||
// // "QuickBooks Item.");
|
// // "QuickBooks Item.");
|
||||||
// // }
|
// // }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// SetMemoField s5 = new SetMemoField();
|
// SetMemoField s5 = new SetMemoField();
|
||||||
// s5.DialogTitle = "AyaNova QBI setup - Set Memo field?";
|
// s5.DialogTitle = "AyaNova QBI setup - Set Memo field?";
|
||||||
// s5.OptionTitle = "Invoice memo field";
|
// s5.OptionTitle = "Invoice memo field";
|
||||||
// s5.OptionDescription =
|
// s5.OptionDescription =
|
||||||
// "QBI needs to know if you want invoices that it creates \r\n" +
|
// "QBI needs to know if you want invoices that it creates \r\n" +
|
||||||
// "in QuickBooks to have their \"Memo\" field set with\r\n" +
|
// "in QuickBooks to have their \"Memo\" field set with\r\n" +
|
||||||
// "information about the work order(s) that were the basis for\r\n" +
|
// "information about the work order(s) that were the basis for\r\n" +
|
||||||
// "the invoice and the name of the AyaNova user who generated them.\r\n\r\n" +
|
// "the invoice and the name of the AyaNova user who generated them.\r\n\r\n" +
|
||||||
// "This may be useful as a back reference, this setting is optional";
|
// "This may be useful as a back reference, this setting is optional";
|
||||||
// s5.FillMemoField = QDat.SetMemoField;
|
// s5.FillMemoField = QDat.SetMemoField;
|
||||||
|
|
||||||
// if (s5.ShowDialog() == DialogResult.Cancel)
|
// if (s5.ShowDialog() == DialogResult.Cancel)
|
||||||
// {
|
// {
|
||||||
// return pfstat.Cancel;
|
// return pfstat.Cancel;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// QDat.SetMemoField = s5.FillMemoField;
|
// QDat.SetMemoField = s5.FillMemoField;
|
||||||
// s5.Dispose();
|
// s5.Dispose();
|
||||||
// s5 = null;
|
// s5 = null;
|
||||||
|
|
||||||
//SETMEMOOK:
|
//SETMEMOOK:
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
||||||
// #region SetAutoCloseField Case 7
|
// #region SetAutoCloseField Case 7
|
||||||
// //No validation possible
|
// //No validation possible
|
||||||
// //so prompt only if not setup yet
|
// //so prompt only if not setup yet
|
||||||
// if (!SetEverything)
|
// if (!SetEverything)
|
||||||
// {
|
// {
|
||||||
// goto SETAUTOCLOSEOK;
|
// goto SETAUTOCLOSEOK;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// SetAutoClose s6 = new SetAutoClose();
|
// SetAutoClose s6 = new SetAutoClose();
|
||||||
// s6.DialogTitle = "AyaNova QBI setup - Close when invoiced?";
|
// s6.DialogTitle = "AyaNova QBI setup - Close when invoiced?";
|
||||||
// s6.OptionTitle = "Close work order after invoicing";
|
// s6.OptionTitle = "Close work order after invoicing";
|
||||||
// s6.OptionDescription =
|
// s6.OptionDescription =
|
||||||
// "QBI needs to know if you want work orders that it invoices \r\n" +
|
// "QBI needs to know if you want work orders that it invoices \r\n" +
|
||||||
// "automatically set to closed";
|
// "automatically set to closed";
|
||||||
// s6.AutoClose = QDat.AutoClose;
|
// s6.AutoClose = QDat.AutoClose;
|
||||||
|
|
||||||
// if (s6.ShowDialog() == DialogResult.Cancel)
|
// if (s6.ShowDialog() == DialogResult.Cancel)
|
||||||
// {
|
// {
|
||||||
// return pfstat.Cancel;
|
// return pfstat.Cancel;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// QDat.AutoClose = s6.AutoClose;
|
// QDat.AutoClose = s6.AutoClose;
|
||||||
// s6.Dispose();
|
// s6.Dispose();
|
||||||
// s6 = null;
|
// s6 = null;
|
||||||
|
|
||||||
//SETAUTOCLOSEOK:
|
//SETAUTOCLOSEOK:
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
||||||
// //Save if changes made
|
// //Save if changes made
|
||||||
// if (QDat.IsDirty)
|
// if (QDat.IsDirty)
|
||||||
// {
|
// {
|
||||||
// //Case 299
|
// //Case 299
|
||||||
// QBI.AIObject = QDat.XMLData;
|
// QBI.AIObject = QDat.XMLData;
|
||||||
// //QBI.AIObject=QDat;
|
// //QBI.AIObject=QDat;
|
||||||
|
|
||||||
// QBI = (Integration)QBI.Save();
|
// QBI = (Integration)QBI.Save();
|
||||||
// QDat.IsDirty = false;
|
// QDat.IsDirty = false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return pfstat.OK;
|
return pfstat.OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user