NEW Edit sales lines rights in TakePOS
This commit is contained in:
parent
70abc04bf5
commit
712e1c4e7c
@ -202,6 +202,20 @@ class modTakePos extends DolibarrModules
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'run';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 50152;
|
||||
$this->rights[$r][1] = 'Edit sales lines';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'editlines';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 50153;
|
||||
$this->rights[$r][1] = 'Edit ordered sales lines';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'editorderedlines';
|
||||
|
||||
|
||||
// Main menu entries
|
||||
|
||||
@ -964,6 +964,8 @@ Permission23003=Delete Scheduled job
|
||||
Permission23004=Execute Scheduled job
|
||||
Permission50101=Use Point of Sale (SimplePOS)
|
||||
Permission50151=Use Point of Sale (TakePOS)
|
||||
Permission50152=Edit sales lines
|
||||
Permission50153=Edit ordered sales lines
|
||||
Permission50201=Read transactions
|
||||
Permission50202=Import transactions
|
||||
Permission50330=Read objects of Zapier
|
||||
|
||||
@ -631,7 +631,8 @@ if ($action == "delete") {
|
||||
if ($action == "updateqty") {
|
||||
foreach ($invoice->lines as $line) {
|
||||
if ($line->id == $idline) {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $line->subprice, $number, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,7 +654,8 @@ if ($action == "updateprice") {
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($line->remise_percent) / 100) < price2num($price_min)))) {
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
} else {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $number, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'TTC', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -675,7 +677,8 @@ if ($action == "updatereduction") {
|
||||
if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($line->multicurrency_subprice) * (1 - price2num($number) / 100) < price2num($price_min)))) {
|
||||
echo $langs->trans("CantBeLessThanMinPrice");
|
||||
} else {
|
||||
$result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
if (!$user->rights->takepos->editlines || (!$user->rights->takepos->editorderedlines && $line->special_code == "4")) dol_htmloutput_errors($langs->trans("NotEnoughPermissions", "TakePos"), null, 1);
|
||||
else $result = $invoice->updateline($line->id, $line->desc, $line->multicurrency_subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user