* Ajout les liens (societe, company...) */ $links = $acct->get_url($objp->rowid); foreach ($links as $key => $val) { if ($links[$key]['type'] == 'payment') { $paymentstatic->fetch($links[$key]['url_id']); $tmparray = $paymentstatic->getBillsArray(''); foreach ($tmparray as $key => $val) { $invoicestatic->fetch($val); if ($accountelem) { $accountelem .= ', '; } $accountelem .= $invoicestatic->ref; } } elseif ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->fetch($links[$key]['url_id']); $tmparray = $paymentsupplierstatic->getBillsArray(''); foreach ($tmparray as $key => $val) { $invoicesupplierstatic->fetch($val); if ($accountelem) { $accountelem .= ', '; } $accountelem .= $invoicesupplierstatic->ref; } } elseif ($links[$key]['type'] == 'payment_sc') { $paymentsocialcontributionstatic->fetch($links[$key]['url_id']); if ($accountelem) { $accountelem .= ', '; } $accountelem .= $langs->transnoentitiesnoconv("SocialContribution") . ' ' . $paymentsocialcontributionstatic->ref; } elseif ($links[$key]['type'] == 'payment_vat') {
require DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; $langs->load('bills'); $langs->load('banks'); $langs->load('companies'); $langs->load("suppliers"); $mesg = ''; $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $object = new PaiementFourn($db); /* * Actions */ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer) { $db->begin(); $object->fetch($id); $result = $object->update_note(GETPOST('note')); if ($result > 0) { $db->commit(); $action = ''; } else { $mesg = '<div class="error">' . $object->error . '</div>'; $db->rollback(); } } if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisseur->facture->supprimer) { $db->begin(); $object->fetch($id); $result = $object->delete(); if ($result > 0) { $db->commit();
} elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); $object->date_echeance = dol_mktime(12, 0, 0, $_POST['date_lim_reglementmonth'], $_POST['date_lim_reglementday'], $_POST['date_lim_reglementyear']); if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance = $object->date; setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); } $result = $object->update($user); if ($result < 0) { dol_print_error($db, $object->error); } } elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->creer) { $object->fetch($id); if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0) { $paiementfourn = new PaiementFourn($db); $result = $paiementfourn->fetch(GETPOST('paiement_id')); if ($result > 0) { $result = $paiementfourn->delete(); } // If fetch ok and found if ($result < 0) { setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors'); } } } elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) { $error = 0; $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datedue = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); if (GETPOST('socid', 'int') < 1) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors'); $action = 'create';
* * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * \file htdocs/fourn/paiement/info.php * \ingroup facture * \brief Onglet info d'un paiement fournisseur */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; require DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php'; $langs->load("bills"); $langs->load("suppliers"); $langs->load("companies"); $paiement = new PaiementFourn($db); $paiement->fetch($_GET["id"], $user); $paiement->info($_GET["id"]); /* * View */ llxHeader(); $head = payment_supplier_prepare_head($paiement); dol_fiche_head($head, 'info', $langs->trans("SupplierPayment"), 0, 'payment'); print '<table width="100%"><tr><td>'; dol_print_object_info($paiement); print '</td></tr></table>'; print '</div>'; $db->close(); llxFooter();
$h=0; $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$_GET['id']; $head[$h][1] = $langs->trans('Card'); $hselected = $h; $h++; $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$_GET['id']; $head[$h][1] = $langs->trans('Info'); $h++; dol_fiche_head($head, $hselected, $langs->trans('SupplierPayment'), 0, 'payment'); $paiement = new PaiementFourn($db); $result=$paiement->fetch($_GET['id']); if ($result > 0) { /* * Confirmation de la suppression du paiement */ if ($_GET['action'] == 'delete') { $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); if ($ret == 'html') print '<br>'; } /* * Confirmation de la validation du paiement */
$facturefourn = new FactureFournisseur($db); $facturefourn->fetch($facid); $facturefourn->label=$_POST['label']; $result=$facturefourn->update($user); if ($result < 0) dol_print_error($db); $_GET['facid']=$facid; } if($_GET['action'] == 'deletepaiement') { $facfou = new FactureFournisseur($db); $facfou->fetch($_GET['facid']); if ($facfou->statut == 1 && $facfou->paye == 0 && $user->societe_id == 0) { $paiementfourn = new PaiementFourn($db); $paiementfourn->fetch($_GET['paiement_id']); $paiementfourn->delete(); } } if ($_POST['action'] == 'update' && ! $_POST['cancel']) { $error=0; $date = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $date_echeance = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); if (! $date) { $msg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEch")); $error++;