Typica is a free program for professional coffee roasters. https://typica.us
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

editfee.xml 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <window id="invoicefeedetail">
  2. <layout type="vertical">
  3. <layout type="grid">
  4. <row>
  5. <column><label>Description</label></column>
  6. <column><line id="description" /></column>
  7. </row>
  8. <row>
  9. <column><label>Cost</label></column>
  10. <column><line id="cost" validator="numeric"/></column>
  11. </row>
  12. </layout>
  13. <button name="submit" type="push" id="submit" />
  14. </layout>
  15. <program>
  16. <![CDATA[
  17. window = this;
  18. var invoiceID = 0;
  19. this.windowTitle = TTR("invoicefeedetail", "Typica - Fee Detail");
  20. var descField = findChildObject(this, 'description');
  21. var costField = findChildObject(this, 'cost');
  22. this.dataSet = function() {
  23. descField.text = window.rowData[2];
  24. costField.text = window.rowData[7];
  25. invoiceID = window.invoiceID;
  26. };
  27. button = findChildObject(this, 'submit');
  28. button.clicked.connect(function() {
  29. var query = new QSqlQuery();
  30. query.prepare("UPDATE invoice_items SET description = :name, cost = :cost WHERE invoice_id = :id AND record_type = 'FEE' AND description = :oldname AND cost = :oldcost");
  31. query.bind(":name", descField.text);
  32. query.bind(":cost", Number(costField.text));
  33. query.bind(":id", Number(invoiceID));
  34. query.bind(":oldname", window.rowData[2]);
  35. query.bind(":oldcost", window.rowData[7]);
  36. query.exec();
  37. query = query.invalidate();
  38. window.close();
  39. });
  40. ]]>
  41. </program>
  42. </window>