Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts: htdocs/comm/propal/list.php htdocs/compta/facture/card.php
This commit is contained in:
commit
6ae1d192e4
@ -2594,9 +2594,14 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Close as accepted/refused
|
// Close as accepted/refused
|
||||||
if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) {
|
if ($object->statut == Propal::STATUS_VALIDATED) {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
if ($usercanclose) {
|
||||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
||||||
|
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
|
||||||
|
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
|
|||||||
@ -228,9 +228,6 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
|||||||
$permissiontoclose = $user->rights->propal->creer;
|
$permissiontoclose = $user->rights->propal->creer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -5393,7 +5393,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a credit note
|
// Create a credit note
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) {
|
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate) {
|
||||||
if (!$objectidnext) {
|
if (!$objectidnext) {
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&action=create&type=2'.($object->fk_project > 0 ? '&projectid='.$object->fk_project : '').($object->entity > 0 ? '&originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&fac_avoir='.$object->id.'&action=create&type=2'.($object->fk_project > 0 ? '&projectid='.$object->fk_project : '').($object->entity > 0 ? '&originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6254,10 +6254,12 @@ abstract class CommonObject
|
|||||||
$this->array_options["options_".$key] = price2num($this->array_options["options_".$key]);
|
$this->array_options["options_".$key] = price2num($this->array_options["options_".$key]);
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
$this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]);
|
|
||||||
break;
|
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
$this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]);
|
if (empty($this->array_options["options_".$key])) {
|
||||||
|
$this->array_options["options_".$key] = null;
|
||||||
|
} else {
|
||||||
|
$this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
case 'link':
|
case 'link':
|
||||||
@ -6305,7 +6307,11 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($linealreadyfound) {
|
if ($linealreadyfound) {
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'";
|
if ($this->array_options["options_".$key] === null) {
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null";
|
||||||
|
} else {
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'";
|
||||||
|
}
|
||||||
$sql .= " WHERE fk_object = ".$this->id;
|
$sql .= " WHERE fk_object = ".$this->id;
|
||||||
} else {
|
} else {
|
||||||
$result = $this->insertExtraFields('', $user);
|
$result = $this->insertExtraFields('', $user);
|
||||||
|
|||||||
@ -354,6 +354,15 @@ if ($outputalsopricetotalwithtax) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
||||||
|
|
||||||
|
$situationinvoicelinewithparent = 0;
|
||||||
|
if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) {
|
||||||
|
if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice
|
||||||
|
// Set constant to disallow editing during a situation cycle
|
||||||
|
$situationinvoicelinewithparent = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="linecoledit center">';
|
print '<td class="linecoledit center">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
||||||
@ -365,7 +374,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
|
|
||||||
print '<td class="linecoldelete center">';
|
print '<td class="linecoldelete center">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
|
if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company.
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id.'">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=ask_deleteline&lineid='.$line->id.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|||||||
@ -672,7 +672,7 @@ class Mo extends CommonObject
|
|||||||
if ($line->qty_frozen) {
|
if ($line->qty_frozen) {
|
||||||
$moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce
|
$moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce
|
||||||
} else {
|
} else {
|
||||||
$moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition
|
$moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition
|
||||||
}
|
}
|
||||||
if ($moline->qty <= 0) {
|
if ($moline->qty <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ if (!is_object($form)) {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency'];
|
$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 );
|
||||||
/*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) {
|
/*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) {
|
||||||
$qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom'];
|
$qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom'];
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user