You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the README; Renamed the Class TestDataSetup.cls as ExtededTestDataSetup for compatibility; Fix the issue that block resuing MasterQuote to generate Sub Quotes/Subscriptions.
Copy file name to clipboardExpand all lines: QuoteSplit/README
+26-5Lines changed: 26 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,18 @@ INTRODUCTION
31
31
32
32
This Z-Force Sample Code package provides a reference implementation that split single Quote(MasterQuote) into two Quotes(SubQuote) and sending to Z-Billing.
33
33
34
+
USE CASES
35
+
---------
36
+
a. The customers have two categories of Rate Plans ("Regular" and "Power") that need to send to Z-Billing according to the categories but to track using one Quote on SFDC called MasterQuote.
37
+
b. Correspondingly to the two categories, there could be two SubQuotes. In this sample code, we can send two SubQuotes simultaneously to Z-Billing (only if there are two different categories of Rate Plans selected for the Quote),
38
+
and there will be two Subscriptions generated after sending to Z-Billing.
39
+
c. The Subscription(s) will generated on single existing Billing Account;
40
+
d. The Subscription Zuora ID(s) will be written back to the SubQuote(s) then roll up to the MasterQuote, among which, the "Regular" Subscription's ID will be stored in MasterQuote's zqu__ZuoraSubscriptionID__c,
41
+
and the "Power" Subscription's ID will be stored in the MasterQuotes' Extended_Zuora_Subscription_ID__c.
42
+
e. The SubQuote(s) will be deleted after subscribing, and only MasterQuote will be persisted.
34
43
35
44
PRE-REQUISITES
36
45
-------------
37
-
38
46
1. This sample code package is an unmanaged package that depends on the following Z-Force managed packages:
39
47
- Z-Force 360 Version 2.3
40
48
- Z-Force Quotes Version 5.5
@@ -65,17 +73,17 @@ ant deploy
65
73
66
74
This will deploy the sample code unmanaged package into your Salesforce.com organization.
67
75
68
-
69
76
And the second approach is by installation:
70
77
71
78
1. Install this sample code package using the following Force.com Installation URL:
This will install sample code unmanaged package into your Salesforce.com organization.
76
84
77
85
PACKAGE CONTENTS
78
-
================
86
+
----------------
79
87
80
88
Fields (3)
81
89
Component Name Parent Object Component Type Description
@@ -88,7 +96,7 @@ Code (3)
88
96
Component Name Parent Object Component Type Description
89
97
ExtendedZQuoteUtil Apex Class The reference implementation that split single Quote(MasterQuote) into two Quotes(SubQuote) and sending to Z-Billing.
90
98
SendToZBillingPreviewController Apex Class The entry page' controller which is to call ExtendedZQuoteUtil.sendToZBilling.
91
-
TestDataSetup Apex Class Setup test data for apex unit test.
99
+
ExtendedTestDataSetup Apex Class Setup test data for apex unit test.
92
100
93
101
Pages (1)
94
102
Component Name Parent Object Component Type Description
@@ -98,3 +106,16 @@ SendToZBillingPreview
98
106
Resources (1)
99
107
Component Name Parent Object Component Type Description
100
108
Send to Z-Billing (Quote Split) Quote Button or Link The link to SendToZBillingPreview page.
109
+
110
+
OPERATION MANUAL
111
+
---------------
112
+
1. Sync the product catalog from Z-Billing as usual, then check the Product Rate Plans, choose part of the records and set the Category__c field on the records.
113
+
Currently we support two categories "Power" or "Regular";
114
+
2. Create an Opportunity;
115
+
3. On the Opportunity, create a New Subscription Quote as MasterQuote and select products, either from "Power" or "Regular" category, for that Quote,
116
+
in another word, you can choose Product Rate Plans which belong to different Categories for the MasterQuote;
117
+
4. In the Quote Detail page, click "Send to Z-Billing(Quote Split)" button to enter the SendToZBillingPreview page;
118
+
5. In the SendToZBillingPreview, choose an existing Billing Account in Z-Billing(If there's no existing Billing Account, please prepare at least one in Z-Billing System).
119
+
6. Click Button "Send to Z-Billing" to complete subscribe call.
120
+
7. After that, you can verify the result in both SFDC and Z-Billing. In SFDC, the Quote object's zqu__ZuoraSubscriptionID__c or Extended_Zuora_Subscription_ID__c (or Both) should be populated with the Subscription ID(s) of SubQuote(s).
121
+
And In Z-Billing, the corresponding Subscription record(s) should be generated already.
System.assert(null!=acc.Id, 'Apex Test Failed to create Mockup account.');
302
302
@@ -307,7 +307,7 @@ public with sharing class TestDataSetup {
307
307
try {
308
308
insertbillto;
309
309
} catch (Exceptione) {
310
-
System.assert(false, 'TestDataSetup.prepareTestQuote: Exception occured while inserting Bill To Contact record. Exception Details: '+e.getMessage());
310
+
System.assert(false, 'ExtendedTestDataSetup.prepareTestQuote: Exception occured while inserting Bill To Contact record. Exception Details: '+e.getMessage());
311
311
}
312
312
System.assert(null!=billto.Id, 'Apex Test failed to create Mockup Bill To Contact.');
313
313
@@ -318,7 +318,7 @@ public with sharing class TestDataSetup {
318
318
try {
319
319
insertsoldto;
320
320
} catch (Exceptione) {
321
-
System.assert(false, 'TestDataSetup.prepareTestQuote: Exception occured while inserting Sold To Contact record. Exception Details: '+e.getMessage());
321
+
System.assert(false, 'ExtendedTestDataSetup.prepareTestQuote: Exception occured while inserting Sold To Contact record. Exception Details: '+e.getMessage());
322
322
}
323
323
System.assert(null!=soldto.Id, 'Apex Test failed to create Mockup Sold To Contact.');
324
324
@@ -330,7 +330,7 @@ public with sharing class TestDataSetup {
Copy file name to clipboardExpand all lines: QuoteSplit/src/classes/ExtendedZQuoteUtil.cls
+20-13Lines changed: 20 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/**
2
-
* Sample code of spliting single Quote(MasterQuote) into two Quotes(SubQuote) and sending to Z-Billing.
2
+
* Sample code of splitting single Quote(MasterQuote) into two Quotes(SubQuote) and sending to Z-Billing.
3
3
*
4
4
* User case
5
5
* a. The customers have two categories of Rate Plans (e.g. Regular/Power) that need to send to Z-Billing according to the categories but track using one MasterQuote.
@@ -39,8 +39,8 @@ global Class ExtendedZQuoteUtil {
39
39
40
40
// Create two Quotes, one for "Regular" Quote, and another for "Power" Quote.
0 commit comments