0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-11-21 23:47:57 +00:00
salesagility_SuiteCRM/modules/AOS_Quotes/createOpportunity.php
j.dang f8810ea5e0 Replace explicit bean instantiations in files 271 - 280
- File: '... /modules/AOS_Quotes/Dashlets/AOS_QuotesDashlet/AOS_QuotesDashlet.php'

   - Replaced 1 occurrence(s) of 'new AOS_Quotes()'

- File: '... /modules/AOS_Quotes/AOS_Quotes.php'

   - Replaced 1 occurrence(s) of 'new AOS_Products_Quotes()'

   - Replaced 1 occurrence(s) of 'new AOS_Line_Item_Groups()'

- File: '... /modules/AOS_Quotes/converToInvoice.php'

   - Replaced 1 occurrence(s) of 'new AOS_Invoices()'

   - Replaced 1 occurrence(s) of 'new AOS_Products_Quotes()'

   - Replaced 1 occurrence(s) of 'new AOS_Line_Item_Groups()'

   - Replaced 1 occurrence(s) of 'new AOS_Quotes()'

- File: '... /modules/AOS_Quotes/createContract.php'

   - Replaced 1 occurrence(s) of 'new AOS_Contracts()'

   - Replaced 1 occurrence(s) of 'new AOS_Products_Quotes()'

   - Replaced 1 occurrence(s) of 'new AOS_Line_Item_Groups()'

   - Replaced 1 occurrence(s) of 'new AOS_Quotes()'

- File: '... /modules/AOS_Quotes/createOpportunity.php'

   - Replaced 1 occurrence(s) of 'new Opportunity()'

   - Replaced 1 occurrence(s) of 'new AOS_Quotes()'

- File: '... /modules/AOW_Processed/Dashlets/AOW_ProcessedDashlet/AOW_ProcessedDashlet.php'

   - Replaced 1 occurrence(s) of 'new AOW_Processed()'

- File: '... /modules/SurveyQuestions/Dashlets/SurveyQuestionsDashlet/SurveyQuestionsDashlet.php'

   - Replaced 1 occurrence(s) of 'new SurveyQuestions()'

- File: '... /modules/Releases/index.php'

   - Replaced 1 occurrence(s) of 'new Release()'

- File: '... /modules/Releases/Popup_picker.php'

   - Replaced 1 occurrence(s) of 'new Release()'

- File: '... /modules/Releases/Save.php'

   - Replaced 1 occurrence(s) of 'new Release()'
2020-01-22 13:51:18 +00:00

58 lines
2.3 KiB
PHP
Executable File

<?php
/**
* Advanced OpenSales, Advanced, robust set of sales modules.
* @package Advanced OpenSales for SugarCRM
* @copyright SalesAgility Ltd http://www.salesagility.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with this program; if not, see http://www.gnu.org/licenses
* or write to the Free Software Foundation,Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301 USA
*
* @author SalesAgility <info@salesagility.com>
*/
if (!(ACLController::checkAccess('Opportunities', 'edit', true))) {
ACLController::displayNoAccess();
die;
}
global $app_list_strings;
require_once('modules/AOS_Quotes/AOS_Quotes.php');
require_once('modules/Opportunities/Opportunity.php');
//Setting values in Quotes
$quote = BeanFactory::newBean('AOS_Quotes');
$quote->retrieve($_REQUEST['record']);
//Setting Opportunity Values
$opportunity = BeanFactory::newBean('Opportunities');
$opportunity->name = $quote->name;
$opportunity->assigned_user_id = $quote->assigned_user_id;
$opportunity->amount = format_number($quote->total_amount);
$opportunity->account_id = $quote->billing_account_id;
$opportunity->currency_id = $quote->currency_id;
$opportunity->sales_stage = 'Proposal/Price Quote';
$opportunity->probability = $app_list_strings['sales_probability_dom']['Proposal/Price Quote'];
$opportunity->lead_source = 'Self Generated';
$opportunity->date_closed = $quote->expiration;
$opportunity->save();
//Setting opportunity quote relationship
$quote->load_relationship('opportunities');
$quote->opportunities->add($opportunity->id);
ob_clean();
header('Location: index.php?module=Opportunities&action=EditView&record='.$opportunity->id);