UI5 和 Kyma 的 event bus 介绍
SAP UI5
EventBus是一个小型的subscribe/publish模式实现,位于namespace sap.ui.core下面。
subscribe:

publish:

消息订阅:

消息发布:

C4C的price分Internal Pricing和External Pricing两种。
Internal Pricing涉及到的工作中心:主要有下图中蓝色高亮的Price Lists和Discount Lists两个。

C4C计算一个Sales Order / Sales Quote价格时,依次采用下列的优先级进行计算:
(1) 首先检查是否维护了客户专属的价格列表(customer specific price list )
(2) 如果没有,再检测是否存在客户组专属价格列表(customer group specific price list)
(3) 检查是否存在基于特定的销售组织和分销渠道的价格列表(distribution chain specific price list)
(4) 如果上述检测都检查不到对应的记录,最后使用Product工作中心中维护的基本价格列表(base price list)。

新建一个Document Type(也就是CRM的transaction type)

Maintenance Mode为Internal,意思是只使用Internal Pricing.

维护price list:

最后,新建Sales Order时使用document type ZTA,

我添加了2个行项目,总共数量为3个,所以最后Sales order抬头的net value为3 × 10 = 30美元。

External Pricing
价格计算在C4C外部系统,可能为SAP CRM或者ERP。

在C4C端触发远程价格计算,计算结果返回到C4C系统并存储。

在Fine tuning的External Pricing里指定ERP或者CRM端的price condition type:


这个Assigned To字段UI上显示的是party name, 然而绑定的字段是party ID。

原因是这个UI字段的presentationMode设为DescriptionOnly。


其实际显示的Description的值绑到了/Root/ProcessorFormattedName

ProcessorFormattedName在BO的路径:Root-.ProcessorParty-.AddressSnapshot-.DisplayNameSuitableForLogonLanguage-~FormattedName-~content

以我们以前负责的Opportunity为例,直接创建一个新的js文件,然后用所有字段为大写格式的JSON对象来模拟constant。UI5 framework也是用的这种方式。

Angular
用constant方法注入:
app.constant('MONGOLAB_CONFIG', {
baseUrl: '/databases/',
dbName: 'ascrum'
});
在要使用这个常量的地方直接声明依赖,然后使用:

Angular的常量注入有三种方式
// 在provider的构造器函数中直接声明常量依赖
module.provider('b', function BProvider(a) {
this.$get = function() {
return 'constant: ' + a;
};
});
// 在service中声明常量依赖
module.service('aService', function(a) {
// ......
});
// 定义在最后也没关系:常量注入任务会通过unshift操作放到任务队列的头部
module.constant('a', 'aConstant');
- 点赞
- 收藏
- 关注作者
评论(0)