Teklif Hesaplama | SmartDiafon
SmartDiafon | Teklif Hesaplama
Bina bilgileri → model seç → otomatik adet + fiyat → teklif
v1.1
Fiyatlar dosyanın içindedir (DB yok). Güncellemek için bu dosyada ürün fiyatlarını değiştirmen yeter.
');
html.push('
Daire/kapı/blok sayısına göre otomatik adet hesaplanır.
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
html.push('
');
$("view").innerHTML = html.join("");
$("next").onclick = function(){
state.input.projectName = String($("projectName").value||"").trim() || "Yeni Proje";
state.input.buildingType = $("buildingType").value;
state.input.scope = $("scope").value;
state.input.apartments = num($("apartments").value);
state.input.blocks = num($("blocks").value);
state.input.doorCount = num($("doorCount").value);
state.input.vatRate = num($("vatRate").value);
state.step = 2; render();
};
}
function renderStep2(){
var i = state.input;
var html = [];
html.push('
2) Ürün Seçimi
');
html.push('
Burada sadece model seçiyorsun. Adetler otomatik hesaplanır.
');
// indoor options
var indoorSel = [];
for (var a=0;a
');
html.push('');
html.push('');
html.push(' ');
html.push('
');
html.push('
'
+ '
Otomatik öneri: '+esc(autoTxt)+'
'
+ (autoDb.warn ? '
'+esc(autoDb.warn)+'
' : '')
+ '
');
html.push('
');
html.push('
');
html.push('
');
html.push('
'
+ '
');
html.push('
Güvenlik ürünü: '+esc(CATALOG["MBMC111G"].name)+' — '+fmtTRY(CATALOG["MBMC111G"].price)+'
');
html.push('
');
html.push('
');
html.push('');
html.push('');
html.push('
');
$("view").innerHTML = html.join("");
$("securityEnabled").onchange = function(){
var en = $("securityEnabled").value === "1";
$("securityPoints").disabled = !en;
};
$("back").onclick = function(){ state.step = 1; render(); };
$("calc").onclick = function(){
state.input.indoorSku = $("indoorSku").value;
state.input.doorPanelSku = $("doorPanelSku").value;
state.input.diafonboxMode = $("diafonboxMode").value;
state.input.securityEnabled = $("securityEnabled").value === "1";
state.input.securityPoints = num($("securityPoints").value);
state.quote = calcQuote(state.input);
state.step = 3; render();
};
}
function buildSummary(input, quote){
var lines = [];
lines.push("SmartDiafon Teklif Özeti");
lines.push("Proje: " + input.projectName);
lines.push("Tip: " + input.buildingType + " | Daire: " + input.apartments + " | Blok: " + input.blocks + " | Kapı: " + input.doorCount + " | Hesap: " + input.scope);
lines.push("Güvenlik: " + (input.securityEnabled ? ("Evet ("+input.securityPoints+" nokta)") : "Hayır"));
lines.push("");
lines.push("Kalemler:");
for (var i=0;i
');
html.push('3) Teklif
');
html.push('
'+esc(i.projectName)+' '
+ ''+esc(i.buildingType)+' '
+ ''+esc(i.apartments)+' daire '
+ ''+esc(i.doorCount)+' kapı '
+ ''+esc(i.blocks)+' blok '
+ ''+esc(i.scope)+'
');
html.push('');
html.push('');
html.push('
');
html.push('');
if (q.warns && q.warns.length){
html.push('');
for (var w=0;w• '+esc(q.warns[w])+'
');
}
html.push('');
} else {
html.push('• Hesaplama tamam.
');
}
html.push('| Ürün | Adet | Birim | Tutar |
');
for (var k=0;k');
html.push(''+esc(it.name)+' '+esc(it.code)+' / '+esc(it.sku)+' | ');
html.push(''+esc(it.qty)+' | ');
html.push(''+fmtTRY(it.unitPrice)+' KDV: '+esc(it.vatRate)+'% | ');
html.push(''+fmtTRY(it.lineTotal)+' (KDV hariç) KDV: '+fmtTRY(it.lineVat)+' | ');
html.push('');
}
html.push('
');
html.push('Ara Toplam (KDV hariç): '+fmtTRY(q.totals.subTotal)+'
');
html.push('Toplam KDV: '+fmtTRY(q.totals.vat)+'
');
html.push('Genel Toplam (KDV dahil): '+fmtTRY(q.totals.grandTotal)+'
');
var summary = buildSummary(i, q);
html.push('Teklif özeti metni
');
html.push(' ');
$("view").innerHTML = html.join("");
$("back").onclick = function(){ state.step = 2; render(); };
$("copy").onclick = function(){
var txt = $("summary").value;
if (navigator.clipboard && navigator.clipboard.writeText){
navigator.clipboard.writeText(txt).then(function(){ alert("Teklif özeti panoya kopyalandı."); })
.catch(function(){ alert("Kopyalama desteklenmiyor. Metni manuel kopyalayın."); });
} else {
alert("Kopyalama desteklenmiyor. Metni manuel kopyalayın.");
}
};
$("wa").onclick = function(){
var txt = encodeURIComponent($("summary").value);
window.open("https://wa.me/?text=" + txt, "_blank");
};
}
function render(){
// step highlight
var btns = document.querySelectorAll(".step");
for (var i=0;i