diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index b37b5348d5e..6db9751d144 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -20,7 +20,7 @@ * */ -/** +/** \file htdocs/compta/sociales/charges.php \ingroup compta \brief Fiche d'une charge sociale @@ -53,10 +53,10 @@ $chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; /* *************************************************************************** */ if ($_GET["action"] == 'payed') { - $cha = new ChargeSociales($db); - $result = $cha->set_payed($chid); + $cha = new ChargeSociales($db); + $result = $cha->set_payed($chid); } - + /* *************************************************************************** */ @@ -65,153 +65,154 @@ if ($_GET["action"] == 'payed') /* */ /* *************************************************************************** */ if ($chid > 0) - { - $html = new Form($db); +{ + $html = new Form($db); - $cha = new ChargeSociales($db); + $cha = new ChargeSociales($db); - if ( $cha->fetch($chid) > 0) - { - /* - * Charge - */ + if ($cha->fetch($chid) > 0) + { + /* + * Charge + */ - //$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; - $head[0][1] = $langs->trans("SocialContribution").": $cha->id"; - $h = 1; - $a = 0; + //$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id; + $head[0][1] = $langs->trans("SocialContribution").": $cha->id"; + $h = 1; + $a = 0; - dolibarr_fiche_head($head, $a); - - /* - * Confirmation de la suppression de la charge - * - */ - if ($_GET["action"] == 'delete') - { - $html->form_confirm("index.php?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete"); - } + dolibarr_fiche_head($head, $a); - print "
id&action=update\" method=\"post\">"; + /* + * Confirmation de la suppression de la charge + * + */ + if ($_GET["action"] == 'delete') + { + $html->form_confirm("index.php?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete"); + } - print ''; + print "id&action=update\" method=\"post\">"; - print ""; + print '
".$langs->trans("Type")."$cha->type_libelle".$langs->trans("Payments")."
'; - print ""; - print '"; + print ""; - print ""; + print ""; + print ''; - print '"; - print '"; - } - else { - print ''; - print ""; - print ''; - } + /* + * Paiements + */ + $sql = "SELECT ".$db->pdate("datep")." as dp, p.amount,"; + $sql .= "c.libelle as paiement_type, p.num_paiement, p.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p, ".MAIN_DB_PREFIX."c_paiement as c "; + $sql .= " WHERE p.fk_charge = ".$chid." AND p.fk_typepaiement = c.id"; + $sql .= " ORDER BY dp DESC"; + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; $total = 0; + echo '
".$langs->trans("Period")."".dolibarr_print_date($cha->periode,"%Y")."'; - - /* - * Paiements - */ - $sql = "SELECT ".$db->pdate("datep")." as dp, p.amount,"; - $sql .= "c.libelle as paiement_type, p.num_paiement, p.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p, ".MAIN_DB_PREFIX."c_paiement as c "; - $sql .= " WHERE p.fk_charge = ".$chid." AND p.fk_typepaiement = c.id"; - $sql .= " ORDER BY dp DESC"; - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; $total = 0; - echo ''; - print ''; - print ''; - print ''; - - $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $var=!$var; - print "\n"; - print "\n"; - print '\n"; - print ""; - $totalpaye += $objp->amount; - $i++; - } - - if ($fac->paye == 0) - { - print "\n"; - print "\n"; - - $resteapayer = $cha->amount - $totalpaye; - - print ""; - print "\n"; - } - print "
'.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
"; - print img_object($langs->trans("Payment"),"payment").' '; - print dolibarr_print_date($objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount)."".$langs->trans("Currency".$conf->monnaie)."
Total payé:".price($totalpaye)."".$langs->trans("Currency".$conf->monnaie)."
Réclamé :".price($cha->amount)."".$langs->trans("Currency".$conf->monnaie)."
".$langs->trans("RemainderToPay")." :".price($resteapayer)."".$langs->trans("Currency".$conf->monnaie)."
"; - $db->free(); - } else { - dolibarr_print_error($db); - } - print "
".$langs->trans("Type")."$cha->type_libelle".$langs->trans("Payments")."
".$langs->trans("Period")."".dolibarr_print_date($cha->periode,"%Y")."'; - if ($cha->paye==0) { - print '
'.$langs->trans("Label").'
'.$langs->trans("DateDue")."date_ech)."\">
'.$langs->trans("AmountTTC")."amount\">
'.$langs->trans("Label").''.$cha->lib.'
".$langs->trans("DateDue")."".dolibarr_print_date($cha->date_ech)."
'.$langs->trans("AmountTTC").''.price($cha->amount).'
'; + print ''; + print ''; + print ''; + + $var=True; + while ($i < $num) + { + $objp = $db->fetch_object($result); + $var=!$var; + print "\n"; + print "\n"; + print '\n"; + print ""; + $totalpaye += $objp->amount; + $i++; + } + + if ($fac->paye == 0) + { + print "\n"; + print "\n"; + + $resteapayer = $cha->amount - $totalpaye; + + print ""; + print "\n"; + } + print "
'.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
"; + print img_object($langs->trans("Payment"),"payment").' '; + print dolibarr_print_date($objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount)."".$langs->trans("Currency".$conf->monnaie)."
Total payé:".price($totalpaye)."".$langs->trans("Currency".$conf->monnaie)."
Réclamé :".price($cha->amount)."".$langs->trans("Currency".$conf->monnaie)."
".$langs->trans("RemainderToPay")." :".price($resteapayer)."".$langs->trans("Currency".$conf->monnaie)."
"; + $db->free(); + } + else + { + dolibarr_print_error($db); + } + print ""; + + print ""; + + if ($cha->paye==0) { + print ''.$langs->trans("Label").''; + print ''.$langs->trans("DateDue")."date_ech)."\">"; + print ''.$langs->trans("AmountTTC")."amount\">"; + } + else { + print ''.$langs->trans("Label").''.$cha->lib.''; + print "".$langs->trans("DateDue")."".dolibarr_print_date($cha->date_ech).""; + print ''.$langs->trans("AmountTTC").''.price($cha->amount).''; + } - print ''.$langs->trans("Status").''.$cha->getLibStatut().''; - print ''; - - - print "
\n"; + print ''.$langs->trans("Status").''.$cha->getLibStatut().''; + print ''; - print ''; - if (! $_GET["action"]) { + print "\n"; - /* - * Boutons actions - */ + print ''; - print "
\n"; + if (! $_GET["action"]) + { + /* + * Boutons actions + */ - // Supprimer - if ($cha->paye == 0 && $totalpaye <=0 && $user->rights->compta->charges) - { - print "id&action=delete\">".$langs->trans("Delete").""; - } + print "
\n"; - // Emettre paiement - if ($cha->paye == 0 && round($resteapayer) > 0 && $user->rights->compta->charges) - { - print "id&action=create\">".$langs->trans("DoPaiement").""; - } - - // Classer 'payé' - if ($cha->paye == 0 && round($resteapayer) <=0 && $user->rights->compta->charges) - { - print "id&action=payed\">".$langs->trans("ClassifyPayed").""; - } - - print "
"; - } + // Supprimer + if ($cha->paye == 0 && $totalpaye <=0 && $user->rights->tax->charges->supprimer) + { + print "id&action=delete\">".$langs->trans("Delete").""; + } - } - else - { - /* Charge non trouvée */ - print "Charge inexistante ou accés refusé"; - } + // Emettre paiement + if ($cha->paye == 0 && round($resteapayer) > 0 && $user->rights->tax->charges->creer) + { + print "id&action=create\">".$langs->trans("DoPaiement").""; + } + + // Classer 'payé' + if ($cha->paye == 0 && round($resteapayer) <=0 && $user->rights->tax->charges->creer) + { + print "id&action=payed\">".$langs->trans("ClassifyPayed").""; + } + + print "
"; + } + } + else + { + /* Charge non trouvée */ + print "Charge inexistante ou accés refusé"; + } } $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3ad754e1f62..5c192b58db6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -533,7 +533,7 @@ LDAPFieldMobileExample=Default attribute : mobile ProductSetup=Products module setup NumberOfProductShowInSelect=Max number of products in combos select lists (0=no limit) ConfirmDeleteProductLineAbility=Confirmation of removal of a line produces in the forms -ModifyProductDescAbility=Personalization of descriptions produced in the forms +ModifyProductDescAbility=Personalization of descriptions produced in the forms ViewProductDescInFormAbility=Visualization of descriptions produced in the forms ##### Syslog ##### SyslogSetup=Syslog module setup