<?xml version="1.0" encoding="iso-8859-9" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Clomosy | Forum : FATURA OLUŞTUR / DÜZENLE  ILK GELEMESI LAZIM</title>
  <link>https://forum.clomosy.com.tr/</link>
  <description><![CDATA[XML içerik linki; Clomosy | Forum : Genel &#304;&#351;lemler : FATURA OLUŞTUR / DÜZENLE  ILK GELEMESI LAZIM]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 29 Jul 2026 17:32:15 +0000</pubDate>
  <lastBuildDate>Wed, 29 Jul 2026 15:04:48 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.07</generator>
  <ttl>30</ttl>
  <WebWizForums:feedURL>https://forum.clomosy.com.tr/RSS_post_feed.asp?TID=1639</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Clomosy | Forum]]></title>
   <url>https://forum.clomosy.com.tr/forum_images/logo.png</url>
   <link>https://forum.clomosy.com.tr/</link>
  </image>
  <item>
   <title><![CDATA[FATURA OLUŞTUR / DÜZENLE  ILK GELEMESI LAZIM : Merhaba Barhtez,&#304;lgili yerleri...]]></title>
   <link>https://forum.clomosy.com.tr/forum_posts.asp?TID=1639&amp;PID=3797#3797</link>
   <description>
    <![CDATA[<strong>Yazar:</strong> <a href="https://forum.clomosy.com.tr/member_profile.asp?PF=257">Emr.Erkmn</a><br /><strong>Konu:</strong> 1639<br /><strong>Gönderim Zamanı:</strong> 29&nbsp;Temmuz&nbsp;2026 Saat 15:04<br /><br />Merhaba Barhtez,&nbsp;<br><br>İlgili yerleri düzeltebilir misin&nbsp;<br><br><br><div>&nbsp; formInvoicePanel = SecretaryForm.AddNewProPanel(scrollBody, 'formInvoicePanel');</div><div>&nbsp; formInvoicePanel.Align = alTop;&nbsp;</div><div>&nbsp; formInvoicePanel.Height = 440;&nbsp;</div><div>&nbsp; formInvoicePanel.Margins.Bottom = 16;</div><div>&nbsp; clComponent.SetupComponent(formInvoicePanel, '{"BackgroundColor":"#0d1520", "RoundHeight":16, "RoundWidth":16, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; lblFormTitle = SecretaryForm.AddNewProLabel(formInvoicePanel, 'lblFormTitle', '&#128196; FATURA OLUŞTUR / DÜZENLE');</div><div>&nbsp; lblFormTitle.Align = alTop;&nbsp;</div><div>&nbsp; lblFormTitle.Height = 28;&nbsp;</div><div>&nbsp; lblFormTitle.Margins.Left = 14;</div><div>&nbsp; lblFormTitle.Margins.Top = 8;</div><div>&nbsp; lblFormTitle.clProSettings.FontSize = 11;&nbsp;</div><div>&nbsp; lblFormTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; lblFormTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblFormTitle.SetclProSettings(lblFormTitle.clProSettings);</div><div><br></div><div>&nbsp; btnSubmitInvoice = SecretaryForm.AddNewProButton(formInvoicePanel, 'btnSubmitInvoice', 'Faturayı Oluştur');</div><div>&nbsp; btnSubmitInvoice.Align = alTop;&nbsp;</div><div>&nbsp; btnSubmitInvoice.Height = 38;&nbsp;</div><div>&nbsp; btnSubmitInvoice.Margins.Left = 14;&nbsp;</div><div>&nbsp; btnSubmitInvoice.Margins.Right = 14;&nbsp;</div><div>&nbsp; btnSubmitInvoice.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(btnSubmitInvoice, '{"BackgroundColor":"#00d4ff18", "TextColor":"#ededed", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#00d4ff40", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSubmitInvoice, tbeOnClick, 'SubmitInvoice');</div><div><br></div><div>&nbsp; btnCancelEdit = SecretaryForm.AddNewProButton(formInvoicePanel, 'btnCancelEdit', 'Düzenlemeyi İptal Et');</div><div>&nbsp; btnCancelEdit.Align = alTop;&nbsp;</div><div>&nbsp; btnCancelEdit.Height = 30;&nbsp;</div><div>&nbsp; btnCancelEdit.Margins.Left = 14;&nbsp;</div><div>&nbsp; btnCancelEdit.Margins.Right = 14;&nbsp;</div><div>&nbsp; btnCancelEdit.Margins.Top = 4;</div><div>&nbsp; btnCancelEdit.Visible = False;</div><div>&nbsp; clComponent.SetupComponent(btnCancelEdit, '{"BackgroundColor":"#f8717118", "TextColor":"#ededed", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#f8717140", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnCancelEdit, tbeOnClick, 'CancelEdit');</div><div><br></div><div>&nbsp; rowClientInput = SecretaryForm.AddNewLayout(formInvoicePanel, 'rowClientInput');</div><div>&nbsp; rowClientInput.Align = alTop;&nbsp;</div><div>&nbsp; rowClientInput.Height = 38;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Left = 14;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Right = 14;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Top = 8;</div><div><br></div><div>&nbsp; btnSelectClientForm = SecretaryForm.AddNewProButton(rowClientInput, 'btnSelectClientForm', '&#128100; Müşteri Seç');</div><div>&nbsp; btnSelectClientForm.Align = alRight;&nbsp;</div><div>&nbsp; btnSelectClientForm.Width = 110;&nbsp;</div><div>&nbsp; btnSelectClientForm.Margins.Left = 6;</div><div>&nbsp; clComponent.SetupComponent(btnSelectClientForm, '{"BackgroundColor":"#00000000", "TextColor":"#00d4ff", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#00d4ff", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSelectClientForm, tbeOnClick, 'OpenSelectClientFormModal');</div><div><br></div><div>&nbsp; edtClient = SecretaryForm.AddNewProEdit(rowClientInput, 'edtClient', 'Müşteri adı...');</div><div>&nbsp; edtClient.Align = alClient;</div><div>&nbsp; clComponent.SetupComponent(edtClient, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtAddress = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtAddress', 'Teslimat adresi...');</div><div>&nbsp; edtAddress.Align = alTop;&nbsp;</div><div>&nbsp; edtAddress.Height = 38;&nbsp;</div><div>&nbsp; edtAddress.Margins.Left = 14;&nbsp;</div><div>&nbsp; edtAddress.Margins.Right = 14;&nbsp;</div><div>&nbsp; edtAddress.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtAddress, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtEmail = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtEmail', 'E-posta adresi...');</div><div>&nbsp; edtEmail.Align = alTop; edtEmail.Height = 38; edtEmail.Margins.Left = 14; edtEmail.Margins.Right = 14; edtEmail.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtEmail, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtPhone = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtPhone', 'Telefon numarası...');</div><div>&nbsp; edtPhone.Align = alTop; edtPhone.Height = 38; edtPhone.Margins.Left = 14; edtPhone.Margins.Right = 14; edtPhone.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtPhone, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtNotes = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtNotes', 'Notlar / Teslimat talimatları...');</div><div>&nbsp; edtNotes.Align = alTop; edtNotes.Height = 38; edtNotes.Margins.Left = 14; edtNotes.Margins.Right = 14; edtNotes.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtNotes, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; tempLayout = SecretaryForm.AddNewLayout(formInvoicePanel, 'rowQtyPrice');</div><div>&nbsp; tempLayout.Align = alTop; tempLayout.Height = 38; tempLayout.Margins.Left = 14; tempLayout.Margins.Right = 14; tempLayout.Margins.Top = 6;</div><div><br></div><div>&nbsp; edtProductId = SecretaryForm.AddNewProEdit(tempLayout, 'edtProductId', 'Ürün ID');</div><div>&nbsp; edtProductId.Align = alLeft; edtProductId.Width = 140;</div><div>&nbsp; clComponent.SetupComponent(edtProductId, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtQty = SecretaryForm.AddNewProEdit(tempLayout, 'edtQty', 'Miktar');</div><div>&nbsp; edtQty.Align = alRight; edtQty.Width = 150;</div><div>&nbsp; clComponent.SetupComponent(edtQty, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><a href="https://static.cloudflareinsights.com/beac&#111;n.min.js/v4513226cdae34746b4dedf0b4dfa099e1781791509496" target="_blank" rel="nofollow">https://static.cloudflareinsights.com/beacon.min.js/v4513226cdae34746b4dedf0b4dfa099e1781791509496"</a> integrity="sha512-ZE9pZaUXND66v380QUtch/5sE9tPFh2zg45pR2PB0CVkCtOREv2AJKkSidISWkysEuQ0EH8faUU5du78bx87UQ==" data-cf-beacon="{&quot;version&quot;:&quot;2024.11.0&quot;,&quot;token&quot;:&quot;439455f3e46c40b98dbd42a2f1a954d8&quot;,&quot;r&quot;:1}" crossorigin="anonymous">]]>
   </description>
   <pubDate>Wed, 29 Jul 2026 15:04:48 +0000</pubDate>
   <guid isPermaLink="true">https://forum.clomosy.com.tr/forum_posts.asp?TID=1639&amp;PID=3797#3797</guid>
  </item> 
  <item>
   <title><![CDATA[FATURA OLUŞTUR / DÜZENLE  ILK GELEMESI LAZIM : var SecretaryForm: TclForm; mainLayout,...]]></title>
   <link>https://forum.clomosy.com.tr/forum_posts.asp?TID=1639&amp;PID=3796#3796</link>
   <description>
    <![CDATA[<strong>Yazar:</strong> <a href="https://forum.clomosy.com.tr/member_profile.asp?PF=476">Barthe_dev</a><br /><strong>Konu:</strong> 1639<br /><strong>Gönderim Zamanı:</strong> 29&nbsp;Temmuz&nbsp;2026 Saat 14:55<br /><br /><div>var</div><div>&nbsp; SecretaryForm: TclForm;</div><div>&nbsp; mainLayout, headerLayout, switcherLayout: TclLayout;</div><div>&nbsp; scrollBody, pendingScrollBox, historyScrollBox, stockScrollBox: TclVertScrollBox;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Header</div><div>&nbsp; lblKicker, lblTitle: TclProLabel;</div><div>&nbsp; btnSwitchInvoice, btnSwitchStock: TclProButton;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Formulaire de saisie dynamique</div><div>&nbsp; formInvoicePanel: TclProPanel;</div><div>&nbsp; lblFormTitle: TclProLabel;</div><div>&nbsp; rowClientInput: TclLayout; // &#128161; Ligne horizontale pour Edt + Bouton</div><div>&nbsp; edtClient, edtEmail, edtPhone, edtAddress, edtNotes, edtQty, edtProductId: TclProEdit;</div><div>&nbsp; btnSubmitInvoice, btnCancelEdit, btnOpenAddClient, btnOpenEditClient, btnSelectClientForm: TclProButton;</div><div>&nbsp; editingInvoiceId: Integer;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Pop-up Modal "Müşteri Seç"</div><div>&nbsp; ModalSelectClientOverlay: TclLayout;</div><div>&nbsp; ModalSelectClientCard: TclProPanel;</div><div>&nbsp; ModalSelectClientTitle: TclProLabel;</div><div>&nbsp; CmbClientListModal: TclComboBox;</div><div>&nbsp; BtnModalConfirmSelectClient, BtnModalCancelSelectClient: TclProButton;</div><div>&nbsp; ModalSelectClientButtonsLayout: TclLayout;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Pop-up Modal Müşteri Ekle (Nouveau Client)</div><div>&nbsp; ModalClientOverlay: TclLayout;</div><div>&nbsp; ModalClientCard: TclProPanel;</div><div>&nbsp; ModalClientTitle: TclProLabel;</div><div>&nbsp; EdtClientNameModal, EdtClientEmailModal, EdtClientPhoneModal, EdtClientAddressModal: TclProEdit;</div><div>&nbsp; BtnModalSaveClient, BtnModalCancelClient: TclProButton;</div><div>&nbsp; ModalClientButtonsLayout: TclLayout;</div><div><br></div><div>&nbsp; // Pop-up Modal Müşteri Bilgisi Değiştir (Modifier Client)</div><div>&nbsp; ModalEditClientOverlay: TclLayout;</div><div>&nbsp; ModalEditClientCard: TclProPanel;</div><div>&nbsp; ModalEditClientTitle: TclProLabel;</div><div>&nbsp; CmbClientSelect: TclComboBox;</div><div>&nbsp; EdtEditClientEmailModal, EdtEditClientPhoneModal, EdtEditClientAddressModal: TclProEdit;</div><div>&nbsp; BtnModalSaveEditClient, BtnModalCancelEditClient: TclProButton;</div><div>&nbsp; ModalEditClientButtonsLayout: TclLayout;</div><div>&nbsp; clientsDataSet, formClientsDataSet: TclJsonQuery;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Sections</div><div>&nbsp; pendingPanel, historyPanel, stockPanel, tabBarPanel: TclProPanel;</div><div>&nbsp; stockHeaderLayout: TclLayout;</div><div>&nbsp; lblPendingTitle, lblHistoryTitle, lblStockTitle: TclProLabel;</div><div>&nbsp; edtSearchStock: TclProEdit;</div><div>&nbsp; btnTabInvoices, btnTabStockView, btnTabReports: TclProButton;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // Réseau &amp; Variables</div><div>&nbsp; Unitnavigate: TclUnit;</div><div>&nbsp; restApi: TclRest;</div><div>&nbsp; responseStr, pendingStr, historyStr, stockStr, uniqID, filterKeyword: String;&nbsp;</div><div>&nbsp; rootObj: TclJsonObject;</div><div>&nbsp; pendingArr, historyArr, stockArr: TclJsonQuery;</div><div>&nbsp; pCount, hCount, sCount, cardCounter: Integer;</div><div>&nbsp;&nbsp;</div><div>&nbsp; // UI composants temporaires</div><div>&nbsp; tempCard: TclProPanel;</div><div>&nbsp; tempLayout, tempActionsLayout: TclLayout;</div><div>&nbsp; tempLabel, tempLabel2: TclProLabel;</div><div>&nbsp; btnAddProd, btnActionVal, btnActionEdit, btnActionDel, btnSelectProd: TclProButton;</div><div><br></div><div>// ============================================================</div><div>// CHARGEMENT ET SÉLECTION DU CLIENT DEPUIS LE MODAL "MÜŞTERİ SEÇ"</div><div>// ============================================================</div><div>void OpenSelectClientFormModal;</div><div>var</div><div>&nbsp; clientsJson: String;</div><div>{</div><div>&nbsp; CmbClientListModal.Clear;</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/clients.php?acti&#111;n=get_clients" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/clients.php?action=get_clients</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmGET;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.ConnectTimeOut = 15000;</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; clientsJson = rootObj.GetValue('clients_json').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ((clientsJson &lt;&gt; '') &amp;&amp; (clientsJson &lt;&gt; '&#091;&#093;'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formClientsDataSet = Clomosy.ClDataSetFromJSON(clientsJson);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (formClientsDataSet &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formClientsDataSet.First;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (not formClientsDataSet.Eof)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmbClientListModal.AddItem(formClientsDataSet.FieldByName('client_name').AsString, formClientsDataSet.FieldByName('id').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formClientsDataSet.Next;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div><br></div><div>&nbsp; ModalSelectClientOverlay.Visible = True;</div><div>}</div><div><br></div><div>void CloseSelectClientFormModal;</div><div>{</div><div>&nbsp; ModalSelectClientOverlay.Visible = False;</div><div>}</div><div><br></div><div>void ConfirmSelectClientFromModal;</div><div>var</div><div>&nbsp; selectedName: String;</div><div>{</div><div>&nbsp; selectedName = CmbClientListModal.Text;</div><div>&nbsp; if ((selectedName &lt;&gt; '') &amp;&amp; (formClientsDataSet &lt;&gt; nil))&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; formClientsDataSet.First;</div><div>&nbsp; &nbsp; while (not formClientsDataSet.Eof)&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; if (formClientsDataSet.FieldByName('client_name').AsString == selectedName)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtClient.Text = formClientsDataSet.FieldByName('client_name').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtAddress.Text = formClientsDataSet.FieldByName('address').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtEmail.Text = formClientsDataSet.FieldByName('email').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtPhone.Text = formClientsDataSet.FieldByName('phone').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Break;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; formClientsDataSet.Next;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div><div>&nbsp; CloseSelectClientFormModal;</div><div>}</div><div><br></div><div>// ============================================================</div><div>// GESTION POPUP MODAL NOUVEAU CLIENT</div><div>// ============================================================</div><div>void OpenAddClientModal;</div><div>{</div><div>&nbsp; EdtClientNameModal.Text = '';</div><div>&nbsp; EdtClientEmailModal.Text = '';</div><div>&nbsp; EdtClientPhoneModal.Text = '';</div><div>&nbsp; EdtClientAddressModal.Text = '';</div><div>&nbsp; ModalClientOverlay.Visible = True;</div><div>}</div><div><br></div><div>void CloseAddClientModal;</div><div>{</div><div>&nbsp; ModalClientOverlay.Visible = False;</div><div>}</div><div><br></div><div>void SaveNewClient;</div><div>var</div><div>&nbsp; payloadJson, newName, newAddr: String;</div><div>{</div><div>&nbsp; newName = Trim(EdtClientNameModal.Text);</div><div>&nbsp; newAddr = Trim(EdtClientAddressModal.Text);</div><div><br></div><div>&nbsp; if (newName == '')&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; ShowMessage('&#9888;&#65039; Lütfen Müşteri Adını girin.');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; payloadJson = '{"client_name":"' + newName + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"email":"' + EdtClientEmailModal.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"phone":"' + EdtClientPhoneModal.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"address":"' + newAddr + '"}';</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/clients.php?acti&#111;n=add_client" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/clients.php?action=add_client</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody(payloadJson, 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#9989; ' + rootObj.GetValue('message').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtClient.Text = newName;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtAddress.Text = newAddr;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtEmail.Text = EdtClientEmailModal.Text;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtPhone.Text = EdtClientPhoneModal.Text;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; CloseAddClientModal;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('message')) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#10060; ' + rootObj.GetValue('message').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// GESTION POPUP MODAL MODIFICATION CLIENT</div><div>// ============================================================</div><div>void CloseEditClientModal;</div><div>{</div><div>&nbsp; ModalEditClientOverlay.Visible = False;</div><div>}</div><div><br></div><div>void OnClientSelectedFromCombo;</div><div>var</div><div>&nbsp; selectedName: String;</div><div>{</div><div>&nbsp; selectedName = CmbClientSelect.Text;</div><div>&nbsp; if ((selectedName == '') || (clientsDataSet == nil)) Exit;</div><div><br></div><div>&nbsp; clientsDataSet.First;</div><div>&nbsp; while (not clientsDataSet.Eof)&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; if (clientsDataSet.FieldByName('client_name').AsString == selectedName)&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; EdtEditClientEmailModal.Text = clientsDataSet.FieldByName('email').AsString;</div><div>&nbsp; &nbsp; &nbsp; EdtEditClientPhoneModal.Text = clientsDataSet.FieldByName('phone').AsString;</div><div>&nbsp; &nbsp; &nbsp; EdtEditClientAddressModal.Text = clientsDataSet.FieldByName('address').AsString;</div><div>&nbsp; &nbsp; &nbsp; Exit;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; clientsDataSet.Next;</div><div>&nbsp; }</div><div>}</div><div><br></div><div>void OpenEditClientModal;</div><div>var</div><div>&nbsp; clientsJson: String;</div><div>{</div><div>&nbsp; CmbClientSelect.Clear;</div><div>&nbsp; EdtEditClientEmailModal.Text = '';</div><div>&nbsp; EdtEditClientPhoneModal.Text = '';</div><div>&nbsp; EdtEditClientAddressModal.Text = '';</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/clients.php?acti&#111;n=get_clients" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/clients.php?action=get_clients</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmGET;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.ConnectTimeOut = 15000;</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; clientsJson = rootObj.GetValue('clients_json').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ((clientsJson &lt;&gt; '') &amp;&amp; (clientsJson &lt;&gt; '&#091;&#093;'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clientsDataSet = Clomosy.ClDataSetFromJSON(clientsJson);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (clientsDataSet &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clientsDataSet.First;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (not clientsDataSet.Eof)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CmbClientSelect.AddItem(clientsDataSet.FieldByName('client_name').AsString, clientsDataSet.FieldByName('id').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clientsDataSet.Next;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (CmbClientSelect.ItemIndex &gt;= 0)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnClientSelectedFromCombo;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div><br></div><div>&nbsp; ModalEditClientOverlay.Visible = True;</div><div>}</div><div><br></div><div>void SaveEditedClient;</div><div>var</div><div>&nbsp; payloadJson, selectedName: String;</div><div>{</div><div>&nbsp; selectedName = CmbClientSelect.Text;</div><div><br></div><div>&nbsp; if (selectedName == '')&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; ShowMessage('&#9888;&#65039; Lütfen bir müşteri seçin.');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; payloadJson = '{"client_name":"' + selectedName + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"email":"' + EdtEditClientEmailModal.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"phone":"' + EdtEditClientPhoneModal.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"address":"' + EdtEditClientAddressModal.Text + '"}';</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/clients.php?acti&#111;n=update_client" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/clients.php?action=update_client</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody(payloadJson, 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#9989; ' + rootObj.GetValue('message').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtClient.Text = selectedName;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtAddress.Text = EdtEditClientAddressModal.Text;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtEmail.Text = EdtEditClientEmailModal.Text;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtPhone.Text = EdtEditClientPhoneModal.Text;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; CloseEditClientModal;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('message')) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#10060; ' + rootObj.GetValue('message').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// CHARGEMENT ET FILTRAGE DU STOCK DYNAMIQUE</div><div>// ============================================================</div><div>void LoadStockData;</div><div>var</div><div>&nbsp; stQty: Integer;</div><div>&nbsp; prodName, prodIdStr: String;</div><div>{</div><div>&nbsp; stockArr = nil;</div><div>&nbsp; filterKeyword = UpperCase(Trim(edtSearchStock.Text));</div><div><br></div><div>&nbsp; if (stockScrollBox &lt;&gt; nil)&nbsp;</div><div>&nbsp; {&nbsp;</div><div>&nbsp; &nbsp; stockScrollBox.Free;&nbsp;</div><div>&nbsp; &nbsp; stockScrollBox = nil;&nbsp;</div><div>&nbsp; }</div><div>&nbsp; stockScrollBox = SecretaryForm.AddNewVertScrollBox(stockPanel, 'stockScrollBox');</div><div>&nbsp; stockScrollBox.Align = alClient;&nbsp;</div><div>&nbsp; stockScrollBox.Margins.Left = 8;&nbsp;</div><div>&nbsp; stockScrollBox.Margins.Right = 8;</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/stock.php?acti&#111;n=get_stock" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/stock.php?action=get_stock</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmGET;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.ConnectTimeOut = 15000;</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (rootObj.HasKey('stock_count'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sCount = StrToInt(rootObj.GetValue('stock_count').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (sCount &gt; 0)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stockStr = rootObj.GetValue('stock_json').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((stockStr &lt;&gt; '') &amp;&amp; (stockStr &lt;&gt; '&#091;&#093;'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stockArr = Clomosy.ClDataSetFromJSON(stockStr);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (stockArr &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stockArr.First;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cardCounter = 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (not stockArr.Eof)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prodName = stockArr.FieldByName('product_name').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prodIdStr = stockArr.FieldByName('id').AsString;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((filterKeyword == '') ||&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (Pos(filterKeyword, UpperCase(prodName)) &gt; 0) ||&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (Pos(filterKeyword, prodIdStr) &gt; 0))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cardCounter = cardCounter + 1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uniqID = prodIdStr + '_' + IntToStr(cardCounter);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard = SecretaryForm.AddNewProPanel(stockScrollBox, 'stCard_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Height = 65;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Margins.Bottom = 6;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(tempCard, '{"BackgroundColor":"#080d14", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout = SecretaryForm.AddNewLayout(tempCard, 'stTxt_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Align = alClient;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Margins.Left = 10;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Margins.Top = 6;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel = SecretaryForm.AddNewProLabel(tempLayout, 'stLblT_' + uniqID, 'ID #' + prodIdStr + ' · ' + prodName);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.FontSize = 11;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.FontColor = clAlphaColor.clHexToColor('#e2eaf5');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.SetclProSettings(tempLabel.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stQty = StrToIntDef(stockArr.FieldByName('stock_quantity').AsString, 0);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2 = SecretaryForm.AddNewProLabel(tempLayout, 'stLblS_' + uniqID, 'Fiyat : ' + stockArr.FieldByName('unit_price').AsString + ' DA&nbsp; |&nbsp; Stokta : ' + IntToStr(stQty) + ' adet');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontSize = 10;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (stQty &lt;= 20)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#f87171')</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#4ade80');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Margins.Top = 3;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.SetclProSettings(tempLabel2.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd = SecretaryForm.AddNewProButton(tempCard, 'btnSelP_' + uniqID, 'Seç');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Align = alRight;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Width = 90;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Margins.Right = 8;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Margins.Top = 14;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Margins.Bottom = 14;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSelectProd.Hint = prodIdStr;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(btnSelectProd, '{"BackgroundColor":"#00d4ff20", "TextColor":"#ede9e9", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#00d4ff50", "BorderWidth":1}');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecretaryForm.AddNewEvent(btnSelectProd, tbeOnClick, 'OnSelectProductFromStock');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stockArr.Next;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>void OnSearchStockChange;</div><div>{</div><div>&nbsp; LoadStockData;</div><div>}</div><div><br></div><div>// ============================================================</div><div>// BASCULE DE VUE DYNAMIQUE</div><div>// ============================================================</div><div>void ShowInvoiceSection;</div><div>{</div><div>&nbsp; formInvoicePanel.Visible = True;</div><div>&nbsp; pendingPanel.Visible = True;</div><div>&nbsp; historyPanel.Visible = True;</div><div>&nbsp; stockPanel.Visible = False;</div><div><br></div><div>&nbsp; clComponent.SetupComponent(btnSwitchInvoice, '{"BackgroundColor":"#0d1520", "TextColor":"#00d4ff", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#00d4ff40", "BorderWidth":1}');</div><div>&nbsp; clComponent.SetupComponent(btnSwitchStock, '{"BackgroundColor":"#080d14", "TextColor":"#4a6580", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; clComponent.SetupComponent(btnTabInvoices, '{"BackgroundColor":"#07101c", "TextColor":"#00d4ff", "RoundHeight":0, "RoundWidth":0}');</div><div>&nbsp; clComponent.SetupComponent(btnTabStockView, '{"BackgroundColor":"#07101c", "TextColor":"#4a6580", "RoundHeight":0, "RoundWidth":0}');</div><div>}</div><div><br></div><div>void ShowStockSection;</div><div>{</div><div>&nbsp; formInvoicePanel.Visible = False;</div><div>&nbsp; pendingPanel.Visible = False;</div><div>&nbsp; historyPanel.Visible = False;</div><div>&nbsp; stockPanel.Visible = True;</div><div><br></div><div>&nbsp; clComponent.SetupComponent(btnSwitchInvoice, '{"BackgroundColor":"#080d14", "TextColor":"#4a6580", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div>&nbsp; clComponent.SetupComponent(btnSwitchStock, '{"BackgroundColor":"#0d1520", "TextColor":"#00d4ff", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#00d4ff40", "BorderWidth":1}');</div><div><br></div><div>&nbsp; clComponent.SetupComponent(btnTabInvoices, '{"BackgroundColor":"#07101c", "TextColor":"#4a6580", "RoundHeight":0, "RoundWidth":0}');</div><div>&nbsp; clComponent.SetupComponent(btnTabStockView, '{"BackgroundColor":"#07101c", "TextColor":"#00d4ff", "RoundHeight":0, "RoundWidth":0}');</div><div><br></div><div>&nbsp; LoadStockData;</div><div>}</div><div><br></div><div>void OnSelectProductFromStock;</div><div>var</div><div>&nbsp; btnSender: TclProButton;</div><div>{</div><div>&nbsp; btnSender = TclProButton(SecretaryForm.ClSender);</div><div>&nbsp; edtProductId.Text = btnSender.Hint;</div><div>&nbsp; ShowInvoiceSection;</div><div>&nbsp; ShowMessage('&#128161; Ürün ID #' + btnSender.Hint + ' seçildi!');</div><div>}</div><div><br></div><div>void CancelEdit;</div><div>{</div><div>&nbsp; edtClient.Text = ''; edtAddress.Text = ''; edtEmail.Text = ''; edtPhone.Text = ''; edtNotes.Text = ''; edtQty.Text = ''; edtProductId.Text = '';</div><div>&nbsp; editingInvoiceId = 0;</div><div>&nbsp; btnSubmitInvoice.Caption = 'Faturayı Oluştur';</div><div>&nbsp; btnCancelEdit.Visible = False;</div><div>}</div><div><br></div><div>// ============================================================</div><div>// CHARGEMENT DES FACTURES</div><div>// ============================================================</div><div>void LoadInvoicesData;</div><div>var</div><div>&nbsp; prodSummary: String;</div><div>{</div><div>&nbsp; pendingArr = nil;&nbsp;</div><div>&nbsp; historyArr = nil;</div><div><br></div><div>&nbsp; if (pendingScrollBox &lt;&gt; nil)&nbsp;</div><div>&nbsp; {&nbsp;</div><div>&nbsp; &nbsp; pendingScrollBox.Free;&nbsp;</div><div>&nbsp; &nbsp; pendingScrollBox = nil;&nbsp;</div><div>&nbsp; }</div><div>&nbsp; pendingScrollBox = SecretaryForm.AddNewVertScrollBox(pendingPanel, 'pendingScrollBox');</div><div>&nbsp; pendingScrollBox.Align = alClient;&nbsp;</div><div>&nbsp; pendingScrollBox.Margins.Left = 8;&nbsp;</div><div>&nbsp; pendingScrollBox.Margins.Right = 8;</div><div><br></div><div>&nbsp; if (historyScrollBox &lt;&gt; nil)&nbsp;</div><div>&nbsp; {&nbsp;</div><div>&nbsp; &nbsp; historyScrollBox.Free;&nbsp;</div><div>&nbsp; &nbsp; historyScrollBox = nil;&nbsp;</div><div>&nbsp; }</div><div>&nbsp; historyScrollBox = SecretaryForm.AddNewVertScrollBox(historyPanel, 'historyScrollBox');</div><div>&nbsp; historyScrollBox.Align = alClient;&nbsp;</div><div>&nbsp; historyScrollBox.Margins.Left = 8;&nbsp;</div><div>&nbsp; historyScrollBox.Margins.Right = 8;</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/invoices.php?acti&#111;n=get_invoices" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/invoices.php?action=get_invoices</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmGET;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.ConnectTimeOut = 15000;</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div><br></div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; cardCounter = 0;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; // 1. FACTURES EN ATTENTE</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (rootObj.HasKey('pending_count'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pCount = StrToInt(rootObj.GetValue('pending_count').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pCount &gt; 0)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pendingStr = rootObj.GetValue('pending_json').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((pendingStr &lt;&gt; '') &amp;&amp; (pendingStr &lt;&gt; '&#091;&#093;'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pendingArr = Clomosy.ClDataSetFromJSON(pendingStr);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pendingArr &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pendingArr.First;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (not pendingArr.Eof)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cardCounter = cardCounter + 1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uniqID = pendingArr.FieldByName('id').AsString + '_' + IntToStr(cardCounter);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard = SecretaryForm.AddNewProPanel(pendingScrollBox, 'pCard_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Height = 95;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Margins.Bottom = 8;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(tempCard, '{"BackgroundColor":"#080d14", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout = SecretaryForm.AddNewLayout(tempCard, 'pTxt_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Align = alClient;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Margins.Left = 10;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Margins.Top = 6;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel = SecretaryForm.AddNewProLabel(tempLayout, 'pLblT_' + uniqID, pendingArr.FieldByName('invoice_number').AsString + ' · ' + pendingArr.FieldByName('client_name').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.FontSize = 12;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.FontColor = clAlphaColor.clHexToColor('#e2eaf5');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.SetclProSettings(tempLabel.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pendingArr.FieldByName('products_summary') &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prodSummary = pendingArr.FieldByName('products_summary').AsString</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prodSummary = 'Ürün yok';</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2 = SecretaryForm.AddNewProLabel(tempLayout, 'pLblP_' + uniqID, '&#128230; ' + prodSummary);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontSize = 10;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#94a3b8');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Margins.Top = 3;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.SetclProSettings(tempLabel2.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2 = SecretaryForm.AddNewProLabel(tempLayout, 'pLblS_' + uniqID, 'Toplam Miktar: ' + pendingArr.FieldByName('total_qty').AsString + ' adet · Toplam: ' + pendingArr.FieldByName('total_amount').AsString + ' DA');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Align = alTop;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontSize = 10;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Margins.Top = 3;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.SetclProSettings(tempLabel2.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout = SecretaryForm.AddNewLayout(tempCard, 'pAct_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout.Align = alRight;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout.Width = 145;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout.Margins.Right = 10;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout.Margins.Top = 31;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempActionsLayout.Margins.Bottom = 32;&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnAddProd = SecretaryForm.AddNewProButton(tempActionsLayout, 'btnAddP_' + uniqID, '&#10133;');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnAddProd.Align = alLeft; btnAddProd.Width = 32;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnAddProd.Hint = pendingArr.FieldByName('id').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(btnAddProd, '{"BackgroundColor":"#eab30820", "TextColor":"#eab308", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#eab30850", "BorderWidth":1}');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecretaryForm.AddNewEvent(btnAddProd, tbeOnClick, 'OnAddItemToInvoice');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionEdit = SecretaryForm.AddNewProButton(tempActionsLayout, 'btnEdit_' + uniqID, '&#9999;&#65039;');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionEdit.Align = alLeft; btnActionEdit.Width = 32; btnActionEdit.Margins.Left = 5;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionEdit.Hint = pendingArr.FieldByName('id').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(btnActionEdit, '{"BackgroundColor":"#00d4ff20", "TextColor":"#00d4ff", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#00d4ff50", "BorderWidth":1}');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecretaryForm.AddNewEvent(btnActionEdit, tbeOnClick, 'OnEditInvoice');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionDel = SecretaryForm.AddNewProButton(tempActionsLayout, 'btnDel_' + uniqID, '&#128465;&#65039;');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionDel.Align = alLeft; btnActionDel.Width = 32; btnActionDel.Margins.Left = 5;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionDel.Hint = pendingArr.FieldByName('id').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(btnActionDel, '{"BackgroundColor":"#f8717120", "TextColor":"#f87171", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#f8717150", "BorderWidth":1}');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecretaryForm.AddNewEvent(btnActionDel, tbeOnClick, 'OnCancelInvoice');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionVal = SecretaryForm.AddNewProButton(tempActionsLayout, 'btnVal_' + uniqID, '&#10004;&#65039;');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionVal.Align = alLeft; btnActionVal.Width = 32; btnActionVal.Margins.Left = 5;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnActionVal.Hint = pendingArr.FieldByName('id').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(btnActionVal, '{"BackgroundColor":"#22c55e20", "TextColor":"#22c55e", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#22c55e50", "BorderWidth":1}');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecretaryForm.AddNewEvent(btnActionVal, tbeOnClick, 'OnValidateInvoice');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pendingArr.Next;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; // 2. HISTORIQUE DU JOUR</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (rootObj.HasKey('history_count'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hCount = StrToInt(rootObj.GetValue('history_count').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hCount &gt; 0)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; historyStr = rootObj.GetValue('history_json').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((historyStr &lt;&gt; '') &amp;&amp; (historyStr &lt;&gt; '&#091;&#093;'))&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; historyArr = Clomosy.ClDataSetFromJSON(historyStr);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (historyArr &lt;&gt; nil)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; historyArr.First;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (not historyArr.Eof)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cardCounter = cardCounter + 1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uniqID = historyArr.FieldByName('id').AsString + '_' + IntToStr(cardCounter);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard = SecretaryForm.AddNewProPanel(historyScrollBox, 'hCard_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempCard.Align = alTop; tempCard.Height = 58; tempCard.Margins.Bottom = 6;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clComponent.SetupComponent(tempCard, '{"BackgroundColor":"#080d14", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout = SecretaryForm.AddNewLayout(tempCard, 'hTxt_' + uniqID);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLayout.Align = alClient; tempLayout.Margins.Left = 10; tempLayout.Margins.Top = 6;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel = SecretaryForm.AddNewProLabel(tempLayout, 'hLblT_' + uniqID, historyArr.FieldByName('invoice_number').AsString + ' · ' + historyArr.FieldByName('client_name').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.Align = alTop; tempLabel.clProSettings.FontSize = 11;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.clProSettings.FontColor = clAlphaColor.clHexToColor('#e2eaf5');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel.SetclProSettings(tempLabel.clProSettings);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2 = SecretaryForm.AddNewProLabel(tempLayout, 'hLblS_' + uniqID, historyArr.FieldByName('total_amount').AsString + ' DA · Durum: ' + historyArr.FieldByName('status').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Align = alTop; tempLabel2.clProSettings.FontSize = 9;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (historyArr.FieldByName('status').AsString == 'validee')&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#4ade80')</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.clProSettings.FontColor = clAlphaColor.clHexToColor('#f87171');</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tempLabel2.Margins.Top = 2; tempLabel2.SetclProSettings(tempLabel2.clProSettings);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; historyArr.Next;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// ÉDITION D'UNE FACTURE</div><div>// ============================================================</div><div>void OnEditInvoice;</div><div>var</div><div>&nbsp; btnSenderEdit: TclProButton;</div><div>&nbsp; invIdStr: String;</div><div>{</div><div>&nbsp; btnSenderEdit = TclProButton(SecretaryForm.ClSender);</div><div>&nbsp; invIdStr = btnSenderEdit.Hint;</div><div><br></div><div>&nbsp; if (pendingArr &lt;&gt; nil)&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; pendingArr.First;</div><div>&nbsp; &nbsp; while (not pendingArr.Eof)&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; if (pendingArr.FieldByName('id').AsString == invIdStr)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; editingInvoiceId = pendingArr.FieldByName('id').AsInteger;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtClient.Text = pendingArr.FieldByName('client_name').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; edtAddress.Text = pendingArr.FieldByName('delivery_address').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (pendingArr.FieldByName('invoice_notes') &lt;&gt; nil) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtNotes.Text = pendingArr.FieldByName('invoice_notes').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtNotes.Text = '';</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (pendingArr.FieldByName('first_product_id') &lt;&gt; nil) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtProductId.Text = pendingArr.FieldByName('first_product_id').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtProductId.Text = '';</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (pendingArr.FieldByName('first_qty') &lt;&gt; nil) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtQty.Text = pendingArr.FieldByName('first_qty').AsString;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; edtQty.Text = '';</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; btnSubmitInvoice.Caption = 'Faturayı Güncelle';</div><div>&nbsp; &nbsp; &nbsp; &nbsp; btnCancelEdit.Visible = True;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#128161; Fatura #' + invIdStr + ' yüklendi.');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; pendingArr.Next;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// CRÉER OU METTRE À JOUR UNE FACTURE</div><div>// ============================================================</div><div>void SubmitInvoice;</div><div>var</div><div>&nbsp; payloadJson, noteContactStr: String;</div><div>{</div><div>&nbsp; if (edtClient.Text == '')&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; ShowMessage('&#9888;&#65039; Lütfen en az Müşteri Adı alanını doldurun.');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; noteContactStr = Trim(edtNotes.Text);</div><div>&nbsp; if ((edtEmail.Text &lt;&gt; '') || (edtPhone.Text &lt;&gt; ''))&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; noteContactStr = noteContactStr + ' &#091;Tel: ' + edtPhone.Text + ' | E-posta: ' + edtEmail.Text + '&#093;';</div><div>&nbsp; }</div><div><br></div><div>&nbsp; payloadJson = '{"id":' + IntToStr(editingInvoiceId) + ',' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"client":"' + edtClient.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"address":"' + edtAddress.Text + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"notes":"' + noteContactStr + '",' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"product_id":' + IntToStr(StrToIntDef(edtProductId.Text, 0)) + ',' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"qty":' + IntToStr(StrToIntDef(edtQty.Text, 0)) + '}';</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/invoices.php?acti&#111;n=save_invoice" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/invoices.php?action=save_invoice</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody(payloadJson, 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div>&nbsp; &nbsp; ShowMessage('&#128236; Sunucu Yanıtı :' + #13#10 + responseStr);</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; CancelEdit;</div><div>&nbsp; &nbsp; LoadInvoicesData;</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// AJOUTER UN PRODUIT À UNE FACTURE</div><div>// ============================================================</div><div>void OnAddItemToInvoice;</div><div>var</div><div>&nbsp; btnSender: TclProButton;</div><div>&nbsp; invIdStr, payloadJson: String;</div><div>{</div><div>&nbsp; btnSender = TclProButton(SecretaryForm.ClSender);</div><div>&nbsp; invIdStr = btnSender.Hint;</div><div><br></div><div>&nbsp; if ((edtProductId.Text == '') || (edtQty.Text == ''))&nbsp;</div><div>&nbsp; {</div><div>&nbsp; &nbsp; ShowMessage('&#128161; Ürün ID ve Miktar bilgilerini girip ardından &#10133; butonuna tıklayın.');</div><div>&nbsp; &nbsp; Exit;</div><div>&nbsp; }</div><div><br></div><div>&nbsp; payloadJson = '{"invoice_id":' + invIdStr + ',' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"product_id":' + edtProductId.Text + ',' +</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'"qty":' + edtQty.Text + '}';</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/invoices.php?acti&#111;n=add_item" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/invoices.php?action=add_item</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody(payloadJson, 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div>&nbsp; &nbsp; ShowMessage('&#10133; ' + responseStr);</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; edtProductId.Text = ''; edtQty.Text = '';</div><div>&nbsp; &nbsp; LoadInvoicesData;</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>void OnValidateInvoice;</div><div>var</div><div>&nbsp; btnSenderVal: TclProButton;</div><div>&nbsp; invIdStr: String;</div><div>{</div><div>&nbsp; btnSenderVal = TclProButton(SecretaryForm.ClSender);</div><div>&nbsp; invIdStr = btnSenderVal.Hint;</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/invoices.php?acti&#111;n=validate_invoice" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/invoices.php?action=validate_invoice</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody('{"id":' + invIdStr + '}', 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; responseStr = restApi.Response;</div><div>&nbsp; &nbsp; if ((responseStr &lt;&gt; '') &amp;&amp; (Copy(responseStr, 1, 1) == '{'))&nbsp;</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; rootObj = TCLJSON.ParseToJSONObject(responseStr);</div><div>&nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('success') &amp;&amp; rootObj.GetValue('success').AsBoolean)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ShowMessage('&#9989; Fatura başarıyla onaylandı!');</div><div>&nbsp; &nbsp; &nbsp; &nbsp; LoadInvoicesData;</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if ((rootObj &lt;&gt; nil) &amp;&amp; rootObj.HasKey('message')) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowMessage(rootObj.GetValue('message').AsString);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>void OnCancelInvoice;</div><div>var</div><div>&nbsp; btnSenderCancel: TclProButton;</div><div>&nbsp; invIdStr: String;</div><div>{</div><div>&nbsp; btnSenderCancel = TclProButton(SecretaryForm.ClSender);</div><div>&nbsp; invIdStr = btnSenderCancel.Hint;</div><div><br></div><div>&nbsp; restApi = TclRest.Create;</div><div>&nbsp; try</div><div>&nbsp; &nbsp; restApi.BaseURL = '<a href="http://192.168.25.6/clomosyProject/Api/invoices.php?acti&#111;n=cancel_invoice" target="_blank" rel="nofollow">http://192.168.25.6/clomosyProject/Api/invoices.php?action=cancel_invoice</a>';</div><div>&nbsp; &nbsp; restApi.Method = rmPOST;</div><div>&nbsp; &nbsp; restApi.Accept = 'application/json';</div><div>&nbsp; &nbsp; restApi.AddBody('{"id":' + invIdStr + '}', 'application/json');</div><div>&nbsp; &nbsp; restApi.Execute;</div><div><br></div><div>&nbsp; &nbsp; LoadInvoicesData;</div><div>&nbsp; finally</div><div>&nbsp; }</div><div>}</div><div><br></div><div>// ============================================================</div><div>// INITIALISATION FORMULAIRE</div><div>// ============================================================</div><div>{</div><div>&nbsp; SecretaryForm = TclForm.Create(Self);</div><div>&nbsp; SecretaryForm.SetFormColor('#080d14', '#0d1520', clGVertical);</div><div><br></div><div>&nbsp; Unitnavigate = TclUnit.Create;</div><div>&nbsp; editingInvoiceId = 0;</div><div><br></div><div>&nbsp; if (not Clomosy.PlatformIsMobile) { SecretaryForm.clSetWindowState(fwsMaximized); }</div><div><br></div><div>&nbsp; // TAB BAR INFÉRIEURE</div><div>&nbsp; tabBarPanel = SecretaryForm.AddNewProPanel(SecretaryForm, 'tabBarPanel');</div><div>&nbsp; tabBarPanel.Align = alBottom; tabBarPanel.Height = 58;</div><div>&nbsp; clComponent.SetupComponent(tabBarPanel, '{"BackgroundColor":"#07101c", "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; btnTabInvoices = SecretaryForm.AddNewProButton(tabBarPanel, 'btnTabInvoices', 'Faturalar');</div><div>&nbsp; btnTabInvoices.Align = alLeft; btnTabInvoices.Width = 120;</div><div>&nbsp; clComponent.SetupComponent(btnTabInvoices, '{"BackgroundColor":"#07101c", "TextColor":"#00d4ff", "RoundHeight":0, "RoundWidth":0}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnTabInvoices, tbeOnClick, 'ShowInvoiceSection');</div><div><br></div><div>&nbsp; btnTabStockView = SecretaryForm.AddNewProButton(tabBarPanel, 'btnTabStockView', 'Stok');</div><div>&nbsp; btnTabStockView.Align = alLeft; btnTabStockView.Width = 120;</div><div>&nbsp; clComponent.SetupComponent(btnTabStockView, '{"BackgroundColor":"#07101c", "TextColor":"#4a6580", "RoundHeight":0, "RoundWidth":0}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnTabStockView, tbeOnClick, 'ShowStockSection');</div><div><br></div><div>&nbsp; // LAYOUT PRINCIPAL</div><div>&nbsp; mainLayout = SecretaryForm.AddNewLayout(SecretaryForm, 'mainLayout');</div><div>&nbsp; mainLayout.Align = alClient;</div><div><br></div><div>&nbsp; // HEADER</div><div>&nbsp; headerLayout = SecretaryForm.AddNewLayout(mainLayout, 'headerLayout');</div><div>&nbsp; headerLayout.Align = alTop; headerLayout.Height = 60; headerLayout.Margins.Left = 16; headerLayout.Margins.Right = 16; headerLayout.Margins.Top = 10;</div><div><br></div><div>&nbsp; lblKicker = SecretaryForm.AddNewProLabel(headerLayout, 'lblKicker', 'SEKRETERLİK &amp; SİPARİŞ ALANI');</div><div>&nbsp; lblKicker.Align = alTop; lblKicker.Height = 14;</div><div>&nbsp; lblKicker.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; lblKicker.clProSettings.FontSize = 10;</div><div>&nbsp; lblKicker.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblKicker.SetclProSettings(lblKicker.clProSettings);</div><div><br></div><div>&nbsp; lblTitle = SecretaryForm.AddNewProLabel(headerLayout, 'lblTitle', 'Faturalandırma &amp; Siparişler');</div><div>&nbsp; lblTitle.Align = alTop; lblTitle.Height = 32;</div><div>&nbsp; lblTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#e2eaf5');</div><div>&nbsp; lblTitle.clProSettings.FontSize = 22;</div><div>&nbsp; lblTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblTitle.SetclProSettings(lblTitle.clProSettings);</div><div><br></div><div>&nbsp; // SWITCHER (BOUTONS DE NAVIGATION HAUT DÉESPACÉS ET ÉLARGIS)</div><div>&nbsp; switcherLayout = SecretaryForm.AddNewLayout(mainLayout, 'switcherLayout');</div><div>&nbsp; switcherLayout.Align = alTop; switcherLayout.Height = 40; switcherLayout.Margins.Left = 16; switcherLayout.Margins.Right = 16; switcherLayout.Margins.Bottom = 10;</div><div><br></div><div>&nbsp; // 1. Bouton "Fatura Oluştur" (à gauche)</div><div>&nbsp; btnSwitchInvoice = SecretaryForm.AddNewProButton(switcherLayout, 'btnSwitchInvoice', '&#128196; Fatura Oluştur');</div><div>&nbsp; btnSwitchInvoice.Align = alLeft; btnSwitchInvoice.Width = 115;</div><div>&nbsp; clComponent.SetupComponent(btnSwitchInvoice, '{"BackgroundColor":"#0d1520", "TextColor":"#00d4ff", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#00d4ff40", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSwitchInvoice, tbeOnClick, 'ShowInvoiceSection');</div><div><br></div><div>&nbsp; // 2. Bouton "Yeni Müşteri" (transparent, bordure verte)</div><div>&nbsp; btnOpenAddClient = SecretaryForm.AddNewProButton(switcherLayout, 'btnOpenAddClient', '&#128100; Yeni Müşteri');</div><div>&nbsp; btnOpenAddClient.Align = alLeft;&nbsp;</div><div>&nbsp; btnOpenAddClient.Width = 115;</div><div>&nbsp; btnOpenAddClient.Margins.Left = 8;&nbsp;</div><div>&nbsp; clComponent.SetupComponent(btnOpenAddClient, '{"BackgroundColor":"#00000000", "TextColor":"#22c55e", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#22c55e", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnOpenAddClient, tbeOnClick, 'OpenAddClientModal');</div><div><br></div><div>&nbsp; // 3. Bouton "Müşteri Güncelle" (transparent, bordure jaune)</div><div>&nbsp; btnOpenEditClient = SecretaryForm.AddNewProButton(switcherLayout, 'btnOpenEditClient', '&#9999;&#65039; Müşteri Güncelle');</div><div>&nbsp; btnOpenEditClient.Align = alLeft;&nbsp;</div><div>&nbsp; btnOpenEditClient.Width = 125;</div><div>&nbsp; btnOpenEditClient.Margins.Left = 8;</div><div>&nbsp; clComponent.SetupComponent(btnOpenEditClient, '{"BackgroundColor":"#00000000", "TextColor":"#eab308", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#eab308", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnOpenEditClient, tbeOnClick, 'OpenEditClientModal');</div><div><br></div><div>&nbsp; // 4. Bouton "Stoğu Kontrol Et" (à droite)</div><div>&nbsp; btnSwitchStock = SecretaryForm.AddNewProButton(switcherLayout, 'btnSwitchStock', '&#128230; Stoğu Kontrol');</div><div>&nbsp; btnSwitchStock.Align = alRight; btnSwitchStock.Width = 115;</div><div>&nbsp; clComponent.SetupComponent(btnSwitchStock, '{"BackgroundColor":"#080d14", "TextColor":"#4a6580", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSwitchStock, tbeOnClick, 'ShowStockSection');</div><div><br></div><div>&nbsp; scrollBody = SecretaryForm.AddNewVertScrollBox(mainLayout, 'scrollBody');</div><div>&nbsp; scrollBody.Align = alClient;&nbsp;</div><div>&nbsp; scrollBody.Margins.Left = 16;&nbsp;</div><div>&nbsp; scrollBody.Margins.Right = 16;</div><div><br></div><div>&nbsp; // FORMULAIRE DE SAISIE DE FACTURE</div><div>&nbsp; formInvoicePanel = SecretaryForm.AddNewProPanel(scrollBody, 'formInvoicePanel');</div><div>&nbsp; formInvoicePanel.Align = alTop;&nbsp;</div><div>&nbsp; formInvoicePanel.Height = 440;&nbsp;</div><div>&nbsp; formInvoicePanel.Margins.Bottom = 16;</div><div>&nbsp; clComponent.SetupComponent(formInvoicePanel, '{"BackgroundColor":"#0d1520", "RoundHeight":16, "RoundWidth":16, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; // 1. &#128161; CRÉATION ET ALIGNEMENT DU TITRE EN PREMIER EN HAUT DU PANNEAU</div><div>&nbsp; lblFormTitle = SecretaryForm.AddNewProLabel(formInvoicePanel, 'lblFormTitle', '&#128196; FATURA OLUŞTUR / DÜZENLE');</div><div>&nbsp; lblFormTitle.Align = alTop;&nbsp;</div><div>&nbsp; lblFormTitle.Height = 28;&nbsp;</div><div>&nbsp; lblFormTitle.Margins.Left = 14;</div><div>&nbsp; lblFormTitle.Margins.Top = 8;</div><div>&nbsp; lblFormTitle.clProSettings.FontSize = 11;&nbsp;</div><div>&nbsp; lblFormTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; lblFormTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblFormTitle.SetclProSettings(lblFormTitle.clProSettings);</div><div><br></div><div>&nbsp; // 2. &#128161; CONTENEUR HORIZONTAL POUR "MÜŞTERİ ADI" + BOUTON "MÜŞTERİ SEÇ" JUSTE EN DESSOUS DU TITRE</div><div>&nbsp; rowClientInput = SecretaryForm.AddNewLayout(formInvoicePanel, 'rowClientInput');</div><div>&nbsp; rowClientInput.Align = alTop;&nbsp;</div><div>&nbsp; rowClientInput.Height = 38;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Left = 14;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Right = 14;&nbsp;</div><div>&nbsp; rowClientInput.Margins.Top = 6;</div><div><br></div><div>&nbsp; // BOUTON "MÜŞTERİ SEÇ" ALIGNÉ À DROITE (Fond transparent, bordures cyan)</div><div>&nbsp; btnSelectClientForm = SecretaryForm.AddNewProButton(rowClientInput, 'btnSelectClientForm', '&#128100; Müşteri Seç');</div><div>&nbsp; btnSelectClientForm.Align = alRight;&nbsp;</div><div>&nbsp; btnSelectClientForm.Width = 110;&nbsp;</div><div>&nbsp; btnSelectClientForm.Margins.Left = 6;</div><div>&nbsp; clComponent.SetupComponent(btnSelectClientForm, '{"BackgroundColor":"#00000000", "TextColor":"#00d4ff", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#00d4ff", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSelectClientForm, tbeOnClick, 'OpenSelectClientFormModal');</div><div><br></div><div>&nbsp; // EDTCLIENT ALIGNÉ AU CENTRE/GAUCHE (Occupe tout l'espace restant)</div><div>&nbsp; edtClient = SecretaryForm.AddNewProEdit(rowClientInput, 'edtClient', 'Müşteri adı...');</div><div>&nbsp; edtClient.Align = alClient;</div><div>&nbsp; clComponent.SetupComponent(edtClient, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtAddress = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtAddress', 'Teslimat adresi...');</div><div>&nbsp; edtAddress.Align = alTop;&nbsp;</div><div>&nbsp; edtAddress.Height = 38;&nbsp;</div><div>&nbsp; edtAddress.Margins.Left = 14;&nbsp;</div><div>&nbsp; edtAddress.Margins.Right = 14;&nbsp;</div><div>&nbsp; edtAddress.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtAddress, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtEmail = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtEmail', 'E-posta adresi...');</div><div>&nbsp; edtEmail.Align = alTop; edtEmail.Height = 38; edtEmail.Margins.Left = 14; edtEmail.Margins.Right = 14; edtEmail.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtEmail, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtPhone = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtPhone', 'Telefon numarası...');</div><div>&nbsp; edtPhone.Align = alTop; edtPhone.Height = 38; edtPhone.Margins.Left = 14; edtPhone.Margins.Right = 14; edtPhone.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtPhone, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtNotes = SecretaryForm.AddNewProEdit(formInvoicePanel, 'edtNotes', 'Notlar / Teslimat talimatları...');</div><div>&nbsp; edtNotes.Align = alTop; edtNotes.Height = 38; edtNotes.Margins.Left = 14; edtNotes.Margins.Right = 14; edtNotes.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(edtNotes, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; tempLayout = SecretaryForm.AddNewLayout(formInvoicePanel, 'rowQtyPrice');</div><div>&nbsp; tempLayout.Align = alTop; tempLayout.Height = 38; tempLayout.Margins.Left = 14; tempLayout.Margins.Right = 14; tempLayout.Margins.Top = 6;</div><div><br></div><div>&nbsp; edtProductId = SecretaryForm.AddNewProEdit(tempLayout, 'edtProductId', 'Ürün ID');</div><div>&nbsp; edtProductId.Align = alLeft; edtProductId.Width = 140;</div><div>&nbsp; clComponent.SetupComponent(edtProductId, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; edtQty = SecretaryForm.AddNewProEdit(tempLayout, 'edtQty', 'Miktar');</div><div>&nbsp; edtQty.Align = alRight; edtQty.Width = 150;</div><div>&nbsp; clComponent.SetupComponent(edtQty, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div><br></div><div>&nbsp; btnSubmitInvoice = SecretaryForm.AddNewProButton(formInvoicePanel, 'btnSubmitInvoice', 'Faturayı Oluştur');</div><div>&nbsp; btnSubmitInvoice.Align = alTop; btnSubmitInvoice.Height = 40; btnSubmitInvoice.Margins.Left = 14; btnSubmitInvoice.Margins.Right = 14; btnSubmitInvoice.Margins.Top = 10;</div><div>&nbsp; clComponent.SetupComponent(btnSubmitInvoice, '{"BackgroundColor":"#00d4ff18", "TextColor":"#ededed", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#00d4ff40", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnSubmitInvoice, tbeOnClick, 'SubmitInvoice');</div><div><br></div><div>&nbsp; btnCancelEdit = SecretaryForm.AddNewProButton(formInvoicePanel, 'btnCancelEdit', 'Düzenlemeyi İptal Et');</div><div>&nbsp; btnCancelEdit.Align = alTop; btnCancelEdit.Height = 30; btnCancelEdit.Margins.Left = 14; btnCancelEdit.Margins.Right = 14; btnCancelEdit.Margins.Top = 6;</div><div>&nbsp; btnCancelEdit.Visible = False;</div><div>&nbsp; clComponent.SetupComponent(btnCancelEdit, '{"BackgroundColor":"#f8717118", "TextColor":"#ededed", "RoundHeight":10, "RoundWidth":10, "BorderColor":"#f8717140", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(btnCancelEdit, tbeOnClick, 'CancelEdit');</div><div><br></div><div>&nbsp; // FACTURES EN ATTENTE</div><div>&nbsp; pendingPanel = SecretaryForm.AddNewProPanel(scrollBody, 'pendingPanel');</div><div>&nbsp; pendingPanel.Align = alTop; pendingPanel.Height = 240; pendingPanel.Margins.Bottom = 14;</div><div>&nbsp; clComponent.SetupComponent(pendingPanel, '{"BackgroundColor":"#0d1520", "RoundHeight":16, "RoundWidth":16, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; lblPendingTitle = SecretaryForm.AddNewProLabel(pendingPanel, 'lblPendingTitle', '&#9203; BEKLEYEN MÜŞTERİ SİPARİŞLERİ');</div><div>&nbsp; lblPendingTitle.Align = alTop; lblPendingTitle.Height = 28; lblPendingTitle.Margins.Left = 14; lblPendingTitle.Margins.Top = 8;</div><div>&nbsp; lblPendingTitle.clProSettings.FontSize = 11; lblPendingTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#e2eaf5');</div><div>&nbsp; lblPendingTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblPendingTitle.SetclProSettings(lblPendingTitle.clProSettings);</div><div><br></div><div>&nbsp; pendingScrollBox = SecretaryForm.AddNewVertScrollBox(pendingPanel, 'pendingScrollBox');</div><div>&nbsp; pendingScrollBox.Align = alClient; pendingScrollBox.Margins.Left = 8; pendingScrollBox.Margins.Right = 8;</div><div><br></div><div>&nbsp; // HISTORIQUE DU JOUR</div><div>&nbsp; historyPanel = SecretaryForm.AddNewProPanel(scrollBody, 'historyPanel');</div><div>&nbsp; historyPanel.Align = alTop; historyPanel.Height = 220; historyPanel.Margins.Bottom = 16;</div><div>&nbsp; clComponent.SetupComponent(historyPanel, '{"BackgroundColor":"#0d1520", "RoundHeight":16, "RoundWidth":16, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; lblHistoryTitle = SecretaryForm.AddNewProLabel(historyPanel, 'lblHistoryTitle', '&#128203; BUGÜNÜN GEÇMİŞİ (ONAYLANAN VE İPTAL EDİLENLER)');</div><div>&nbsp; lblHistoryTitle.Align = alTop; lblHistoryTitle.Height = 28; lblHistoryTitle.Margins.Left = 14; lblHistoryTitle.Margins.Top = 8;</div><div>&nbsp; lblHistoryTitle.clProSettings.FontSize = 11; lblHistoryTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#4ade80');</div><div>&nbsp; lblHistoryTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblHistoryTitle.SetclProSettings(lblHistoryTitle.clProSettings);</div><div><br></div><div>&nbsp; historyScrollBox = SecretaryForm.AddNewVertScrollBox(historyPanel, 'historyScrollBox');</div><div>&nbsp; historyScrollBox.Align = alClient; historyScrollBox.Margins.Left = 8; historyScrollBox.Margins.Right = 8;</div><div><br></div><div>&nbsp; // SECTION STOCK DYNAMIQUE</div><div>&nbsp; stockPanel = SecretaryForm.AddNewProPanel(scrollBody, 'stockPanel');</div><div>&nbsp; stockPanel.Align = alTop; stockPanel.Height = 350; stockPanel.Visible = False;</div><div>&nbsp; clComponent.SetupComponent(stockPanel, '{"BackgroundColor":"#0d1520", "RoundHeight":16, "RoundWidth":16, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; stockHeaderLayout = SecretaryForm.AddNewLayout(stockPanel, 'stockHeaderLayout');</div><div>&nbsp; stockHeaderLayout.Align = alTop; stockHeaderLayout.Height = 38; stockHeaderLayout.Margins.Left = 14; stockHeaderLayout.Margins.Right = 14; stockHeaderLayout.Margins.Top = 8;</div><div><br></div><div>&nbsp; lblStockTitle = SecretaryForm.AddNewProLabel(stockHeaderLayout, 'lblStockTitle', '&#128230; STOK KONTROLÜ');</div><div>&nbsp; lblStockTitle.Align = alClient;</div><div>&nbsp; lblStockTitle.clProSettings.FontSize = 11; lblStockTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; lblStockTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; lblStockTitle.SetclProSettings(lblStockTitle.clProSettings);</div><div><br></div><div>&nbsp; edtSearchStock = SecretaryForm.AddNewProEdit(stockHeaderLayout, 'edtSearchStock', '&#128269; Ara (ID / İsim)...');</div><div>&nbsp; edtSearchStock.Align = alRight; edtSearchStock.Width = 170;</div><div>&nbsp; clComponent.SetupComponent(edtSearchStock, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#1e3552", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(edtSearchStock, tbeOnChange, 'OnSearchStockChange');</div><div><br></div><div>&nbsp; stockScrollBox = SecretaryForm.AddNewVertScrollBox(stockPanel, 'stockScrollBox');</div><div>&nbsp; stockScrollBox.Align = alClient; stockScrollBox.Margins.Left = 8; stockScrollBox.Margins.Right = 8; stockScrollBox.Margins.Top = 6;</div><div><br></div><div>&nbsp; // ============================================================</div><div>&nbsp; // POP-UP MODAL SELECTION CLIENT ("MÜŞTERİ SEÇ")</div><div>&nbsp; // ============================================================</div><div>&nbsp; ModalSelectClientOverlay = SecretaryForm.AddNewLayout(SecretaryForm, 'ModalSelectClientOverlay');</div><div>&nbsp; ModalSelectClientOverlay.Align = alClient;</div><div>&nbsp; ModalSelectClientOverlay.Visible = False;</div><div><br></div><div>&nbsp; ModalSelectClientCard = SecretaryForm.AddNewProPanel(ModalSelectClientOverlay, 'ModalSelectClientCard');</div><div>&nbsp; ModalSelectClientCard.Align = alCenter; ModalSelectClientCard.Width = 320; ModalSelectClientCard.Height = 160;</div><div>&nbsp; ModalSelectClientCard.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0d1520');</div><div>&nbsp; ModalSelectClientCard.clProSettings.BorderColor = clAlphaColor.clHexToColor('#00d4ff');</div><div>&nbsp; ModalSelectClientCard.clProSettings.BorderWidth = 1;&nbsp;</div><div>&nbsp; ModalSelectClientCard.clProSettings.RoundWidth = 16;&nbsp;</div><div>&nbsp; ModalSelectClientCard.clProSettings.RoundHeight = 16;</div><div>&nbsp; ModalSelectClientCard.SetclProSettings(ModalSelectClientCard.clProSettings);</div><div><br></div><div>&nbsp; ModalSelectClientTitle = SecretaryForm.AddNewProLabel(ModalSelectClientCard, 'ModalSelectClientTitle', '&#128100; Kayıtlı Müşteri Seçin');</div><div>&nbsp; ModalSelectClientTitle.Align = alTop; ModalSelectClientTitle.Height = 30; ModalSelectClientTitle.Margins.Left = 14; ModalSelectClientTitle.Margins.Top = 10;</div><div>&nbsp; ModalSelectClientTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#00d4ff');&nbsp;</div><div>&nbsp; ModalSelectClientTitle.clProSettings.FontSize = 12;&nbsp;</div><div>&nbsp; ModalSelectClientTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; ModalSelectClientTitle.SetclProSettings(ModalSelectClientTitle.clProSettings);</div><div><br></div><div>&nbsp; CmbClientListModal = SecretaryForm.AddNewComboBox(ModalSelectClientCard, 'CmbClientListModal');</div><div>&nbsp; CmbClientListModal.Align = alTop; CmbClientListModal.Height = 36; CmbClientListModal.Margins.Left = 14; CmbClientListModal.Margins.Right = 14; CmbClientListModal.Margins.Top = 8;</div><div><br></div><div>&nbsp; ModalSelectClientButtonsLayout = SecretaryForm.AddNewLayout(ModalSelectClientCard, 'ModalSelectClientButtonsLayout');</div><div>&nbsp; ModalSelectClientButtonsLayout.Align = alBottom; ModalSelectClientButtonsLayout.Height = 45; ModalSelectClientButtonsLayout.Margins.Left = 14; ModalSelectClientButtonsLayout.Margins.Right = 14; ModalSelectClientButtonsLayout.Margins.Bottom = 10;</div><div><br></div><div>&nbsp; BtnModalCancelSelectClient = SecretaryForm.AddNewProButton(ModalSelectClientButtonsLayout, 'BtnModalCancelSelectClient', 'İptal');</div><div>&nbsp; BtnModalCancelSelectClient.Align = alLeft; BtnModalCancelSelectClient.Width = 130; BtnModalCancelSelectClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalCancelSelectClient, '{"BackgroundColor":"#f8717120", "TextColor":"#eeeded", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#f87171", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalCancelSelectClient, tbeOnClick, 'CloseSelectClientFormModal');</div><div><br></div><div>&nbsp; BtnModalConfirmSelectClient = SecretaryForm.AddNewProButton(ModalSelectClientButtonsLayout, 'BtnModalConfirmSelectClient', 'Seç');</div><div>&nbsp; BtnModalConfirmSelectClient.Align = alRight; BtnModalConfirmSelectClient.Width = 130; BtnModalConfirmSelectClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalConfirmSelectClient, '{"BackgroundColor":"#00d4ff", "TextColor":"#080d14", "RoundHeight":8, "RoundWidth":8}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalConfirmSelectClient, tbeOnClick, 'ConfirmSelectClientFromModal');</div><div><br></div><div>&nbsp; // ============================================================</div><div>&nbsp; // POP-UP MODAL NOUVEAU CLIENT (YENİ MÜŞTERİ EKLE)</div><div>&nbsp; // ============================================================</div><div>&nbsp; ModalClientOverlay = SecretaryForm.AddNewLayout(SecretaryForm, 'ModalClientOverlay');</div><div>&nbsp; ModalClientOverlay.Align = alClient;</div><div>&nbsp; ModalClientOverlay.Visible = False;</div><div><br></div><div>&nbsp; ModalClientCard = SecretaryForm.AddNewProPanel(ModalClientOverlay, 'ModalClientCard');</div><div>&nbsp; ModalClientCard.Align = alCenter; ModalClientCard.Width = 320; ModalClientCard.Height = 320;</div><div>&nbsp; ModalClientCard.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0d1520');</div><div>&nbsp; ModalClientCard.clProSettings.BorderColor = clAlphaColor.clHexToColor('#22c55e');</div><div>&nbsp; ModalClientCard.clProSettings.BorderWidth = 1;&nbsp;</div><div>&nbsp; ModalClientCard.clProSettings.RoundWidth = 16;&nbsp;</div><div>&nbsp; ModalClientCard.clProSettings.RoundHeight = 16;</div><div>&nbsp; ModalClientCard.SetclProSettings(ModalClientCard.clProSettings);</div><div><br></div><div>&nbsp; ModalClientTitle = SecretaryForm.AddNewProLabel(ModalClientCard, 'ModalClientTitle', '&#128100; Yeni Müşteri Ekle');</div><div>&nbsp; ModalClientTitle.Align = alTop; ModalClientTitle.Height = 30; ModalClientTitle.Margins.Left = 14; ModalClientTitle.Margins.Top = 10;</div><div>&nbsp; ModalClientTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#22c55e');&nbsp;</div><div>&nbsp; ModalClientTitle.clProSettings.FontSize = 13;&nbsp;</div><div>&nbsp; ModalClientTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; ModalClientTitle.SetclProSettings(ModalClientTitle.clProSettings);</div><div><br></div><div>&nbsp; EdtClientNameModal = SecretaryForm.AddNewProEdit(ModalClientCard, 'EdtClientNameModal', 'Müşteri Adı Soyadı...');</div><div>&nbsp; EdtClientNameModal.Align = alTop; EdtClientNameModal.Height = 34; EdtClientNameModal.Margins.Left = 14; EdtClientNameModal.Margins.Right = 14; EdtClientNameModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtClientNameModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; EdtClientEmailModal = SecretaryForm.AddNewProEdit(ModalClientCard, 'EdtClientEmailModal', 'E-posta Adresi...');</div><div>&nbsp; EdtClientEmailModal.Align = alTop; EdtClientEmailModal.Height = 34; EdtClientEmailModal.Margins.Left = 14; EdtClientEmailModal.Margins.Right = 14; EdtClientEmailModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtClientEmailModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; EdtClientPhoneModal = SecretaryForm.AddNewProEdit(ModalClientCard, 'EdtClientPhoneModal', 'Telefon Numarası...');</div><div>&nbsp; EdtClientPhoneModal.Align = alTop; EdtClientPhoneModal.Height = 34; EdtClientPhoneModal.Margins.Left = 14; EdtClientPhoneModal.Margins.Right = 14; EdtClientPhoneModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtClientPhoneModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; EdtClientAddressModal = SecretaryForm.AddNewProEdit(ModalClientCard, 'EdtClientAddressModal', 'Teslimat / İkamet Adresi...');</div><div>&nbsp; EdtClientAddressModal.Align = alTop; EdtClientAddressModal.Height = 34; EdtClientAddressModal.Margins.Left = 14; EdtClientAddressModal.Margins.Right = 14; EdtClientAddressModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtClientAddressModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; ModalClientButtonsLayout = SecretaryForm.AddNewLayout(ModalClientCard, 'ModalClientButtonsLayout');</div><div>&nbsp; ModalClientButtonsLayout.Align = alBottom; ModalClientButtonsLayout.Height = 45; ModalClientButtonsLayout.Margins.Left = 14; ModalClientButtonsLayout.Margins.Right = 14; ModalClientButtonsLayout.Margins.Bottom = 10;</div><div><br></div><div>&nbsp; BtnModalCancelClient = SecretaryForm.AddNewProButton(ModalClientButtonsLayout, 'BtnModalCancelClient', 'İptal');</div><div>&nbsp; BtnModalCancelClient.Align = alLeft; BtnModalCancelClient.Width = 130; BtnModalCancelClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalCancelClient, '{"BackgroundColor":"#f8717120", "TextColor":"#eeeded", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#f87171", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalCancelClient, tbeOnClick, 'CloseAddClientModal');</div><div><br></div><div>&nbsp; BtnModalSaveClient = SecretaryForm.AddNewProButton(ModalClientButtonsLayout, 'BtnModalSaveClient', 'Kaydet');</div><div>&nbsp; BtnModalSaveClient.Align = alRight; BtnModalSaveClient.Width = 130; BtnModalSaveClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalSaveClient, '{"BackgroundColor":"#22c55e", "TextColor":"#ffffff", "RoundHeight":8, "RoundWidth":8}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalSaveClient, tbeOnClick, 'SaveNewClient');</div><div><br></div><div>&nbsp; // ============================================================</div><div>&nbsp; // POP-UP MODAL MODIFICATION CLIENT (MÜŞTERİ BİLGİSİ DEĞİŞTİR)</div><div>&nbsp; // ============================================================</div><div>&nbsp; ModalEditClientOverlay = SecretaryForm.AddNewLayout(SecretaryForm, 'ModalEditClientOverlay');</div><div>&nbsp; ModalEditClientOverlay.Align = alClient;</div><div>&nbsp; ModalEditClientOverlay.Visible = False;</div><div><br></div><div>&nbsp; ModalEditClientCard = SecretaryForm.AddNewProPanel(ModalEditClientOverlay, 'ModalEditClientCard');</div><div>&nbsp; ModalEditClientCard.Align = alCenter; ModalEditClientCard.Width = 330; ModalEditClientCard.Height = 330;</div><div>&nbsp; ModalEditClientCard.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0d1520');</div><div>&nbsp; ModalEditClientCard.clProSettings.BorderColor = clAlphaColor.clHexToColor('#eab308');</div><div>&nbsp; ModalEditClientCard.clProSettings.BorderWidth = 1;&nbsp;</div><div>&nbsp; ModalEditClientCard.clProSettings.RoundWidth = 16;&nbsp;</div><div>&nbsp; ModalEditClientCard.clProSettings.RoundHeight = 16;</div><div>&nbsp; ModalEditClientCard.SetclProSettings(ModalEditClientCard.clProSettings);</div><div><br></div><div>&nbsp; ModalEditClientTitle = SecretaryForm.AddNewProLabel(ModalEditClientCard, 'ModalEditClientTitle', '&#9999;&#65039; Müşteri Bilgisi Değiştir');</div><div>&nbsp; ModalEditClientTitle.Align = alTop; ModalEditClientTitle.Height = 30; ModalEditClientTitle.Margins.Left = 14; ModalEditClientTitle.Margins.Top = 10;</div><div>&nbsp; ModalEditClientTitle.clProSettings.FontColor = clAlphaColor.clHexToColor('#eab308');&nbsp;</div><div>&nbsp; ModalEditClientTitle.clProSettings.FontSize = 13;&nbsp;</div><div>&nbsp; ModalEditClientTitle.clProSettings.TextSettings.Font.Style = &#091;fsBold&#093;;</div><div>&nbsp; ModalEditClientTitle.SetclProSettings(ModalEditClientTitle.clProSettings);</div><div><br></div><div>&nbsp; CmbClientSelect = SecretaryForm.AddNewComboBox(ModalEditClientCard, 'CmbClientSelect');</div><div>&nbsp; CmbClientSelect.Align = alTop; CmbClientSelect.Height = 36; CmbClientSelect.Margins.Left = 14; CmbClientSelect.Margins.Right = 14; CmbClientSelect.Margins.Top = 6;</div><div>&nbsp; SecretaryForm.AddNewEvent(CmbClientSelect, tbeOnChange, 'OnClientSelectedFromCombo');</div><div><br></div><div>&nbsp; EdtEditClientEmailModal = SecretaryForm.AddNewProEdit(ModalEditClientCard, 'EdtEditClientEmailModal', 'Yeni E-posta Adresi...');</div><div>&nbsp; EdtEditClientEmailModal.Align = alTop; EdtEditClientEmailModal.Height = 34; EdtEditClientEmailModal.Margins.Left = 14; EdtEditClientEmailModal.Margins.Right = 14; EdtEditClientEmailModal.Margins.Top = 8;</div><div>&nbsp; clComponent.SetupComponent(EdtEditClientEmailModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; EdtEditClientPhoneModal = SecretaryForm.AddNewProEdit(ModalEditClientCard, 'EdtEditClientPhoneModal', 'Yeni Telefon Numarası...');</div><div>&nbsp; EdtEditClientPhoneModal.Align = alTop; EdtEditClientPhoneModal.Height = 34; EdtEditClientPhoneModal.Margins.Left = 14; EdtEditClientPhoneModal.Margins.Right = 14; EdtEditClientPhoneModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtEditClientPhoneModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; EdtEditClientAddressModal = SecretaryForm.AddNewProEdit(ModalEditClientCard, 'EdtEditClientAddressModal', 'Yeni Adres...');</div><div>&nbsp; EdtEditClientAddressModal.Align = alTop; EdtEditClientAddressModal.Height = 34; EdtEditClientAddressModal.Margins.Left = 14; EdtEditClientAddressModal.Margins.Right = 14; EdtEditClientAddressModal.Margins.Top = 6;</div><div>&nbsp; clComponent.SetupComponent(EdtEditClientAddressModal, '{"BackgroundColor":"#080d14", "TextColor":"#e2eaf5", "RoundHeight":6, "RoundWidth":6, "BorderColor":"#1a2d42", "BorderWidth":1}');</div><div><br></div><div>&nbsp; ModalEditClientButtonsLayout = SecretaryForm.AddNewLayout(ModalEditClientCard, 'ModalEditClientButtonsLayout');</div><div>&nbsp; ModalEditClientButtonsLayout.Align = alBottom; ModalEditClientButtonsLayout.Height = 45; ModalEditClientButtonsLayout.Margins.Left = 14; ModalEditClientButtonsLayout.Margins.Right = 14; ModalEditClientButtonsLayout.Margins.Bottom = 10;</div><div><br></div><div>&nbsp; BtnModalCancelEditClient = SecretaryForm.AddNewProButton(ModalEditClientButtonsLayout, 'BtnModalCancelEditClient', 'İptal');</div><div>&nbsp; BtnModalCancelEditClient.Align = alLeft; BtnModalCancelEditClient.Width = 130; BtnModalCancelEditClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalCancelEditClient, '{"BackgroundColor":"#f8717120", "TextColor":"#eeeded", "RoundHeight":8, "RoundWidth":8, "BorderColor":"#f87171", "BorderWidth":1}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalCancelEditClient, tbeOnClick, 'CloseEditClientModal');</div><div><br></div><div>&nbsp; BtnModalSaveEditClient = SecretaryForm.AddNewProButton(ModalEditClientButtonsLayout, 'BtnModalSaveEditClient', 'Kaydet');</div><div>&nbsp; BtnModalSaveEditClient.Align = alRight; BtnModalSaveEditClient.Width = 130; BtnModalSaveEditClient.Height = 35;</div><div>&nbsp; clComponent.SetupComponent(BtnModalSaveEditClient, '{"BackgroundColor":"#eab308", "TextColor":"#080d14", "RoundHeight":8, "RoundWidth":8}');</div><div>&nbsp; SecretaryForm.AddNewEvent(BtnModalSaveEditClient, tbeOnClick, 'SaveEditedClient');</div><div><br></div><div>&nbsp; // Initialisation et chargement des données</div><div>&nbsp; LoadInvoicesData;</div><div>&nbsp; SecretaryForm.Run;</div><div>}</div><a href="https://static.cloudflareinsights.com/beac&#111;n.min.js/v4513226cdae34746b4dedf0b4dfa099e1781791509496" target="_blank" rel="nofollow">https://static.cloudflareinsights.com/beacon.min.js/v4513226cdae34746b4dedf0b4dfa099e1781791509496"</a> integrity="sha512-ZE9pZaUXND66v380QUtch/5sE9tPFh2zg45pR2PB0CVkCtOREv2AJKkSidISWkysEuQ0EH8faUU5du78bx87UQ==" data-cf-beacon="{&quot;version&quot;:&quot;2024.11.0&quot;,&quot;token&quot;:&quot;439455f3e46c40b98dbd42a2f1a954d8&quot;,&quot;r&quot;:1}" crossorigin="anonymous">]]>
   </description>
   <pubDate>Wed, 29 Jul 2026 14:55:49 +0000</pubDate>
   <guid isPermaLink="true">https://forum.clomosy.com.tr/forum_posts.asp?TID=1639&amp;PID=3796#3796</guid>
  </item> 
 </channel>
</rss>