Permalink
Browse files

Add GM Send To Z-Billing in CustomProductSelector

  • Loading branch information...
1 parent 0e30ce9 commit ac69dd488d7f46fb2752e202d6b7e3fe3a212f61 @pinebud pinebud committed Sep 14, 2012
Binary file not shown.
@@ -53,25 +53,16 @@ public with sharing class CustomProductSelectorController {
private String productFilterFragment = ' ';
private String rateplanFilterFragment = ' ';
- private void loadCustomFilterSegments() {
- Custom_Product_Filter__c filterSegments = Custom_Product_Filter__c.getValues('filter');
- if (filterSegments != null) {
- productFilterFragment = filterSegments.get('Product_Filter_Fragment__c') == null ? '' : ' AND ' + (String) filterSegments.get('Product_Filter_Fragment__c');
- rateplanFilterFragment = filterSegments.get('RatePlan_Filter_Fragment__c') == null ? '' : ' AND ' + (String) filterSegments.get('RatePlan_Filter_Fragment__c');
- }
- System.debug('rateplanFilterFragment=' + rateplanFilterFragment);
- }
+ private String quoteId;
public CustomProductSelectorController(ApexPages.StandardController controller) {
initFailed = true;
- final String quoteId = controller.getId();
+ quoteId = controller.getId();
if (null == quoteId || '' == quoteId) {
appendErrorMessage('Need to specify the id of quote.');
return;
}
- loadCustomFilterSegments();
-
List < zqu__Quote__c > quotelist = [SELECT Id, Name, zqu__Opportunity__r.Name, zqu__Opportunity__r.Account.Name, zqu__Opportunity__r.Account.Id, zqu__RecordReadOnly__c, zqu__Currency__c, zqu__Status__c, zqu__StartDate__c, RecordTypeId
FROM zqu__Quote__c WHERE Id = : quoteId LIMIT 1];
@@ -305,6 +296,25 @@ public with sharing class CustomProductSelectorController {
return new PageReference('/' + this.quote.Id);
}
+ /**
+ *Hint:
+ * Global Method: sendToZBilling (quoteID, selectedZBillingAccountID, overrideZContacts, quoteFields, chargeFields):
+ * selectedZBillingAccountID = New: Create a new customer and a new subscription in Z-Billing corresponding to the quote in Salesforce. Use this only when the quote subscription type is "New Subscription."
+ * selectedZBillingAccountID = ID of the Customer in Z-Billing: Create a new subscription under the specified customer. Use this only when the quote subscription type is "New Subscription."
+ * selectedZBillingAccountID: This value is ignored for amendment and renewal scenarios.
+ */
+ public PageReference doSend() {
+ try {
+ String billingAccountId = ApexPages.currentPage().getParameters().get('billingAcountId');
+ if (billingAccountId == null) zqu.zQuoteUtil.sendToZBilling(quoteId, 'New', false, null, null);
+ else zqu.zQuoteUtil.sendToZBilling(quoteId, billingAccountId, false, null, null);
+ } catch (Exception e) {
+ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage()));
+ }
+
+ return null;
+ }
+
public PageReference cancel() {
this.selectNewProductViewMode = false;
if (this.chargeGroupList != null && this.chargeGroupList.size() > 0) return ApexPages.currentPage();
@@ -3,7 +3,7 @@
<apiVersion>23.0</apiVersion>
<packageVersions>
<majorNumber>5</majorNumber>
- <minorNumber>3</minorNumber>
+ <minorNumber>5</minorNumber>
<namespace>zqu</namespace>
</packageVersions>
<status>Active</status>
@@ -3,7 +3,7 @@
<apiVersion>23.0</apiVersion>
<packageVersions>
<majorNumber>5</majorNumber>
- <minorNumber>3</minorNumber>
+ <minorNumber>5</minorNumber>
<namespace>zqu</namespace>
</packageVersions>
<status>Active</status>
@@ -3,7 +3,7 @@
<apiVersion>23.0</apiVersion>
<packageVersions>
<majorNumber>5</majorNumber>
- <minorNumber>3</minorNumber>
+ <minorNumber>5</minorNumber>
<namespace>zqu</namespace>
</packageVersions>
<status>Active</status>
Binary file not shown.
@@ -173,7 +173,10 @@
rendered="{!! (editMode||selectNewProductViewMode) }"
status="selectNewProductStatus" />
<apex:commandButton value="Done" action="{!navigateBack}"
+ rendered="{!! (editMode||selectNewProductViewMode) }"
status="selectNewProductStatus" />
+ <apex:commandButton value="Send To Z-Billing" action="{!doSend}"
+ rendered="{!! (editMode||selectNewProductViewMode) }"/>
</apex:outputPanel>
</apex:facet>
</apex:actionStatus>
@@ -4,7 +4,7 @@
<label>CustomProductSelector</label>
<packageVersions>
<majorNumber>5</majorNumber>
- <minorNumber>3</minorNumber>
+ <minorNumber>5</minorNumber>
<namespace>zqu</namespace>
</packageVersions>
</ApexPage>

0 comments on commit ac69dd4

Please sign in to comment.