| @@ -138,8 +138,12 @@ | ||
| 138 | 138 | if (response.data.quote && response.data.quote.id) { |
| 139 | 139 | $('#quote-id').val(response.data.quote.id); |
| 140 | 140 | qId = response.data.quote.id; |
| 141 | 141 | } |
| 142 | + // Same as the invoice builder: a refresh must reopen this quote, not a blank form. | |
| 143 | + if (qId && String(qId) !== '0' && window.history && window.history.replaceState && !/[?&]id=/.test(window.location.search)) { | |
| 144 | + var eiUrl = new URL(window.location.href); eiUrl.searchParams.set('id', String(qId)); window.history.replaceState({}, '', eiUrl.toString()); | |
| 145 | + } | |
| 142 | 146 | if (qId && String(qId) !== '0') { |
| 143 | 147 | $saveBtn.html('<span class="inline-flex items-center gap-2"><svg class="h-4 w-4 text-gray-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" /></svg><span>' + eiBuilderI18n('update_quote', 'Update Quote') + '</span></span>'); |
| 144 | 148 | } |
| 145 | 149 | |