This is my second post about complementary lines,
were i am facing an issue, when selling product it will accure that the selling price will be different from the default set price but i cannot lock the price as the next time it maybe the same price again as before.
so what i need it a last sold price in the sales card, preferred i would like to use the Complementery lines as this is very easy to use and the data is already in Dolibarr.
some images for example,
Product Name = Test product 1
Default sales price = 10,-
needs to be
When you go into the customer card the data is already there in related items.
by useing the filter on the procduct it’s possible to get the Product and Date
is anybody able to help on this older post?
would be very helpfull in doli to get the previeusly sold item in de same so we can adjust sales price if needed.
For any given customer such a system would have to:
For any invoice/order for this customer such a system would have to:
For any line for this invoice/order to this customer such a system would have to:
compare product default price with line sales price.
...
I do believe though that there is a module that allows you to have individual product prices pr. customer. Do you use that?
in the customer card it has the previous sold “total price” of that that line.
you are right about that. my mistake.
but is there a way to save this data in dolibarr?
as we do have a lot of items it would be nice to have a price history maybe as popup or as a field in the tabs.
i know there a module for this, but beside the price they ask its not really a working module
for exemple,
when i quote 1 pcs for 40 euro
the sales order sees it also as last entered price 40 euro. but when it has never been sold and the list price is 60 euro it should say 60 euro.
than if we decide to give a discount of 20 euro. it would be very fine to see the next time we have sold it for 40 euro and not set the sell price.
so it should be more of an information tab then a setup of prefixed prices.
okay, try replacing some of the characters with something else. Remember that newline is a character too, but I don’t know if it is that which is an issue.
Search in ~/htdocs/core/class/commonobject.class.php for
// If field is a computed field, value must become result of compute (regardless of whether a row exists
// in the element's extrafields table)
if (is_array($extrafields->attributes[$this->table_element]['label'])) {
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
//var_dump($conf->disable_compute);
if (empty($conf->disable_compute)) {
global $objectoffield; // We set a global variable to $objectoffield so
$objectoffield = $this; // we can use it inside computed formula
$this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');
if (preg_match('/[^0-9]+\.[^0-9]+/', $s)) { // We refuse . if not between 2 numbers
if ($returnvalue) {
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
return '';
}
}
// We block use of php exec or php file functions
$forbiddenphpstrings = array('$$');
to
if ($onlysimplestring != '3') {
if (preg_match('/[^0-9]+\.[^0-9]+/', $s)) { // We refuse . if not between 2 numbers
if ($returnvalue) {
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
return '';
}
}
}
// We block use of php exec or php file functions
$forbiddenphpstrings = array('$$');
The result is that the check is not executed on computed fields. Maybe there are security risks about dangerous code-injection or similar. I didn’t check for this in detail. So use of your own risk or wait for a potential fix in a upcoming version of dolibarr.