[Vtigercrm-commits] [vtiger-commits] r7422 - in /vtigercrm/trunk: include/language/en_us.lang.php modules/Invoice/Invoice.php modules/PurchaseOrder/PurchaseOrder.php modules/Quotes/Quote.php modules/SalesOrder/SalesOrder.php modules/Users/DefaultDataPopulator.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Jun 22 02:33:31 EDT 2006
Author: saraj
Date: Thu Jun 22 00:33:19 2006
New Revision: 7422
Log:
* Modified to add the Status History for Po, SO and Invoice and Stage History for Quotes
Modified:
vtigercrm/trunk/include/language/en_us.lang.php
vtigercrm/trunk/modules/Invoice/Invoice.php
vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
vtigercrm/trunk/modules/Quotes/Quote.php
vtigercrm/trunk/modules/SalesOrder/SalesOrder.php
vtigercrm/trunk/modules/Users/DefaultDataPopulator.php
Modified: vtigercrm/trunk/include/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/include/language/en_us.lang.php (original)
+++ vtigercrm/trunk/include/language/en_us.lang.php Thu Jun 22 00:33:19 2006
@@ -756,7 +756,10 @@
'Purchase Order'=>'Purchase Order',
'Sales Stage History'=>'Sales Stage History',
'Users'=>'Users',
-
+'PurchaseOrder Status History'=>'PurchaseOrder Status History',
+'SalesOrder Status History'=>'SalesOrder Status History',
+'Quote Stage History'=>'Quote Stage History',
+'Invoice Status History'=>'Invoice Status History',
//Added language for Parent Tab
@@ -908,6 +911,10 @@
'LBL_TAG_CLOUD'=>'Tag Cloud',
'LBL_FOR'=>'for',
+'LBL_PO_STATUS'=>'PurchaseOrder Status',
+'LBL_SO_STATUS'=>'SalesOrder Status',
+'LBL_INVOICE_STATUS'=>'Invoice Status',
+
);
Modified: vtigercrm/trunk/modules/Invoice/Invoice.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Invoice.php (original)
+++ vtigercrm/trunk/modules/Invoice/Invoice.php Thu Jun 22 00:33:19 2006
@@ -209,6 +209,48 @@
return getAttachmentsAndNotes('Invoice',$query,$id);
}
+ /** Function used to get the Status history of the Invoice
+ * @param $id - invoice id
+ * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row
+ */
+ function get_invoicestatushistory($id)
+ {
+ global $log;
+ $log->debug("Entering get_invoicestatushistory(".$id.") method ...");
+
+ global $adb;
+ global $mod_strings;
+ global $app_strings;
+
+ $query = 'select vtiger_invoicestatushistory.*, vtiger_invoice.subject from vtiger_invoicestatushistory inner join vtiger_invoice on vtiger_invoice.invoiceid = vtiger_invoicestatushistory.invoiceid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_invoice.invoiceid where vtiger_crmentity.deleted = 0 and vtiger_invoice.invoiceid = '.$id;
+ $result=$adb->query($query);
+ $noofrows = $adb->num_rows($result);
+
+ $header[] = $app_strings['Invoice Id'];
+ $header[] = $app_strings['LBL_ACCOUNT_NAME'];
+ $header[] = $app_strings['LBL_AMOUNT'];
+ $header[] = $app_strings['LBL_INVOICE_STATUS'];
+ $header[] = $app_strings['LBL_LAST_MODIFIED'];
+
+ while($row = $adb->fetch_array($result))
+ {
+ $entries = Array();
+
+ $entries[] = $row['invoiceid'];
+ $entries[] = $row['accountname'];
+ $entries[] = $row['total'];
+ $entries[] = $row['invoicestatus'];
+ $entries[] = getDisplayDate($row['lastmodified']);
+
+ $entries_list[] = $entries;
+ }
+
+ $return_data = Array('header'=>$header,'entries'=>$entries_list);
+
+ $log->debug("Exiting get_invoicestatushistory method ...");
+
+ return $return_data;
+ }
}
Modified: vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/PurchaseOrder.php Thu Jun 22 00:33:19 2006
@@ -216,6 +216,50 @@
return getAttachmentsAndNotes('PurchaseOrder',$query,$id,$sid='purchaseorderid');
}
+ /** Function used to get the Status history of the Purchase Order
+ * @param $id - purchaseorder id
+ * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row
+ */
+ function get_postatushistory($id)
+ {
+ global $log;
+ $log->debug("Entering get_postatushistory(".$id.") method ...");
+
+ global $adb;
+ global $mod_strings;
+ global $app_strings;
+
+ $query = 'select vtiger_postatushistory.*, vtiger_purchaseorder.subject from vtiger_postatushistory inner join vtiger_purchaseorder on vtiger_purchaseorder.purchaseorderid = vtiger_postatushistory.purchaseorderid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_purchaseorder.purchaseorderid where vtiger_crmentity.deleted = 0 and vtiger_purchaseorder.purchaseorderid = '.$id;
+ $result=$adb->query($query);
+ $noofrows = $adb->num_rows($result);
+
+ $header[] = $app_strings['Order Id'];
+ $header[] = $app_strings['Vendor Name'];
+ $header[] = $app_strings['LBL_AMOUNT'];
+ $header[] = $app_strings['LBL_PO_STATUS'];
+ $header[] = $app_strings['LBL_LAST_MODIFIED'];
+
+ while($row = $adb->fetch_array($result))
+ {
+ $entries = Array();
+
+ $entries[] = $row['purchaseorderid'];
+ $entries[] = $row['vendorname'];
+ $entries[] = $row['total'];
+ $entries[] = $row['postatus'];
+ $entries[] = getDisplayDate($row['lastmodified']);
+
+ $entries_list[] = $entries;
+ }
+
+ $return_data = Array('header'=>$header,'entries'=>$entries_list);
+
+ $log->debug("Exiting get_postatushistory method ...");
+
+ return $return_data;
+ }
+
+
}
?>
Modified: vtigercrm/trunk/modules/Quotes/Quote.php
==============================================================================
--- vtigercrm/trunk/modules/Quotes/Quote.php (original)
+++ vtigercrm/trunk/modules/Quotes/Quote.php Thu Jun 22 00:33:19 2006
@@ -185,6 +185,51 @@
$log->debug("Exiting get_history method ...");
return getHistory('Quotes',$query,$id);
}
+
+
+ /** Function used to get the Quote Stage history of the Quotes
+ * @param $id - quote id
+ * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row
+ */
+ function get_quotestagehistory($id)
+ {
+ global $log;
+ $log->debug("Entering get_quotestagehistory(".$id.") method ...");
+
+ global $adb;
+ global $mod_strings;
+ global $app_strings;
+
+ $query = 'select vtiger_quotestagehistory.*, vtiger_quotes.subject from vtiger_quotestagehistory inner join vtiger_quotes on vtiger_quotes.quoteid = vtiger_quotestagehistory.quoteid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_quotes.quoteid where vtiger_crmentity.deleted = 0 and vtiger_quotes.quoteid = '.$id;
+ $result=$adb->query($query);
+ $noofrows = $adb->num_rows($result);
+
+ $header[] = $app_strings['Quote Id'];
+ $header[] = $app_strings['LBL_ACCOUNT_NAME'];
+ $header[] = $app_strings['LBL_AMOUNT'];
+ $header[] = $app_strings['Quote Stage'];
+ $header[] = $app_strings['LBL_LAST_MODIFIED'];
+
+ while($row = $adb->fetch_array($result))
+ {
+ $entries = Array();
+
+ $entries[] = $row['quoteid'];
+ $entries[] = $row['accountname'];
+ $entries[] = $row['total'];
+ $entries[] = $row['quotestage'];
+ $entries[] = getDisplayDate($row['lastmodified']);
+
+ $entries_list[] = $entries;
+ }
+
+ $return_data = Array('header'=>$header,'entries'=>$entries_list);
+
+ $log->debug("Exiting get_quotestagehistory method ...");
+
+ return $return_data;
+ }
+
}
?>
Modified: vtigercrm/trunk/modules/SalesOrder/SalesOrder.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/SalesOrder.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/SalesOrder.php Thu Jun 22 00:33:19 2006
@@ -245,6 +245,50 @@
}
+ /** Function used to get the Status history of the Sales Order
+ * @param $id - salesorder id
+ * return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are array which contains all the column values of an row
+ */
+ function get_sostatushistory($id)
+ {
+ global $log;
+ $log->debug("Entering get_sostatushistory(".$id.") method ...");
+
+ global $adb;
+ global $mod_strings;
+ global $app_strings;
+
+ $query = 'select vtiger_sostatushistory.*, vtiger_salesorder.subject from vtiger_sostatushistory inner join vtiger_salesorder on vtiger_salesorder.salesorderid = vtiger_sostatushistory.salesorderid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_salesorder.salesorderid where vtiger_crmentity.deleted = 0 and vtiger_salesorder.salesorderid = '.$id;
+ $result=$adb->query($query);
+ $noofrows = $adb->num_rows($result);
+
+ $header[] = $app_strings['Order Id'];
+ $header[] = $app_strings['LBL_ACCOUNT_NAME'];
+ $header[] = $app_strings['LBL_AMOUNT'];
+ $header[] = $app_strings['LBL_SO_STATUS'];
+ $header[] = $app_strings['LBL_LAST_MODIFIED'];
+
+ while($row = $adb->fetch_array($result))
+ {
+ $entries = Array();
+
+ $entries[] = $row['salesorderid'];
+ $entries[] = $row['accountname'];
+ $entries[] = $row['total'];
+ $entries[] = $row['sostatus'];
+ $entries[] = getDisplayDate($row['lastmodified']);
+
+ $entries_list[] = $entries;
+ }
+
+ $return_data = Array('header'=>$header,'entries'=>$entries_list);
+
+ $log->debug("Exiting get_sostatushistory method ...");
+
+ return $return_data;
+ }
+
+
}
?>
Modified: vtigercrm/trunk/modules/Users/DefaultDataPopulator.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DefaultDataPopulator.php (original)
+++ vtigercrm/trunk/modules/Users/DefaultDataPopulator.php Thu Jun 22 00:33:19 2006
@@ -1769,6 +1769,8 @@
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Quotes").",9,'get_history',3,'Activity History',0)");
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Quotes").",0,'get_quotestagehistory',4,'Quote Stage History',0)");
+
// Inserting Purchase order Related Lists
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("PurchaseOrder").",9,'get_activities',1,'Activities',0)");
@@ -1777,6 +1779,8 @@
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("PurchaseOrder").",".getTabid("Activities").",'get_history',3,'Activity History',0)");
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("PurchaseOrder").",0,'get_postatushistory',4,'PurchaseOrder Status History',0)");
+
// Inserting Sales order Related Lists
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("SalesOrder").",9,'get_activities',1,'Activities',0)");
@@ -1787,6 +1791,8 @@
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("SalesOrder").",".getTabid("Activities").",'get_history',4,'Activity History',0)");
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("SalesOrder").",0,'get_sostatushistory',5,'SalesOrder Status History',0)");
+
// Inserting Invoice Related Lists
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Invoice").",9,'get_activities',1,'Activities',0)");
@@ -1794,6 +1800,8 @@
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Invoice").",0,'get_attachments',2,'Attachments',0)");
$this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Invoice").",".getTabid("Activities").",'get_history',3,'Activity History',0)");
+
+ $this->db->query("insert into vtiger_relatedlists values(".$this->db->getUniqueID('relatedlists').",".getTabid("Invoice").",0,'get_invoicestatushistory',4,'Invoice Status History',0)");
// Inserting Activities Related Lists
More information about the vtigercrm-commits
mailing list