How can I add a buttom ‘Order print’ in my sales table gridlist like ‘Paynow’ button in stock management project file.
and then change 3 decimals digits for all my currency value.
Thank’s
How can I add a buttom ‘Order print’ in my sales table gridlist like ‘Paynow’ button in stock management project file.
and then change 3 decimals digits for all my currency value.
Thank’s
You may try:
Something like: (for explanation only, assume v2020)
$(“your selector”).each(function() {
var val = $(this).html(); // Get the value as string
val = parseFloat(val); // Convert to float, you need to remove thousands separator and change the decimal separator to “.” (if it is not) so that they can be parsed to number
var newValue = ew.formatNumber(value, {thousandsSeparator: “,”, decimalSeparator: “.”, decimalPlaces: 3}); // Format the number to 3 decimal places
$(this).html(newValue); // Set the new value
});
I need to add a buttom ‘order print’ in row of my table a_sale of my project php_stock (PHPMAKER PROJECT), some one have an idea.*
and how I can related this buttom to my page orderprintphp
thank’s
See Help “Server Events and Client Scritps”
Example,
on : Table-Specific → List Page → ListOptions_Load, ADD:
function ListOptions_Load() {
// Example:
//$opt = &$this->ListOptions->Add(“new”);
//$opt->Header = “xxx”;
//$opt->OnLeft = TRUE; // Link on left
//$opt->MoveTo(0); // Move to first column
$item = &$this->ListOptions->add(“new”);
$item->Header = “MyCaption”; // Set the column header (for List page)
$item->OnLeft = TRUE; // Link on left
$item->moveTo(6); // Move the column to the specified index
}
on : Table-Specific → List Page → ListOptions_Rendered, ADD:
function ListOptions_Rendered() {
// Example:
//$this->ListOptions[“new”]->Body = “xxx”;
$this->ListOptions->Items[“new”]->Body = "<a href="#" onclick="return ew.submitAction(event, {action: ‘star’, method: ‘ajax’, msg: ‘Add star?’, key: " . $this->KeyToJson(TRUE) . “});">Add Star”;
}
for digit number, use jquery.number.a.js
and user this script:
jquery.number.a.js
ew.jQueryNumberOptions = {};
ew.createjQueryNumber = function(id, options) {
if (id.includes(“$rowindex$”))
return;
var $ = jQuery,
el = ew.getElement(id),
sv = ew.getElement(“sv_” + id),
$input = $(sv || el),
format = “”;
options = Object.assign({}, ew.jQueryNumberOptions, options);
var the_number = options.number;
var the_decimals = options.decimals;
var the_dec_point = options.dec_point;
var the_thousands_sep = options.thousands_sep;
var args = {“id”: id, “number”: true, “options”: options};
$(function() {
$input.number(true, the_decimals, the_dec_point, the_thousands_sep);
});
}
Terima kasih.
I put the code well in the place where you specified me, I had the following message :
( ! ) Warning: Creating default object from empty value in C:\wamp64\www\orders\classes\orders_list.php on line 1873
How i can solve this problem.
anyway I could put a button ‘Print Invoice’ but not in the place where I want to put it, I like who you help me to put it in the grid, and here is the code i tried :
$options = &$this->OtherOptions;
$option = $options[“action”];
$item = &$option->Add(“mybutton”);
//$item->Body = “<a class="ewAction" href="" onclick="YourJavaScritpFunction();return false;">Imprimer Facture”;
$item->Body = “<a class="ewAction" href="yourphpfile.php" >Imprimer Facture”;
This is what I want but simply is not in the place where I need putting it, Thank you