src/cluster_erp/modules/quotations/ içindeki quotations modülü satış tekliflerini tutar. Bir teklif (Quote), crm modülündeki bir müşteri teklif talebini yanıtlar; gönderilmeden önce fizibilite, tasarım, ürün ağacı, maliyetlendirme ve yönetim onayından geçer. Kalemleri maliyet ve fiyat taşır; başlık toplamları ve marj kalemlerden toplanır. Satış siparişleri teklif kalemlerine başvurur ve bu bir teklifi kazanılmış yapabilir.
Bir bakışta¶
| Öğe | Değer | Kaynak |
|---|---|---|
| Paket | src/cluster_erp/modules/quotations/ |
klasör |
| Modül sınıfı | Module |
src/cluster_erp/modules/quotations/module.py:18 |
name / version |
quotations / 0.1.0 |
src/cluster_erp/modules/quotations/module.py:20-25 |
| API öneki | /api/v1/quotations (ModuleBase.api_prefix) |
src/cluster_erp/core/module_base.py:37-38 |
| Alt modüller | 2: quotes, line_items |
klasör listesi |
| Tablolar | 5: quot_quotes, quot_mgmt_approvals, quot_quote_line_items, quot_rejection_reasons, quot_document_flow |
iki models.py dosyasındaki __tablename__ |
| Metadata'daki varlıklar | entities içinde 5 anahtar |
src/cluster_erp/modules/quotations/module.py:224-230 |
| Uçlar | Pakette 34 uç dekoratörü | @...router.get/post/put/patch/delete için grep |
| Aksiyonlar | 15 ActionMeta girdisi |
pakette grep "ActionMeta(" |
| Göçler | 20 dosya | metni beş tablo adından birini içeren migrations/versions/ dosyaları |
| Web uygulamasında yeri | Katalog uygulaması quotations |
src/cluster_erp/modules/app_store/catalog.json (quotations girdisi) |
| Masaüstünde yeri | yalnızca genel bileşenler | src/cluster_erp/desktop/modules/ içinde quotations klasörü yok |
Modül ne yapar¶
- Bir müşteri teklif talebi için, talep başına bir etkin teklif olacak şekilde teklif oluşturur ve ticari varsayılanları müşteriden alır (
src/cluster_erp/modules/quotations/quotes/services.py:175-239). - Teklifi fizibilite, isteğe bağlı tasarım, ürün ağacı ve maliyetlendirmeden geçirir (
src/cluster_erp/modules/quotations/quotes/services.py:59-71). - Bir yönetim onayı toplantısını ve kararını kaydeder (
src/cluster_erp/modules/quotations/quotes/services.py:467-549). - Teklifi bir onay ve eksiksizlik denetiminden sonra gönderir, ardından kazanıldı, kaybedildi veya süresi doldu olarak işaretler (
src/cluster_erp/modules/quotations/quotes/services.py:550-686). - Toplam fiyatı, toplam maliyeti ve marjı kalemlerden toplar (
src/cluster_erp/modules/quotations/rollup.py:1-17). - Hangi satış siparişi kalemlerinin hangi teklif kalemlerine başvurduğunu kaydeder (
src/cluster_erp/modules/quotations/quotes/services.py:925-1042).
Alt modüller¶
| Alt modül | Amaç | Ana varlıklar | Yönlendirici | Kaynak |
|---|---|---|---|---|
quotes |
Teklifler, onaylar, yaşam döngüsü, sürümler, geçmiş, belge akışı | Quote, MgmtApproval |
/quotes |
src/cluster_erp/modules/quotations/quotes/routes.py:37-52 |
line_items |
Kalemler, ret nedenleri, belge akışı satırları | QuoteLineItem, QuoteRejectionReason, QuoteDocumentFlow |
/quotes/.../line-items |
src/cluster_erp/modules/quotations/line_items/routes.py:21-24 |
Veri modeli¶
| Varlık | Tablo | Anahtar alanlar | Notlar | Kaynak |
|---|---|---|---|---|
Quote |
quot_quotes |
quote_no, rfq_id, version_no, status, feasibility_done, requires_new_design, bom_id, nesting_id, costing_id, mgmt_approval_id, superseded_by_id, total_price, total_cost, overall_margin_pct, currency, validity_days, payment_terms, incoterm, sent_at, won_at, lost_at, lost_reason |
toplamlar Numeric(19, 4), marj Numeric(5, 2) |
src/cluster_erp/modules/quotations/quotes/models.py:37-169 |
MgmtApproval |
quot_mgmt_approvals |
quote_id, scheduled_at, held_at, attendees, decision, adjustments, notes, recorded_by |
decision değeri approved, conditional veya rejected |
src/cluster_erp/modules/quotations/quotes/models.py:171-199, src/cluster_erp/modules/quotations/quotes/schemas.py:24 |
QuoteLineItem |
quot_quote_line_items |
quote_id, line_no, ordered_qty, part_id, part_model_id, part_version_id, customer_part_id, qty, uom, unit_cost, margin_pct, unit_price, line_total, currency, bom_id, costing_id, reason_for_rejection |
para Numeric(18, 4) |
src/cluster_erp/modules/quotations/line_items/models.py:49-137 |
QuoteRejectionReason |
quot_rejection_reasons |
code, label_en, label_tr, is_active |
başvuru verisi | src/cluster_erp/modules/quotations/line_items/models.py:23-46 |
QuoteDocumentFlow |
quot_document_flow |
quote_id, quote_line_item_id, order_id, order_line_id, referenced_qty, referenced_value, currency |
satış siparişi başvurusu başına bir satır | src/cluster_erp/modules/quotations/line_items/models.py:139-171 |
Kalem kırılımları ensure_product_breakdown ile denetlenir (src/cluster_erp/modules/quotations/line_items/services.py:102-106, src/cluster_erp/modules/quotations/line_items/services.py:131-136).
Ekranlar ve metadata¶
get_metadata aynı adlı tek liste bölümüyle bir Satış Teklifleri (İngilizce Sales Quotations) kenar çubuğu grubu bildirir (src/cluster_erp/modules/quotations/module.py:203-222). Varlıklar quote, quote_line_item, mgmt_approval, quote_document_flow ve quote_history'dir (src/cluster_erp/modules/quotations/module.py:224-230). Teklif kartı eksiksizliğini, belge akışını, geçmişini, sürümlerini ve benzer projeleri ayrı uçlardan okur (src/cluster_erp/modules/quotations/quotes/routes.py:384-439). Bkz. genel ayrıntı.
Durumlar ve aksiyonlar¶
Servis şu geçişlere izin verir (src/cluster_erp/modules/quotations/quotes/services.py:59-74).
stateDiagram-v2 [*] --> draft draft --> feasibility: start_feasibility feasibility --> design_required: mark_design_required feasibility --> bom_pending: complete_feasibility design_required --> bom_pending: complete_design bom_pending --> costing: attach_bom costing --> bom_pending: return_to_bom costing --> pending_mgmt_approval: attach_costing pending_mgmt_approval --> mgmt_rejected: karar rejected pending_mgmt_approval --> sent: send sent --> won: mark_won sent --> lost: mark_lost sent --> expired: mark_expired
Düz anlatımla: bir teklif draft olarak başlar ve fizibiliteden geçer. Yeni bir tasarım gerekirse design_required durumundan geçer. Bir ürün ağacı onu costing, bir maliyetlendirme pending_mgmt_approval durumuna taşır. Ret kararı onu mgmt_rejected olarak bitirir. Gönderim approved veya conditional bir karar ister (src/cluster_erp/modules/quotations/quotes/services.py:550-616). won, lost, expired ve mgmt_rejected son durumlardır; revise, pending_mgmt_approval, mgmt_rejected, expired veya lost durumundan yeni bir sürüm oluşturur (src/cluster_erp/modules/quotations/quotes/services.py:73, src/cluster_erp/modules/quotations/quotes/services.py:687-743). feasibility_failed teklifi yumuşak siler ve RfqDeclined yayar (src/cluster_erp/modules/quotations/quotes/services.py:744-774).
| Aksiyon | Etiket | Koşul | Uç | İzin | Kaynak |
|---|---|---|---|---|---|
start_feasibility |
Fizibiliteyi Başlat | status değeri draft |
POST /quotes/{id}/start-feasibility |
quote.start_feasibility |
src/cluster_erp/modules/quotations/quotes/metadata.py:103-113 |
mark_design_required |
Tasarım Gerekli | status değeri feasibility |
POST /quotes/{id}/mark-design-required |
quote.mark_design_required |
src/cluster_erp/modules/quotations/quotes/metadata.py:114-127 |
complete_feasibility |
Fizibiliteyi Tamamla | status değeri feasibility |
POST /quotes/{id}/complete-feasibility |
quote.complete_feasibility |
src/cluster_erp/modules/quotations/quotes/metadata.py:128-152 |
complete_design |
Tasarım Tamamlandı | status değeri design_required |
POST /quotes/{id}/complete-design |
quote.complete_design |
src/cluster_erp/modules/quotations/quotes/metadata.py:153-166 |
attach_bom |
BOM Ekle | status değeri bom_pending |
POST /quotes/{id}/attach-bom |
quote.attach_bom |
src/cluster_erp/modules/quotations/quotes/metadata.py:167-202 |
attach_costing |
Maliyet Ekle | status değeri costing |
POST /quotes/{id}/attach-costing |
quote.attach_costing |
src/cluster_erp/modules/quotations/quotes/metadata.py:203-249 |
schedule_mgmt_approval |
Onay Toplantısı Planla | status değeri pending_mgmt_approval |
POST /quotes/{id}/schedule-mgmt-approval |
quote.schedule_mgmt_approval |
src/cluster_erp/modules/quotations/quotes/metadata.py:250-285 |
record_decision |
Karar Kaydet | bir onay satırında | POST /quotes/{parent_id}/record-mgmt-decision |
mgmt_approval.record_decision |
src/cluster_erp/modules/quotations/quotes/metadata.py:790-819 |
send |
Müşteriye Gönder | status değeri pending_mgmt_approval |
POST /quotes/{id}/send |
quote.send |
src/cluster_erp/modules/quotations/quotes/metadata.py:286-307 |
mark_won, mark_lost, mark_expired |
Kazanıldı Olarak İşaretle, Kaybedildi Olarak İşaretle, Süresi Doldu Olarak İşaretle | status değeri sent |
POST /quotes/{id}/mark-won, /mark-lost, /mark-expired |
quote.mark_won, quote.mark_lost, quote.mark_expired |
src/cluster_erp/modules/quotations/quotes/metadata.py:308-338, src/cluster_erp/modules/quotations/quotes/metadata.py:394-407 |
revise |
Revize Et | status değeri pending_mgmt_approval, mgmt_rejected, expired veya lost |
POST /quotes/{id}/revise |
quote.revise |
src/cluster_erp/modules/quotations/quotes/metadata.py:339-354 |
feasibility_failed |
Fizibilite Olumsuz | status değeri feasibility |
POST /quotes/{id}/feasibility-failed |
quote.feasibility_failed |
src/cluster_erp/modules/quotations/quotes/metadata.py:357-379 |
return_to_bom |
Ürün Ağacına Geri Gönder | status değeri costing |
POST /quotes/{id}/return-to-bom |
quote.return_to_bom |
src/cluster_erp/modules/quotations/quotes/metadata.py:380-393 |
Uçlar ve izinler src/cluster_erp/modules/quotations/quotes/routes.py:156-366 içindedir.
İş kuralları¶
- Bir teklif,
GetRfqByIdile okunan mevcut bir teklif talebi ister; teklif talebi başına yalnızca bir etkin teklife izin verilir (src/cluster_erp/modules/quotations/quotes/services.py:175-190,src/cluster_erp/modules/quotations/quotes/services.py:1297-1317). - Para birimi ve ödeme koşulları verilmezse
GetCustomerByIdile müşteriden alınır (src/cluster_erp/modules/quotations/quotes/services.py:190-205). quote_no,quotationyıllık dizisinden gelir; sürümler teklif talebi başına sayılır (src/cluster_erp/modules/quotations/quotes/services.py:209,src/cluster_erp/modules/quotations/quotes/services.py:1318-1326).- Maliyet eklemek
GetCostingByIdokur; hiçbir kalem birim maliyet taşımıyorsa başlık maliyeti maliyetlendirmenin toplam maliyetine döner (src/cluster_erp/modules/quotations/quotes/services.py:399-466). - Toplama, toplam fiyatı kalem toplamlarının toplamı, toplam maliyeti miktar çarpı birim maliyetlerin toplamı, marjı da fiyat eksi maliyetin maliyete bölümü çarpı 100 yapar. Tutarlar
Currencybaşvuru tablosundaki para biriminin ondalık basamağınaROUND_HALF_EVENile yuvarlanır (src/cluster_erp/modules/quotations/rollup.py:35-117). - Bir yönetim kararı onay başına bir kez kaydedilebilir; fiyat düzeltmesi net değeri geçersiz kılar (
src/cluster_erp/modules/quotations/quotes/services.py:492-549). - Eksiksizlik günlüğünde karşılanmamış öğe varken gönderim engellenir: reddedilmemiş bir kalem, bir toplam fiyat, bir para birimi ve ödeme koşulları (
src/cluster_erp/modules/quotations/quotes/services.py:574-588,src/cluster_erp/modules/quotations/quotes/services.py:828-876). - Teklif gönderildikten sonra kalemler değişemez; ret nedeni mevcut ve etkin olmalıdır (
src/cluster_erp/modules/quotations/line_items/services.py:150-175,src/cluster_erp/modules/quotations/line_items/services.py:255-270). - Gönderilmiş teklif silinemez; silme
deleted_atalanını doldurur (src/cluster_erp/modules/quotations/quotes/services.py:273-287). - Satış siparişi başvuruları başvurulabilir tüm kalemleri karşıladığında
sentteklifwonolur veQuoteWonyayılır (src/cluster_erp/modules/quotations/quotes/services.py:925-997).
Olaylar ve sorgular¶
Modül 6 sözleşme tüketir ve 18 sözleşme üretir; sayım parties modülü sayfasındaki gibi yapıldı. Tam liste sözleşmeler başvurusu sayfasındadır.
| Yön | Sözleşme sınıfı | İşleyici veya yayan | Kaynak |
|---|---|---|---|
| yayar | QuoteCreated, QuoteFeasibilityCompleted, QuoteBomAttached, QuoteCostingCompleted, QuoteMgmtApprovalRecorded, QuoteSent, QuoteWon, QuoteLost, QuoteExpired, RfqDeclined |
QuoteService yaşam döngüsü yöntemleri |
src/cluster_erp/modules/quotations/quotes/services.py:230, src/cluster_erp/modules/quotations/quotes/services.py:340, src/cluster_erp/modules/quotations/quotes/services.py:631, src/cluster_erp/modules/quotations/quotes/services.py:766, src/cluster_erp/modules/quotations/quotes/services.py:989 |
| sorgular | GetRfqById, GetCustomerById, GetCostingById, GetRfqIdsByCustomer |
servisler | src/cluster_erp/modules/quotations/quotes/services.py:178, src/cluster_erp/modules/quotations/quotes/services.py:414 |
| sorguyu yanıtlar | GetQuoteById, GetQuoteLineItems, ReferenceQuoteLines, ReleaseQuoteLineReferences |
module.py içindeki işleyiciler |
src/cluster_erp/modules/quotations/module.py:63-68 |
| abone olur | DescribeAnalyticsFacts, DescribeFieldConsumers |
analitik ve kiracı alanları | src/cluster_erp/modules/quotations/module.py:69-84 |
Yetkiler¶
| İzin anahtarı | Kullanan | Kaynak |
|---|---|---|
quote.read, .create, .update, .delete, .bulk_delete |
teklif kayıtları ve okuma uçları | src/cluster_erp/modules/quotations/quotes/routes.py:52-141, src/cluster_erp/modules/quotations/quotes/routes.py:384-439 |
her yaşam döngüsü ucu için bir anahtar, örneğin quote.send ve quote.revise |
yaşam döngüsü uçları | src/cluster_erp/modules/quotations/quotes/routes.py:156-366 |
mgmt_approval.read, mgmt_approval.record_decision |
onay uçları | src/cluster_erp/modules/quotations/quotes/routes.py:236, src/cluster_erp/modules/quotations/quotes/routes.py:267 |
quote_line_item.read, .create, .update, .delete, .bulk_delete |
kalem uçları | src/cluster_erp/modules/quotations/line_items/routes.py:24-142 |
Gizlilik, saklama ve geçmiş¶
Modülün privacy_handlers.py dosyası yoktur. Teklifler ve kalemler yumuşak silinir (src/cluster_erp/modules/quotations/quotes/services.py:273-287). GET /quotes/{quote_id}/history ucu teklifin değişiklik geçmişini okur (src/cluster_erp/modules/quotations/quotes/services.py:1094-1183); bkz. değişiklik geçmişi.
Analitik olguları¶
analytics_facts.py, quot_quotes üzerinde, currency alanında quote_count, total_price, total_cost ve median_price ölçülü ve quote.read ile okunan sales_quote olgu kümesini katar (src/cluster_erp/modules/quotations/analytics_facts.py:25-108). Bkz. analitik olguları.
Ayarlar ve başvuru verileri¶
Ret nedenleri quot_rejection_reasons içindeki başvuru verisidir ve GET /quotes/rejection-reasons ile listelenir (src/cluster_erp/modules/quotations/line_items/routes.py:24). Para biriminin ondalık basamağı çekirdek para birimi tablosundan gelir (src/cluster_erp/modules/quotations/rollup.py:35-45); bkz. para ve ondalık.
Testler¶
tests/ içinde modules.quotations için (sonuç yok) ve web-client/ içinde /quotations/ yolu ile dosya adlarına göre grep ile bulundu.
| Tür | Dosya | Kapsam |
|---|---|---|
| e2e | web-client/_e2e_quotations_app.mjs |
teklifler uygulaması |
| e2e | web-client/_e2e_quote_line_bom.mjs |
teklif kalemi, sipariş kalemi ve ürün ağacı zinciri |
| e2e | web-client/_e2e_order_shipment_chain.mjs |
tekliften siparişe ve sevkiyata |
| e2e | web-client/_e2e_project_otd.mjs, web-client/_e2e_mrp_pir_faz1.mjs |
talep bağlamı olarak teklifler |
Tutarsızlıklar¶
Tanıtılan terimler¶
| Terim | Kod tanımlayıcısı | Tanım | Türkçe terim | Kaynak |
|---|---|---|---|---|
| sales quote | Quote |
Bir müşteri teklif talebini yanıtlayan fiyatlı teklif. | Satış teklifi | src/cluster_erp/modules/quotations/quotes/models.py:37 |
| management approval | MgmtApproval |
Bir teklifi gönderime açan toplantı kaydı ve karar. | Yönetim onayı | src/cluster_erp/modules/quotations/quotes/models.py:171 |
| document flow | QuoteDocumentFlow |
Hangi satış siparişi kalemlerinin hangi teklif kalemlerine başvurduğunun kaydı. | Belge akışı | src/cluster_erp/modules/quotations/line_items/models.py:139 |
| completeness log | QuoteRequirement |
Bir teklif gönderilmeden önce geçmesi gereken denetimlerin listesi. | Eksiksizlik günlüğü | src/cluster_erp/modules/quotations/quotes/services.py:77-88 |
İlgili sayfalar¶
92f8051 numaralı commit ile 2026-11-13 tarihinde doğrulandı.