diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 53a1c2bc7f8..e123669342d 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -87,8 +87,8 @@ $arrayfields=array( 'c.dateadh'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100), 'c.datef'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101), 'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102), - 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), // 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000) ); @@ -367,13 +367,13 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation -if (! empty($arrayfields['d.datec']['checked'])) +if (! empty($arrayfields['c.datec']['checked'])) { print ''; print ''; } // Date modification -if (! empty($arrayfields['d.tms']['checked'])) +if (! empty($arrayfields['c.tms']['checked'])) { print ''; print ''; @@ -436,9 +436,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); -if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); +if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -553,7 +553,7 @@ while ($i < min($num, $limit)) $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation - if (! empty($arrayfields['d.datec']['checked'])) + if (! empty($arrayfields['c.datec']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); @@ -561,7 +561,7 @@ while ($i < min($num, $limit)) if (! $i) $totalarray['nbfield']++; } // Date modification - if (! empty($arrayfields['d.tms']['checked'])) + if (! empty($arrayfields['c.tms']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 37408d02057..f9b2003718a 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2008 Raphael Bertrand (Resultic) * * This program is free software; you can redistribute it and/or modify @@ -411,7 +411,7 @@ if ($socid > 0) print load_fiche_titre($langs->trans("CustomerDiscounts"), '', ''); } - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql.= " rc.datec as dc, rc.description,"; $sql.= " rc.fk_facture_source,"; $sql.= " u.login, u.rowid as user_id,"; @@ -433,11 +433,19 @@ if ($socid > 0) print ''; print ''.$langs->trans("Date").''; // Need 120+ for format with AM/PM print ''.$langs->trans("ReasonDiscount").''; - print ''.$langs->trans("ConsumedBy").''; - print ''.$langs->trans("AmountHT").''; - print ''.$langs->trans("VATRate").''; - print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("DiscountOfferedBy").''; + print ''.$langs->trans("ConsumedBy").''; + print ''.$langs->trans("AmountHT").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountHT").''; + } + print ''.$langs->trans("VATRate").''; + print ''.$langs->trans("AmountTTC").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountTTC").''; + } + print ''.$langs->trans("DiscountOfferedBy").''; print ' '; print ''; @@ -455,7 +463,7 @@ if ($socid > 0) print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').''; if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -464,7 +472,7 @@ if ($socid > 0) } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -473,7 +481,7 @@ if ($socid > 0) } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -482,14 +490,22 @@ if ($socid > 0) } else { - print ''; + print ''; print $obj->description; print ''; } print ''.$langs->trans("NotConsumed").''; print ''.price($obj->amount_ht).''; - print ''.price2num($obj->tva_tx, 'MU').'%'; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ht).''; + } + print ''.vatrate($obj->tva_tx, true).''; print ''.price($obj->amount_ttc).''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ttc).''; + } print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; @@ -497,7 +513,7 @@ if ($socid > 0) { print ''; print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).''; - print '   '; + //print '   '; print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; } @@ -550,7 +566,7 @@ if ($socid > 0) /* * Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture) */ - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql.= " rc.datec as dc, rc.description,"; $sql.= " rc.fk_invoice_supplier_source,"; $sql.= " u.login, u.rowid as user_id,"; @@ -572,11 +588,19 @@ if ($socid > 0) print ''; print ''.$langs->trans("Date").''; // Need 120+ for format with AM/PM print ''.$langs->trans("ReasonDiscount").''; - print ''.$langs->trans("ConsumedBy").''; - print ''.$langs->trans("AmountHT").''; - print ''.$langs->trans("VATRate").''; - print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("DiscountOfferedBy").''; + print ''.$langs->trans("ConsumedBy").''; + print ''.$langs->trans("AmountHT").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountHT").''; + } + print ''.$langs->trans("VATRate").''; + print ''.$langs->trans("AmountTTC").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountTTC").''; + } + print ''.$langs->trans("DiscountOfferedBy").''; print ' '; print ''; @@ -594,7 +618,7 @@ if ($socid > 0) print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').''; if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -603,7 +627,7 @@ if ($socid > 0) } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -612,7 +636,7 @@ if ($socid > 0) } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -621,22 +645,30 @@ if ($socid > 0) } else { - print ''; + print ''; print $obj->description; print ''; } print ''.$langs->trans("NotConsumed").''; print ''.price($obj->amount_ht).''; - print ''.price2num($obj->tva_tx, 'MU').'%'; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ht).''; + } + print ''.vatrate($obj->tva_tx, true).''; print ''.price($obj->amount_ttc).''; - print ''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ttc).''; + } + print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; if ($user->rights->societe->creer || $user->rights->facture->creer) { - print ''; + print ''; print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).''; - print '   '; + //print '   '; print 'rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ''; } @@ -700,7 +732,7 @@ if ($socid > 0) } // Remises liees a lignes de factures - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql.= " rc.fk_facture_source,"; $sql.= " u.login, u.rowid as user_id,"; @@ -745,11 +777,19 @@ if ($socid > 0) print ''; print ''.$langs->trans("Date").''; // Need 120+ for format with AM/PM print ''.$langs->trans("ReasonDiscount").''; - print ''.$langs->trans("ConsumedBy").''; - print ''.$langs->trans("AmountHT").''; - print ''.$langs->trans("VATRate").''; - print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("Author").''; + print ''.$langs->trans("ConsumedBy").''; + print ''.$langs->trans("AmountHT").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountHT").''; + } + print ''.$langs->trans("VATRate").''; + print ''.$langs->trans("AmountTTC").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountTTC").''; + } + print ''.$langs->trans("Author").''; print ' '; print ''; @@ -788,7 +828,7 @@ if ($socid > 0) print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').''; if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -797,7 +837,7 @@ if ($socid > 0) } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -806,7 +846,7 @@ if ($socid > 0) } elseif (preg_match('/\(EXCESS RECEIVED\)/', $obj->description)) { - print ''; + print ''; $facturestatic->id=$obj->fk_facture_source; $facturestatic->ref=$obj->ref; $facturestatic->type=$obj->type; @@ -815,15 +855,23 @@ if ($socid > 0) } else { - print ''; + print ''; print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->ref.''; print ''.price($obj->amount_ht).''; - print ''.price2num($obj->tva_tx, 'MU').'%'; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ht).''; + } + print ''.vatrate($obj->tva_tx, true).''; print ''.price($obj->amount_ttc).''; - print ''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ttc).''; + } + print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; print ' '; @@ -854,7 +902,7 @@ if ($socid > 0) } // Remises liees a lignes de factures - $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,"; + $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; $sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql.= " rc.fk_invoice_supplier_source,"; $sql.= " u.login, u.rowid as user_id,"; @@ -899,11 +947,19 @@ if ($socid > 0) print ''; print ''.$langs->trans("Date").''; // Need 120+ for format with AM/PM print ''.$langs->trans("ReasonDiscount").''; - print ''.$langs->trans("ConsumedBy").''; - print ''.$langs->trans("AmountHT").''; - print ''.$langs->trans("VATRate").''; - print ''.$langs->trans("AmountTTC").''; - print ''.$langs->trans("Author").''; + print ''.$langs->trans("ConsumedBy").''; + print ''.$langs->trans("AmountHT").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountHT").''; + } + print ''.$langs->trans("VATRate").''; + print ''.$langs->trans("AmountTTC").''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.$langs->trans("MulticurrencyAmountTTC").''; + } + print ''.$langs->trans("Author").''; print ' '; print ''; @@ -942,7 +998,7 @@ if ($socid > 0) print ''.dol_print_date($db->jdate($obj->dc), 'dayhour').''; if (preg_match('/\(CREDIT_NOTE\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -951,7 +1007,7 @@ if ($socid > 0) } elseif (preg_match('/\(DEPOSIT\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -960,7 +1016,7 @@ if ($socid > 0) } elseif (preg_match('/\(EXCESS PAID\)/', $obj->description)) { - print ''; + print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; $facturefournstatic->ref=$obj->ref; $facturefournstatic->type=$obj->type; @@ -969,14 +1025,22 @@ if ($socid > 0) } else { - print ''; + print ''; print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''.img_object($langs->trans("ShowBill"),'bill').' '.$obj->ref.''; print ''.price($obj->amount_ht).''; - print ''.price2num($obj->tva_tx, 'MU').'%'; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ht).''; + } + print ''.vatrate($obj->tva_tx, true).''; print ''.price($obj->amount_ttc).''; + if (! empty($conf->multicurrency->enabled)) + { + print ''.price($obj->multicurrency_amount_ttc).''; + } print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 80951464d7b..6b633f99309 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -696,6 +696,7 @@ if (empty($reshook)) $db->begin(); $amount_ht = $amount_tva = $amount_ttc = array(); + $multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array(); // Loop on each vat rate $i = 0; @@ -709,7 +710,7 @@ if (empty($reshook)) $multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht; $multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva; $multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc; - $i ++; + $i++; } } @@ -4671,6 +4672,13 @@ elseif ($id > 0 || ! empty($ref)) } } + // POS Ticket + if (! empty($conf->takepos->enabled) && $object->module_source != '') + { + $receipt_url=DOL_URL_ROOT."/takepos/receipt.php"; + print ''; + } + // Classify paid if ($object->statut == 1 && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)) || ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id)) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 887c1d9993e..f280e44ad95 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -253,11 +253,13 @@ if (empty($reshook)) $paiement->amounts = $amounts; // Array with all payments dispatching with invoice id $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->paiementid = dol_getIdFromCode($db, GETPOST('paiementcode'), 'c_paiement', 'code', 'id', 1); - $paiement->num_paiement = GETPOST('num_paiement'); - $paiement->note = GETPOST('comment'); + $paiement->num_paiement = GETPOST('num_paiement', 'alpha'); + $paiement->note = GETPOST('comment', 'alpha'); if (! $error) { + // Create payment and update this->multicurrency_amounts if this->amounts filled or + // this->amounts if this->multicurrency_amounts filled. $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0), $thirdparty); // This include closing invoices and regenerating documents if ($paiement_id < 0) { @@ -635,7 +637,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date print ''.dol_print_date($db->jdate($objp->df), 'day')."\n"; - // Date Max Payment + // Due date if ($objp->dlr > 0 ) { print ''; @@ -650,7 +652,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } else { - print '--'; + print ''; } // Currency @@ -673,12 +675,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''; - // Multicurrency Price + // Multicurrency remain to pay print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay); print ''; - print ''; + print ''; // Add remind multicurrency amount $namef = 'multicurrency_amount_'.$objp->facid; @@ -690,12 +692,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { if (!empty($conf->use_javascript_ajax)) print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'"); - print ''; - print ''; + print ''; + print ''; } else { - print ''; + print ''; print ''; } } @@ -716,7 +718,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie //$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits)); // Amount - print ''; + print ''; // Add remind amount $namef = 'amount_'.$objp->facid; @@ -726,12 +728,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { if (!empty($conf->use_javascript_ajax)) print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'"); + print ''; print ''; - print ''; } else { - print ''; + print ''; print ''; } print ""; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 71e7ef7194e..7307b3e1601 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -366,6 +366,7 @@ class Paiement extends CommonObject if ($invoice->type == Facture::TYPE_DEPOSIT) { $amount_ht = $amount_tva = $amount_ttc = array(); + $multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array(); // Insert one discount by VAT rate category $discount = new DiscountAbsolute($this->db); @@ -384,6 +385,9 @@ class Paiement extends CommonObject $amount_ht[$line->tva_tx] += $line->total_ht; $amount_tva[$line->tva_tx] += $line->total_tva; $amount_ttc[$line->tva_tx] += $line->total_ttc; + $multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht; + $multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva; + $multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc; $i++; } } @@ -392,6 +396,9 @@ class Paiement extends CommonObject $discount->amount_ht = abs($amount_ht[$tva_tx]); $discount->amount_tva = abs($amount_tva[$tva_tx]); $discount->amount_ttc = abs($amount_ttc[$tva_tx]); + $discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]); + $discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]); + $discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]); $discount->tva_tx = abs($tva_tx); $result = $discount->create($user); @@ -1110,7 +1117,7 @@ class Paiement extends CommonObject /** * get the right way of payment * - * @return string 'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs + * @return string 'dolibarr' if standard comportment or paid in main currency, 'customer' if payment received from multicurrency inputs */ function getWay() { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index eb44fac13ea..9615c040eb0 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -53,10 +53,13 @@ class DiscountAbsolute */ public $fk_soc; - public $discount_type; // 0 => customer discount, 1 => supplier discount - public $amount_ht; // + public $discount_type; // 0 => customer discount, 1 => supplier discount + public $amount_ht; // public $amount_tva; // public $amount_ttc; // + public $multicurrency_amount_ht; + public $multicurrency_amount_tva; + public $multicurrency_amount_ttc; public $tva_tx; // Vat rate /** diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 286c34bf61c..ecbd3b9c8c4 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -86,7 +86,7 @@ class modTakePos extends DolibarrModules 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl) 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode) 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) - 'hooks' => array('data'=>array('invoicecard'), 'entity'=>'0') // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all' + 'hooks' => array() // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all' ); // Data directories to create when module is enabled. diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 5027e976a4b..1229ace57ee 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4470,6 +4470,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/societe/class/api_contact.class.php', '/societe/class/api_thirdparty.class.php', '/support/online.php', + '/takepos/class/actions_takepos.class.php' ); foreach ($filetodeletearray as $filetodelete) { diff --git a/htdocs/modulebuilder/template/phpdoc.dist.xml b/htdocs/modulebuilder/template/phpdoc.dist.xml deleted file mode 100644 index 7f9b9761bd1..00000000000 --- a/htdocs/modulebuilder/template/phpdoc.dist.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - MyModule - - build/phpdoc - utf8 - - TODO - FIXME - - - php - css - js - - - - doc/code/phpdoc - - -