Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-08-20 19:01:03 +02:00
commit 605642d96a
8 changed files with 26 additions and 8 deletions

View File

@ -540,7 +540,7 @@ print "</tr>";
// Show fields for topic, join files and body
$fieldsforcontent = array('topic', 'joinfiles', 'content');
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content', 'content_lines'); }
if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); }
foreach ($fieldsforcontent as $tmpfieldlist)
{
print '<tr class="impair nodrag nodrop nohover"><td colspan="6" class="nobottom">';

View File

@ -800,7 +800,7 @@ if ($resql)
}
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$parameters = array('arrayfields'=>$arrayfields, 'totalarray' => $totalarray, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@ -120,3 +120,4 @@ DefineTablePlan=Define tables plan
GiftReceiptButton=Add a "Gift receipt" button
GiftReceipt=Gift receipt
ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first
AllowDelayedPayment=Allow delayed payment

View File

@ -35,7 +35,8 @@ class Tasks extends DolibarrApi
*/
static $FIELDS = array(
'ref',
'label'
'label',
'fk_project'
);
/**

View File

@ -62,7 +62,7 @@ class Task extends CommonObject
/**
* @var int ID parent task
*/
public $fk_task_parent;
public $fk_task_parent = 0;
/**
* @var string Label of task
@ -145,6 +145,9 @@ class Task extends CommonObject
{
global $conf, $langs;
//For the date
$now = dol_now();
$error = 0;
// Clean parameters
@ -175,7 +178,7 @@ class Task extends CommonObject
$sql .= ", ".$this->fk_task_parent;
$sql .= ", '".$this->db->escape($this->label)."'";
$sql .= ", '".$this->db->escape($this->description)."'";
$sql .= ", '".$this->db->idate($this->date_c)."'";
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", ".$user->id;
$sql .= ", ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
$sql .= ", ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');

View File

@ -364,6 +364,13 @@ print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Delayed Pay Button
print '<tr class="oddeven"><td>';
print $langs->trans('AllowDelayedPayment');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_DELAYED_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Numbering module
//print '<tr class="oddeven"><td>';
//print $langs->trans("BillsNumberingModule");

View File

@ -156,7 +156,7 @@ if ($action == 'valid' && $user->rights->facture->creer)
}
}
if ($bankaccount <= 0) {
if ($bankaccount <= 0 && $pay != "delayed") {
$errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount"));
$error++;
}
@ -249,8 +249,10 @@ if ($action == 'valid' && $user->rights->facture->creer)
$payment->paiementid = $paiementid;
$payment->num_payment = $invoice->ref;
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
if ($pay != "delayed") {
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
}
$remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded
if ($remaintopay == 0) {

View File

@ -375,6 +375,10 @@ foreach ($action_buttons as $button) {
$newclass = $class.($button["class"] ? " ".$button["class"] : "");
print '<button type="button" class="'.$newclass.'" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
}
if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
print '<button type="button" class="calcbutton2" onclick="Validate(\'delayed\');">'.$langs->trans("Reported").'</button>';
}
?>
</div>