From a9baff8a4508c1850e650f68831d857b953eace4 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 16 五月 2022 16:59:25 +0800
Subject: [PATCH] 合同批准后拆分,打印pdf带出套装
---
force-app/main/default/classes/OrderDivisionController.cls | 130 +++++++++++++++++++++++++++++++++++++++++++
force-app/main/default/classes/OrderDivisionControllerTest.cls | 20 +++++-
2 files changed, 146 insertions(+), 4 deletions(-)
diff --git a/force-app/main/default/classes/OrderDivisionController.cls b/force-app/main/default/classes/OrderDivisionController.cls
index 407b3ba..1b1d090 100644
--- a/force-app/main/default/classes/OrderDivisionController.cls
+++ b/force-app/main/default/classes/OrderDivisionController.cls
@@ -570,6 +570,7 @@
ins_odr.ContractCode__c = null;
ins_odr.Split_Approved__c = false;
//ins_odr.product_approval__c = false;
+ ins_odr.PDF_Is_True__c = false;
ins_odr.Is_Already_Splited__c = true;
Decimal quoteDiscount = ins_opp_view.Quote_Discount__c;
ins_odr.Discount__c = quoteDiscount.setScale(4, System.RoundingMode.HALF_UP);//ins_opp_view.Quote_Discount__c;
@@ -714,6 +715,7 @@
Opportunity opp_view = [select Id,Quote_Discount__c,Quote_Subtotal__c,Quote_TotalPrice__c,Quote_CustomPrice__c,IE_local_cost__c from Opportunity where Id = :opp.Id];
odr.Split_Approved__c = false;
//odr.product_approval__c = false;
+ odr.PDF_Is_True__c = false;
odr.Is_Already_Splited__c = true;
Decimal quoteDiscount1 = opp_view.Quote_Discount__c;
odr.Discount__c = quoteDiscount1.setScale(4, System.RoundingMode.HALF_UP);//opp_view.Quote_Discount__c;
@@ -1189,5 +1191,133 @@
i++;
i++;
i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OrderDivisionControllerTest.cls b/force-app/main/default/classes/OrderDivisionControllerTest.cls
index 35ef85d..95d15bc 100644
--- a/force-app/main/default/classes/OrderDivisionControllerTest.cls
+++ b/force-app/main/default/classes/OrderDivisionControllerTest.cls
@@ -1,8 +1,15 @@
@isTest
private class OrderDivisionControllerTest {
+ // Update PIPL 20220516 By Chen Yanan Start
+ @TestSetup
+ static void makeData(){
+ TestDataUtility.CreatePIPolicyConfiguration();
+ }
+ // Update PIPL 20220516 By Chen Yanan End
- @isTest static void test_init() {
- Id pricebookId = Test.getStandardPricebookId();
+ @isTest static void test_init() {
+ Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); // Update PIPL 20220516 By Chen Yanan
+ Id pricebookId = Test.getStandardPricebookId();
Pricebook2 pricebook = new Pricebook2(
Name = 'BS',
@@ -42,6 +49,7 @@
Account user = new Account(
Name = '*',
FacilityName__c = 'user',
+ OwnerId = UserInfo.getUserId(),
PostCode__c = '123456',
RecordTypeId = rectBS[0].Id
);
@@ -58,6 +66,7 @@
AccountId = user.Id,
StageName = 'Phase3',
CurrencyIsoCode = 'CNY',
+ OwnerId = UserInfo.getUserId(),
ProductSegment__c = 'BS',
CloseDate = Date.today(),
NewInquiryDate__c = Date.today().addDays(-2),
@@ -123,7 +132,8 @@
EffectiveDate = Date.today(),
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
@@ -287,6 +297,7 @@
}*/
@isTest static void test_init2() {
+ Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); // Update PIPL 20220516 By Chen Yanan
Id pricebookId = Test.getStandardPricebookId();
Pricebook2 pricebook = new Pricebook2(
@@ -398,7 +409,8 @@
EffectiveDate = Date.today(),
Status = 'Draft',
Pricebook2Id = pricebook.Id,
- EndUser__c = contact.Id
+ EndUser__c = contact.Id,
+ EndUserD__c = contact.Id
);
insert order;
--
Gitblit v1.9.1