CRM1002 Create Offers

General Information

Module Crm.Presales
Code CRM1002
Parent Document Deals
Sub-document Offers
Full Name Create Offers
Deterministic YES
Status ACTIVE
Supports Transitional Documents NO
Supports Single Execution YES
Replaces GenerateOffer
Orphan Rows None
Introduced In Version 2018.2
Date of Suspension -

Business Logic

The current generation procedure is meant to create template offers from a Deal.

To create an offer, the customer has to be specified. The customer is extracted from the party, selected in the Deal - Deal.Party - and the up to date customer definition of this party in the enterprise company of the offer - Offer.EnterpriseCompany(so Customer.Party = Deal.Party && Customer.EnterpriseCompany == Offer.EnterpriseCompany). If no such customer is found, the generation procedure is stopped and an error is thrown. The error text is:

 Party '{Deal.Party.PartyName}' is not defined as customer for enterprise company '{Deal.EnterpriseCompany.Party.PartyName}'. 
 In order to create an offer the party has to be defined as customer for enterprise company '{Deal.EnterpriseCompany.Party.PartyName}'.

The fields in the Offer’s header are filled as follows:

Offer.DocumentDate = Deal.DocumentDate
Offer.Customer = the determined Customer for the Deal.Party
Offer.DocumentCurrency = Offer.EnterpriseCompany.BaseCurrency 
Offer.Deal = Deal 
Offer.SalesPerson = Deal.LeadingSalesPerson
Offer.RequiredDeliveryDate = DocumentDate + Customer.DefaultDeliveryTermDays
Offer.PaymentDueDate = DocumentDate + Customer.DefaultPaymentTermDays
Offer.PriceList = Customer.DefaultPriceList
Offer.PaymentType = Customer.DefaultPaymentType
Note

The attributes which are not specified here are filled in as described in Standard Document Attributes

Fulfillments

No fulfilments and metrics are used for the current generation procedure. Each time the procedure is started, it creates new sub-document no matter if there are documents already created from previous procedure executions.


The new Offer Line is created as follows:

OfferLine.LineNo = DealLine.LineNo

OfferLine.Product = DealLine.Product

OfferLine.ProductDescription = OfferLine.Product.Name

OfferLine.GuaranteePeriodDays = OfferLine.Product.GuaranteePeriodDays

OfferLine.ProductCode = NULL

OfferLine.ProductPrice = loaded by the 'Determine product price'* method

OfferLine.UnitPrice = loaded by the 'Calculate Unit Price' method

OfferLine.Quantity = DealLine.Quantity

OfferLine.QuantityUnit = DealLine.QuantityUnit

OfferLine.QuantityBase = CONVERT(OfferLine.Quantity, OfferLine.Product.BaseMeasurementCategory.BaseUnit)

OfferLine.StandardQuantityBase = CONVERT(OfferLine.Quantity, OfferLine.Product.BaseMeasurementCategory.BaseUnit)

OfferLine.LineDiscount = loaded by the 'Determine line discount'* method

OfferLine.LineStandardDiscountPercent = if (OfferLine.LineDiscount != null)
                                        , then OfferLine.LineStandardDiscountPercent = OfferLine.LineDiscount.DiscountPercent
                                        , else OfferLine.LineStandardDiscountPercent = 0.00%   

OfferLine.LineCustomDiscountPercent = 0.00%

OfferLine.LineAmount = loaded by the 'Determine line amount in sales orders'* method

OfferLine.LineEndCustomerParty = NULL

OfferLine.RequiredDeliveryDate = Offer.RequiredDeliveryDate

OfferLine.DeliveryTermDays = 0

OfferLine.Variant = NULL

OfferLine.ChoiceGroupName = NULL

OfferLine.Notes = DealLine.Notes

OfferLine.IsSelected = true

*Determine product price

*Determine line discount

*Determine line amount in sales orders