Передать прайс-лист в подбор продуктов в заказе, по аналогии с передачей из контрагента
Добрый день, Коллеги!
В Sales в разделе Заказы есть подбор продуктов. Стандартная логика позволяет в карточке контрагента в поле прайс-лист выбрать прайс-лист и тогда, при подборе товаров в заказ будет видна цена согласно этого прайс-листа. Система как-то пробрасывает его туда. Я бы хотел подменить эту логику на передачу туда прайс-листа из карточки самого заказа (я поле создал справочное). Где искать? Какой метод подменить или использовать?
Нравится
Прайс-лист из таблицы контрагента используется в С#-схеме AccountPriceListPicker (там обычный Select), её вызывает тоже С#-схема веб-сервиса PriceListService:
/// <summary>
/// Get Price List using account. Took from account, if there is no Price List,
/// then took it from partnership
/// </summary>
/// <param name="accountId">Account identifier.</param>
/// <returns>PriceList identifier</returns>
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
public Guid GetPriceList(Guid accountId) {
var priceListPicker = ClassFactory.Get<IPriceListPicker>(new ConstructorArgument("userConnection",
UserConnection));
var preSetPriceList = priceListPicker.GetPriceList(accountId);
return preSetPriceList != default(Guid)
? preSetPriceList
: priceListPicker.GetPriceList(UserConnection.CurrentUser.AccountId);
}А уже к нему обращаются из JS в странице заказа BaseOrderPage пакета Order:
/**
* Sets predefined price list.
* @protected
* @virtual
*/
initializePredefinedPriceList: function() {
if (this.isPredefinedPriceListsEnabled()) {
this.$PredefinedPriceList = this.$Account && this.$Account.PriceList;
if (this.isEmpty(this.$PredefinedPriceList)) {
const config = this.getPriceListServiceConfig();
this.callService(config, this.onPredefinedPriceListInitialized, this);
}
}
},
...
/**
* Sets predefined price list.
* @protected
* @virtual
*/
initializePredefinedPriceList: function() {
if (this.isPredefinedPriceListsEnabled()) {
this.$PredefinedPriceList = this.$Account && this.$Account.PriceList;
if (this.isEmpty(this.$PredefinedPriceList)) {
const config = this.getPriceListServiceConfig();
this.callService(config, this.onPredefinedPriceListInitialized, this);
}
}
},
Прайс-лист из таблицы контрагента используется в С#-схеме AccountPriceListPicker (там обычный Select), её вызывает тоже С#-схема веб-сервиса PriceListService:
/// <summary>
/// Get Price List using account. Took from account, if there is no Price List,
/// then took it from partnership
/// </summary>
/// <param name="accountId">Account identifier.</param>
/// <returns>PriceList identifier</returns>
[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
public Guid GetPriceList(Guid accountId) {
var priceListPicker = ClassFactory.Get<IPriceListPicker>(new ConstructorArgument("userConnection",
UserConnection));
var preSetPriceList = priceListPicker.GetPriceList(accountId);
return preSetPriceList != default(Guid)
? preSetPriceList
: priceListPicker.GetPriceList(UserConnection.CurrentUser.AccountId);
}А уже к нему обращаются из JS в странице заказа BaseOrderPage пакета Order:
/**
* Sets predefined price list.
* @protected
* @virtual
*/
initializePredefinedPriceList: function() {
if (this.isPredefinedPriceListsEnabled()) {
this.$PredefinedPriceList = this.$Account && this.$Account.PriceList;
if (this.isEmpty(this.$PredefinedPriceList)) {
const config = this.getPriceListServiceConfig();
this.callService(config, this.onPredefinedPriceListInitialized, this);
}
}
},
...
/**
* Sets predefined price list.
* @protected
* @virtual
*/
initializePredefinedPriceList: function() {
if (this.isPredefinedPriceListsEnabled()) {
this.$PredefinedPriceList = this.$Account && this.$Account.PriceList;
if (this.isEmpty(this.$PredefinedPriceList)) {
const config = this.getPriceListServiceConfig();
this.callService(config, this.onPredefinedPriceListInitialized, this);
}
}
},