$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') { $paymentvatstatic->fetch($links[$key]['url_id']); if ($accountelem) { $accountelem .= ', '; } $accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref; } elseif ($links[$key]['type'] == 'banktransfert') { $comment = $outputlangs->transnoentitiesnoconv("Transfer"); if ($objp->amount > 0) { if ($comment) { $comment .= ' ';
} } Header('Location: fiche.php?id=' . $paiement->id); exit; } else { $mesg = '<div class="error">' . $paiement->error . '</div>'; $db->rollback(); } } /* * View */ llxHeader(); $socialcontrib = new ChargeSociales($db); $paiement = new PaymentSocialContribution($db); $result = $paiement->fetch($_GET['id']); if ($result <= 0) { dol_print_error($db, 'Payment ' . $_GET['id'] . ' not found in database'); exit; } $form = new Form($db); $h = 0; $head[$h][0] = DOL_URL_ROOT . '/compta/payment_sc/fiche.php?id=' . $_GET["id"]; $head[$h][1] = $langs->trans("Card"); $hselected = $h; $h++; /*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans("Info"); $h++; */ dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment');
/** * \brief Load an object from its id and create a new one in database * \param fromid Id of object to clone * \return int New id of clone */ function createFromClone($fromid) { global $user,$langs; $error=0; $object=new PaymentSocialContribution($this->db); $this->db->begin(); // Load source object $object->fetch($fromid); $object->id=0; $object->statut=0; // Clear fields // ... // Create clone $result=$object->create($user); // Other options if ($result < 0) { $this->error=$object->error; $error++; } if (! $error) { } // End if (! $error) { $this->db->commit(); return $object->id; } else { $this->db->rollback(); return -1; } }
} $langs->load('bills'); $langs->load('banks'); $langs->load('companies'); // Security check $id = GETPOST("id"); $action = GETPOST("action"); $confirm = GETPOST('confirm'); if ($user->societe_id) { $socid = $user->societe_id; } // TODO ajouter regle pour restreindre acces paiement //$result = restrictedArea($user, 'facture', $id,''); $paiement = new PaymentSocialContribution($db); if ($id > 0) { $result = $paiement->fetch($id); if (!$result) { dol_print_error($db, 'Failed to get payment id ' . $id); } } /* * Actions */ // Delete payment if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->charges->supprimer) { $db->begin(); $result = $paiement->delete($user); if ($result > 0) { $db->commit(); header("Location: " . DOL_URL_ROOT . "/compta/charges/index.php?mode=sconly"); exit;