ZuloOne
English
Sign in
Menu

📝 Quotation — for the developer

Updated

← Developer wiki

The quotation is the CRM 1.4.0 model, not Core and not a country package. Sales order, realization and customer payment stay in Sales.

User: which buttons to press. Why the business wants it: sales and purchasing.

Objects#

Name Kind
SalesQuotation document, table part SalesQuotationLines (Lines)
Subtypes Draft / Issued / Converted / Cancelled
IQuotationService ConvertToOrderAsync(Guid) → the order's id or Empty
IssueQuotation Draft → Issued
ConvertQuotation Issued → Converted + the order
CancelQuotation Draft or Issued → Cancelled
SalesOrder.SourceQuotation a Guid on the order (the Sales model), the idempotency key
QuotationZr an Zr print form: header + lines in a single SlimTable, names through IReferenceDisplay, amounts from IPricingService.LineAmount
OrderZr the same trick on SalesOrder (the Sales model); the phone publishes it as SalesAgent.json layouts.SalesOrder.printForm

There are no transaction scripts. requiresPosting: true is there only so that the subtype change goes through the posting pipeline.

The service is named QuotationService, not SalesQuotation: otherwise the service class would collide with the SalesQuotation document.

There are no public DTOs in IQuotationService. An expired ValidUntil and no lines both give Guid.Empty.

The line price is ISalesLinePricing (Sales). On conversion a non-zero price is frozen as manual («Вручную»), so that the draft order does not recompute the contract over the quotation.

Idempotency: CountDocumentsAsync<SalesOrder>("SourceQuotation = '…'"), like SourceOrder on the realization. The field lives in Sales (the same layer as CRM — an extension field put on the order from CRM does not reach the entity). CRM depends on Sales ≥ 1.22.0.

The SalesQuotationTest test (the Бизнес-слой.Продажи и расчёты group).

What not to do#

  • Do not put the quotation in Sales and do not write Stock / Receivable / tax from this document.
  • Do not replace ApproveSalesOrder with converting a quotation.
  • Opportunity is not in the product; the lead is sales-lead.
  • Do not call ConvertToOrderAsync from OnAfterPost — the order is created by the command, the way InvoiceOrderAsync is by ApproveSalesOrder.

Same topic for other readers: User

Where next#

Was this page helpful?