Fixed bug
24532: Support more variables (tags) when sending emails
Created the following new variables:
* @bp_nam@: The Business Partner name
* @doc_date@: The document date
* @doc_desc@: The document description
* @doc_nextduedate@: The next due date (if document has associated any payment plan)
* @doc_lastduedate@: The last due date (if document has associated any payment plan)
--- a/src-db/database/sourcedata/AD_COLUMN.xml Tue Aug 20 01:26:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml Mon Aug 19 12:03:12 2013 +0200
@@ -208583,7 +208583,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500041--> <COLUMNNAME><![CDATA[Subject]]></COLUMNNAME>
<!--1000500041--> <AD_TABLE_ID><![CDATA[1000500002]]></AD_TABLE_ID>
<!--1000500041--> <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
@@ -208624,7 +208628,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500042--> <COLUMNNAME><![CDATA[Body]]></COLUMNNAME>
<!--1000500042--> <AD_TABLE_ID><![CDATA[1000500002]]></AD_TABLE_ID>
<!--1000500042--> <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
@@ -209472,7 +209480,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500066--> <COLUMNNAME><![CDATA[Subject]]></COLUMNNAME>
<!--1000500066--> <AD_TABLE_ID><![CDATA[1000500004]]></AD_TABLE_ID>
<!--1000500066--> <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
@@ -209513,7 +209525,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500067--> <COLUMNNAME><![CDATA[Body]]></COLUMNNAME>
<!--1000500067--> <AD_TABLE_ID><![CDATA[1000500004]]></AD_TABLE_ID>
<!--1000500067--> <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml Tue Aug 20 01:26:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml Mon Aug 19 12:03:12 2013 +0200
@@ -19126,7 +19126,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500008--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--1000500008--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--1000500008--></AD_ELEMENT>
@@ -19222,7 +19226,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500015--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--1000500015--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
<!--1000500015--></AD_ELEMENT>
--- a/src-db/database/sourcedata/AD_FIELD.xml Tue Aug 20 01:26:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml Mon Aug 19 12:03:12 2013 +0200
@@ -164687,7 +164687,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500026--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
<!--1000500026--> <AD_TAB_ID><![CDATA[1000500002]]></AD_TAB_ID>
<!--1000500026--> <AD_COLUMN_ID><![CDATA[1000500067]]></AD_COLUMN_ID>
@@ -164833,7 +164837,11 @@
* @our_ref@: The reference of the document
* @cus_nam@: The name of the customer
* @sal_nam@: The name of the sales rep.
-]]></HELP>
+ * @bp_nam@: The Business Partner name
+ * @doc_date@: The document date
+ * @doc_desc@: The document description
+ * @doc_nextduedate@: The next due date (if document has associated any payment plan)
+ * @doc_lastduedate@: The last due date (if document has associated any payment plan)]]></HELP>
<!--1000500031--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
<!--1000500031--> <AD_TAB_ID><![CDATA[1000500002]]></AD_TAB_ID>
<!--1000500031--> <AD_COLUMN_ID><![CDATA[1000500066]]></AD_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml Tue Aug 20 01:26:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml Mon Aug 19 12:03:12 2013 +0200
@@ -13308,6 +13308,17 @@
<!--23D9E05B782A4D3ABADEFF565FBD5CE4--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--23D9E05B782A4D3ABADEFF565FBD5CE4--></AD_TEXTINTERFACES>
+<!--25584757FAAF48399C3A676DF6C51970--><AD_TEXTINTERFACES>
+<!--25584757FAAF48399C3A676DF6C51970--> <AD_TEXTINTERFACES_ID><![CDATA[25584757FAAF48399C3A676DF6C51970]]></AD_TEXTINTERFACES_ID>
+<!--25584757FAAF48399C3A676DF6C51970--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--25584757FAAF48399C3A676DF6C51970--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--25584757FAAF48399C3A676DF6C51970--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--25584757FAAF48399C3A676DF6C51970--> <TEXT><![CDATA[@bp_nam@: The Business Partner name]]></TEXT>
+<!--25584757FAAF48399C3A676DF6C51970--> <FILENAME><![CDATA[/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html]]></FILENAME>
+<!--25584757FAAF48399C3A676DF6C51970--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--25584757FAAF48399C3A676DF6C51970--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--25584757FAAF48399C3A676DF6C51970--></AD_TEXTINTERFACES>
+
<!--25AA0658849611DDB88C001B388C05F0--><AD_TEXTINTERFACES>
<!--25AA0658849611DDB88C001B388C05F0--> <AD_TEXTINTERFACES_ID><![CDATA[25AA0658849611DDB88C001B388C05F0]]></AD_TEXTINTERFACES_ID>
<!--25AA0658849611DDB88C001B388C05F0--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -13329,6 +13340,17 @@
<!--26461A71B3E141A09F3CAE6A29D38875--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--26461A71B3E141A09F3CAE6A29D38875--></AD_TEXTINTERFACES>
+<!--26C4AF54C40D42D492048F1882C1FCEB--><AD_TEXTINTERFACES>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <AD_TEXTINTERFACES_ID><![CDATA[26C4AF54C40D42D492048F1882C1FCEB]]></AD_TEXTINTERFACES_ID>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <TEXT><![CDATA[@doc_desc@: The document description]]></TEXT>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <FILENAME><![CDATA[/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html]]></FILENAME>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--26C4AF54C40D42D492048F1882C1FCEB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--26C4AF54C40D42D492048F1882C1FCEB--></AD_TEXTINTERFACES>
+
<!--272CF5C8A1F411DD8ED1EF26D1098B24--><AD_TEXTINTERFACES>
<!--272CF5C8A1F411DD8ED1EF26D1098B24--> <AD_TEXTINTERFACES_ID><![CDATA[272CF5C8A1F411DD8ED1EF26D1098B24]]></AD_TEXTINTERFACES_ID>
<!--272CF5C8A1F411DD8ED1EF26D1098B24--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -17850,6 +17872,17 @@
<!--7FF3469B9A49B90AE040007F01007549--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--7FF3469B9A49B90AE040007F01007549--></AD_TEXTINTERFACES>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--><AD_TEXTINTERFACES>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <AD_TEXTINTERFACES_ID><![CDATA[811C781F0F9B4F13945E02EE4EF47A2E]]></AD_TEXTINTERFACES_ID>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <TEXT><![CDATA[@doc_nextduedate@: The next due date (if any)]]></TEXT>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <FILENAME><![CDATA[/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html]]></FILENAME>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--811C781F0F9B4F13945E02EE4EF47A2E--></AD_TEXTINTERFACES>
+
<!--81243D63B75A45A189F333425025E4BC--><AD_TEXTINTERFACES>
<!--81243D63B75A45A189F333425025E4BC--> <AD_TEXTINTERFACES_ID><![CDATA[81243D63B75A45A189F333425025E4BC]]></AD_TEXTINTERFACES_ID>
<!--81243D63B75A45A189F333425025E4BC--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -20851,6 +20884,17 @@
<!--DC56329107544464ADCEA111AA534C17--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--DC56329107544464ADCEA111AA534C17--></AD_TEXTINTERFACES>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--><AD_TEXTINTERFACES>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <AD_TEXTINTERFACES_ID><![CDATA[DC736F24AA3B49CAB7BC3ADB5C67AD93]]></AD_TEXTINTERFACES_ID>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <TEXT><![CDATA[@doc_date@: The document date]]></TEXT>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <FILENAME><![CDATA[/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html]]></FILENAME>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DC736F24AA3B49CAB7BC3ADB5C67AD93--></AD_TEXTINTERFACES>
+
<!--DC828874109D4454AD120F56406F216B--><AD_TEXTINTERFACES>
<!--DC828874109D4454AD120F56406F216B--> <AD_TEXTINTERFACES_ID><![CDATA[DC828874109D4454AD120F56406F216B]]></AD_TEXTINTERFACES_ID>
<!--DC828874109D4454AD120F56406F216B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -20972,6 +21016,17 @@
<!--E33AED1E995D11DD8123001D09C4A2FE--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--E33AED1E995D11DD8123001D09C4A2FE--></AD_TEXTINTERFACES>
+<!--E33C53F541C348DAA120799FAF7474FB--><AD_TEXTINTERFACES>
+<!--E33C53F541C348DAA120799FAF7474FB--> <AD_TEXTINTERFACES_ID><![CDATA[E33C53F541C348DAA120799FAF7474FB]]></AD_TEXTINTERFACES_ID>
+<!--E33C53F541C348DAA120799FAF7474FB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E33C53F541C348DAA120799FAF7474FB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E33C53F541C348DAA120799FAF7474FB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E33C53F541C348DAA120799FAF7474FB--> <TEXT><![CDATA[@doc_lastduedate@: The last due date (if any)]]></TEXT>
+<!--E33C53F541C348DAA120799FAF7474FB--> <FILENAME><![CDATA[/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html]]></FILENAME>
+<!--E33C53F541C348DAA120799FAF7474FB--> <ISUSED><![CDATA[Y]]></ISUSED>
+<!--E33C53F541C348DAA120799FAF7474FB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E33C53F541C348DAA120799FAF7474FB--></AD_TEXTINTERFACES>
+
<!--E33CDC5A995D11DD8F45001D09C4A2FE--><AD_TEXTINTERFACES>
<!--E33CDC5A995D11DD8F45001D09C4A2FE--> <AD_TEXTINTERFACES_ID><![CDATA[E33CDC5A995D11DD8F45001D09C4A2FE]]></AD_TEXTINTERFACES_ID>
<!--E33CDC5A995D11DD8F45001D09C4A2FE--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/utility/reporting/Report.java Tue Aug 20 01:26:12 2013 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/Report.java Mon Aug 19 12:03:12 2013 +0200
@@ -9,7 +9,7 @@
* either express or implied. See the License for the specific language
* governing rights and limitations under the License. The Original Code is
* Openbravo ERP. The Initial Developer of the Original Code is Openbravo SLU All
- * portions are Copyright (C) 2001-2012 Openbravo SLU All Rights Reserved.
+ * portions are Copyright (C) 2001-2013 Openbravo SLU All Rights Reserved.
* Contributor(s): ______________________________________.
* ***********************************************************************
*/
@@ -53,6 +53,10 @@
private String _BPartnerId;
private String _BPartnerName;
private String _BPartnerLanguage;
+ private String _DocDate; // Date Ordered, Date Invoices, etc.
+ private String _MinDueDate; // Useful for Orders and Invoices
+ private String _MaxDueDate; // Useful for Orders and Invoices
+ private String _DocDescription;
private String _Filename;
private File _targetDirectory;
private boolean _isAttached;
@@ -118,6 +122,10 @@
_BPartnerName = reportData[0].getField("bpartner_name");
_BPartnerLanguage = reportData[0].getField("bpartner_language");
_DocumentStatus = reportData[0].getField("docstatus");
+ _DocDate = reportData[0].getField("docdate");
+ _MinDueDate = reportData[0].getField("minduedate");
+ _MaxDueDate = reportData[0].getField("maxduedate");
+ _DocDescription = reportData[0].getField("docdesc");
templateInfo = new TemplateInfo(connectionProvider, docTypeId, orgId, strLanguage, templateId);
_Filename = generateReportFileName();
@@ -139,6 +147,11 @@
reportFilename = reportFilename.replaceAll("@our_ref@", _OurReference);
reportFilename = reportFilename.replaceAll("@cus_ref@", _CusReference);
reportFilename = reportFilename.replaceAll("@cus_nam@", _BPartnerName);
+ reportFilename = reportFilename.replaceAll("@bp_nam@", _BPartnerName);
+ reportFilename = reportFilename.replaceAll("@doc_date@", _DocDate);
+ reportFilename = reportFilename.replaceAll("@doc_nextduedate@", _MinDueDate);
+ reportFilename = reportFilename.replaceAll("@doc_lastduedate@", _MaxDueDate);
+ // reportFilename = reportFilename.replaceAll("@doc_desc@", _DocDescription); // Too long
if (checkSalesOrder.equalsIgnoreCase("y")
&& !_DocumentType.toString().equalsIgnoreCase("PAYMENT")) {
reportFilename = reportFilename.replaceAll("@sal_nam@", _SalNam);
@@ -195,6 +208,26 @@
return _BPartnerId;
}
+ public String getBPName() {
+ return _BPartnerName;
+ }
+
+ public String getDocDate() {
+ return _DocDate;
+ }
+
+ public String getMinDueDate() {
+ return _MinDueDate;
+ }
+
+ public String getMaxDueDate() {
+ return _MaxDueDate;
+ }
+
+ public String getDocDescription() {
+ return _DocDescription;
+ }
+
public boolean isDraft() {
return _DocumentStatus.equals("DR") || _DocumentStatus.equals("RPAP");
}
--- a/src/org/openbravo/erpCommon/utility/reporting/Report_data.xsql Tue Aug 20 01:26:12 2013 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/Report_data.xsql Mon Aug 19 12:03:12 2013 +0200
@@ -12,7 +12,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2012 Openbravo SLU
+ * All portions are Copyright (C) 2001-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -42,7 +42,11 @@
'' as bpartner_id,
'' as bpartner_name,
'' as bpartner_language,
- '' as isSalesOrderTransaction
+ '' as isSalesOrderTransaction,
+ '' as docdate,
+ '' as minduedate,
+ '' as maxduedate,
+ '' as docdesc
from
c_order
where
@@ -71,13 +75,25 @@
ad_user.name as salnam,
c_order.c_bpartner_id as bpartner_id,
c_bpartner.name as bpartner_name,
- c_bpartner.ad_language as bpartner_language
+ c_bpartner.ad_language as bpartner_language,
+ c_order.dateordered as docdate,
+ (select min(fin_payment_schedule.duedate)
+ from fin_payment_schedule
+ where c_order.c_order_id = fin_payment_schedule.c_order_id
+ and fin_payment_schedule.outstandingamt > 0
+ ) as minduedate,
+ (select max(fin_payment_schedule.duedate)
+ from fin_payment_schedule
+ where c_order.c_order_id = fin_payment_schedule.c_order_id
+ and fin_payment_schedule.outstandingamt > 0
+ ) as maxduedate,
+ c_order.description as docdesc
from
c_order left join c_doctype on c_order.c_doctypetarget_id = c_doctype.c_doctype_id
left join c_bpartner on c_order.c_bpartner_id = c_bpartner.c_bpartner_id
left join ad_user on c_order.salesrep_id = ad_user.ad_user_id
where
- c_order.c_order_id = ?
+ c_order.c_order_id = ?
]]>
</Sql>
<Parameter name="cOrderId" />
@@ -100,7 +116,19 @@
c_invoice.c_bpartner_id as bpartner_id,
c_invoice.issotrx as isSalesOrderTransaction,
c_bpartner.name as bpartner_name,
- c_bpartner.ad_language as bpartner_language
+ c_bpartner.ad_language as bpartner_language,
+ c_invoice.dateinvoiced as docdate,
+ (select min(fin_payment_schedule.duedate)
+ from fin_payment_schedule
+ where c_invoice.c_invoice_id = fin_payment_schedule.c_invoice_id
+ and fin_payment_schedule.outstandingamt > 0
+ ) as minduedate,
+ (select max(fin_payment_schedule.duedate)
+ from fin_payment_schedule
+ where c_invoice.c_invoice_id = fin_payment_schedule.c_invoice_id
+ and fin_payment_schedule.outstandingamt > 0
+ ) as maxduedate,
+ c_invoice.description as docdesc
from
c_invoice left join c_doctype on c_invoice.c_doctypetarget_id = c_doctype.c_doctype_id
left join c_bpartner on c_invoice.c_bpartner_id = c_bpartner.c_bpartner_id
@@ -128,7 +156,11 @@
m_inout.c_bpartner_id as bpartner_id,
m_inout.issotrx as isSalesOrderTransaction,
c_bpartner.name as bpartner_name,
- c_bpartner.ad_language as bpartner_language
+ c_bpartner.ad_language as bpartner_language,
+ m_inout.movementdate as docdate,
+ null as minduedate,
+ null as maxduedate,
+ m_inout.description as docdesc
from
m_inout left join c_doctype on m_inout.c_doctype_id = c_doctype.c_doctype_id
left join c_bpartner on m_inout.c_bpartner_id = c_bpartner.c_bpartner_id
@@ -155,7 +187,17 @@
fin_payment.c_bpartner_id as bpartner_id,
fin_payment.isreceipt as isSalesOrderTransaction,
c_bpartner.name as bpartner_name,
- c_bpartner.ad_language as bpartner_language
+ c_bpartner.ad_language as bpartner_language,
+ fin_payment.paymentdate as docdate,
+ (select min(fin_payment_detail_v.duedate)
+ from fin_payment_detail_v
+ where fin_payment.fin_payment_id = fin_payment_detail_v.fin_payment_id
+ ) as minduedate,
+ (select max(fin_payment_detail_v.duedate)
+ from fin_payment_detail_v
+ where fin_payment.fin_payment_id = fin_payment_detail_v.fin_payment_id
+ ) as maxduedate,
+ fin_payment.description as docdesc
from
fin_payment left join c_doctype on fin_payment.c_doctype_id = c_doctype.c_doctype_id
left join c_bpartner on fin_payment.c_bpartner_id = c_bpartner.c_bpartner_id
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html Tue Aug 20 01:26:12 2013 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/EmailOptions.html Mon Aug 19 12:03:12 2013 +0200
@@ -13,7 +13,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2008-2012 Openbravo SLU
+ * All portions are Copyright (C) 2008-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -282,7 +282,7 @@
<td style="width: 1%; text-align: right;">
<span style="white-space: nowrap; padding-right: 10px;" class="LabelText">From</span>
</td>
- <td id="fromEmailArea"colspan="2">
+ <td id="fromEmailArea"colspan="3">
<input type="hidden" name="fromEmailId" id="fromEmailId" value=""></input>
<input style="width: 55%;" type="text" dojoType="openbravo:ValidationTextBox"
class="dojoValidateValid readonly TextBox_btn_TwoCells_width"
@@ -298,7 +298,7 @@
<td style="width: 1%; text-align: right;">
<span style="white-space: nowrap; padding-right: 10px;" class="LabelText">To</span>
</td>
- <td id="toEmailArea"colspan="2">
+ <td id="toEmailArea"colspan="3">
<input style="width: 55%;" type="text" dojoType="openbravo:ValidationTextBox"
class="dojoValidateValid required TextBox_btn_TwoCells_width"
maxlength="200" name="toEmail" id="toEmail" value=""
@@ -381,12 +381,26 @@
<td style="width: 1%; text-align: right;">
<span style="white-space: nowrap; padding-right: 10px;" class="LabelText">Subject</span>
</td>
- <td colspan="2">
- <input style="width: 55%;" type="text" dojoType="openbravo:ValidationTextBox"
+ <td colspan="1">
+ <input style="width: 100%;" type="text" dojoType="openbravo:ValidationTextBox"
class="dojoValidateValid required TextBox_btn_TwoCells_width"
maxlength="200" name="emailSubject" id="emailSubject" value=""
required="true">
</td>
+ <td rowspan="5">
+ <ul class="LabelText" style="list-style: none; padding-left: 10px;" >
+ <li>References will be replaced by values:</li>
+ <li>@cus_ref@: The document reference of the customer</li>
+ <li>@our_ref@: The reference of the document</li>
+ <li>@cus_nam@: The name of the customer</li>
+ <li>@sal_nam@: The name of the sales rep.</li>
+ <li>@bp_nam@: The Business Partner name</li>
+ <li>@doc_date@: The document date</li>
+ <li>@doc_desc@: The document description</li>
+ <li>@doc_nextduedate@: The next due date (if any)</li>
+ <li>@doc_lastduedate@: The last due date (if any)</li>
+ </ul>
+ </td>
</tr>
<tr style="height: 8px">
@@ -397,16 +411,7 @@
<span style="white-space: nowrap; padding-right: 10px;" class="LabelText">Message Body</span>
</td>
<td nowrap="nowrap" style="width: 55%;">
- <textarea id="emailBody" style="height: 100px; width: 99.1%;" class="dojoValidateValid" maxlength="2000" name="emailBody" onkeyup="" onchange=""></textarea>
- </td>
- <td>
- <ul class="LabelText" style="list-style: none; padding-left: 10px;" >
- <li>References will be replaced by values:</li>
- <li>@cus_ref@: The document reference of the customer</li>
- <li>@our_ref@: The reference of the document</li>
- <li>@cus_nam@: The name of the customer</li>
- <li>@sal_nam@: The name of the sales rep.</li>
- </u>
+ <textarea id="emailBody" style="height: 180px; width: 99.1%;" class="dojoValidateValid" maxlength="2000" name="emailBody" onkeyup="" onchange=""></textarea>
</td>
</tr>
<tr style="height: 8px">
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java Tue Aug 20 01:26:12 2013 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java Mon Aug 19 12:03:12 2013 +0200
@@ -698,11 +698,21 @@
emailSubject = emailSubject.replaceAll("@our_ref@", ourReference);
emailSubject = emailSubject.replaceAll("@cus_nam@", toName);
emailSubject = emailSubject.replaceAll("@sal_nam@", replyToName);
+ emailSubject = emailSubject.replaceAll("@bp_nam@", report.getBPName());
+ emailSubject = emailSubject.replaceAll("@doc_date@", report.getDocDate());
+ emailSubject = emailSubject.replaceAll("@doc_nextduedate@", report.getMinDueDate());
+ emailSubject = emailSubject.replaceAll("@doc_lastduedate@", report.getMaxDueDate());
+ emailSubject = emailSubject.replaceAll("@doc_desc@", report.getDocDescription());
emailBody = emailBody.replaceAll("@cus_ref@", cusReference);
emailBody = emailBody.replaceAll("@our_ref@", ourReference);
emailBody = emailBody.replaceAll("@cus_nam@", toName);
emailBody = emailBody.replaceAll("@sal_nam@", replyToName);
+ emailBody = emailBody.replaceAll("@bp_nam@", report.getBPName());
+ emailBody = emailBody.replaceAll("@doc_date@", report.getDocDate());
+ emailBody = emailBody.replaceAll("@doc_nextduedate@", report.getMinDueDate());
+ emailBody = emailBody.replaceAll("@doc_lastduedate@", report.getMaxDueDate());
+ emailBody = emailBody.replaceAll("@doc_desc@", report.getDocDescription());
String host = null;
boolean auth = true;