feat: products and prices from the database, edited in the Kanban's Site tab (front 8.1)
Gestão and the administrators switch each product on and off and set its price from a start date; a price that has started is history and cannot change, a scheduled one can be cancelled. The Site and the server read the current price; with no row the code's prices and TREATMENT_CENTS still apply, so nothing changes until someone sets one. A switched-off product disappears from the Site and new quotes with it are refused. Approved quotes and paid orders keep their price. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -54,9 +54,12 @@ function pintaTipoEnvio(){
|
||||
$('tipoAvulsaPreco').textContent=rs(PRECO[avulsa])+' /m';
|
||||
$('larguraFolhaPronta').textContent=String(MODOS[folha].larg).replace('.',',');
|
||||
const atual = ehFolha() ? 'folha' : 'avulsa';
|
||||
// A product switched off in the Kanban cannot be chosen (front 8).
|
||||
const ligado=m=>!(window.dtfProducts&&window.dtfProducts[m]&&!window.dtfProducts[m].enabled);
|
||||
el.querySelectorAll('.cam').forEach(b=>{
|
||||
const alvo=b.dataset.tipo==='folha'?folha:avulsa;
|
||||
b.classList.toggle('on', b.dataset.tipo===atual);
|
||||
b.disabled=folhas.length>0 || artes.length>0; // já tem arquivo: a escolha está feita
|
||||
b.disabled=!ligado(alvo) || folhas.length>0 || artes.length>0; // já tem arquivo: a escolha está feita
|
||||
});
|
||||
}
|
||||
function avisoTipo(txt){
|
||||
|
||||
Reference in New Issue
Block a user