Skip to content

Commit

Permalink
New: Can define of we want to use VAT or not for subscriptions
Browse files Browse the repository at this point in the history
(foundation module).
New: Can define a default choice for choice "More action when
recording a subscription" (foundation module).
  • Loading branch information
eldy committed Mar 6, 2013
1 parent 0fc1706 commit baf6ccf
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 24 deletions.
9 changes: 6 additions & 3 deletions ChangeLog
Expand Up @@ -14,10 +14,13 @@ For users:
- New: Can expand/collapse menus, categories and users list.
- New: extra parameters are supported into ODT templates.
- New: total per vat rate are available as tags for ODT templates.
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices)
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices).
- New: Some part of interface use more CSS3 (ie: agenda)
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice

- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice.
- New: Can define of we want to use VAT or not for subscriptions (foundation module).
- New: Can define a default choice for choice "More action when recording
a subscription" (foundation module).

For developers:
- System of menu managers has been rewritten to reduce code to do same things.
- An external module can force its theme.
Expand Down
57 changes: 40 additions & 17 deletions htdocs/adherents/admin/adherent.php
Expand Up @@ -169,31 +169,54 @@
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print "</td></tr>\n";
print '</form>';
print '</form>';

// Insertion cotisations dans compte financier
// Insert subscription into bank account
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
if (! empty($conf->banque->enabled))
{
print '<td>';
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print '</td>';
}
else
print '<tr '.$bc[$var].'><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices=array('0'=>$langs->trans("None"));
if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
print '<td>';
print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print '</td>';
print "</tr>\n";
print '</form>';

// Use vat for invoice creation
if ($conf->facture->enabled)
{
print '<td align="right" colspan="2">';
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
print '</td>';
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
if (! empty($conf->banque->enabled))
{
print '<td>';
print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print '</td>';
}
else
{
print '<td align="right" colspan="2">';
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
print '</td>';
}
print "</tr>\n";
print '</form>';
}
print "</tr>\n";
print '</form>';

print '</table>';
print '<br>';

Expand Down
12 changes: 8 additions & 4 deletions htdocs/adherents/card_subscriptions.php
Expand Up @@ -362,7 +362,11 @@

// Add line to draft invoice
$idprodsubscription=0;
$vattouse=get_default_tva($mysoc, $customer, $idprodsubscription);
$vattouse=0;
if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry')
{
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
}
//print xx".$vattouse." - ".$mysoc." - ".$customer;exit;
$result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1);
if ($result <= 0)
Expand Down Expand Up @@ -756,9 +760,9 @@
}
else
{
if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
else if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled)) $bankdirect=1;
else if (empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
}

print "\n\n<!-- Form add subscription -->\n";
Expand Down
3 changes: 3 additions & 0 deletions htdocs/langs/en_US/members.lang
Expand Up @@ -157,6 +157,7 @@ NoThirdPartyAssociatedToMember=No third party associated to this member
ThirdPartyDolibarr=Dolibarr third party
MembersAndSubscriptions= Members and Suscriptions
MoreActions=Complementary action on recording
MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription
MoreActionBankDirect=Create a direct transaction record on account
MoreActionBankViaInvoice=Create an invoice and payment on account
MoreActionInvoiceOnly=Create an invoice with no payment
Expand Down Expand Up @@ -199,3 +200,5 @@ DOLIBARRFOUNDATION_PAYMENT_FORM=To make your subscription payment using a bank t
ByProperties=By characteristics
MembersStatisticsByProperties=Members statistics by characteristics
MembersByNature=Members by nature
VATToUseForSubscriptions=VAT rate to use for subscriptions
NoVatOnSubscription=No TVA for subscriptions
4 changes: 4 additions & 0 deletions htdocs/langs/fr_FR/members.lang
Expand Up @@ -162,6 +162,7 @@ NoThirdPartyAssociatedToMember=Pas de tiers associé à cet adhérent
ThirdPartyDolibarr=Tiers Dolibarr
MembersAndSubscriptions= Adhérents et Adhésions
MoreActions=Action complémentaire à l'enregistrement
MoreActionsOnSubscription=Action complémentaire proposée par défaut à l'enregistrement de l'adhésion
MoreActionBankDirect=Création transaction sur compte bancaire ou caisse directement
MoreActionBankViaInvoice=Création facture avec paiement sur compte bancaire ou caisse
MoreActionInvoiceOnly=Création facture sans paiement
Expand Down Expand Up @@ -204,3 +205,6 @@ DOLIBARRFOUNDATION_PAYMENT_FORM=Pour réaliser le paiement de votre cotisation p
ByProperties=Par caractéristiques
MembersStatisticsByProperties=Statistiques des adhérents par caractéristiques
MembersByNature=Adhérents par nature
VATToUseForSubscriptions=Taux de TVA pour les adhésions
NoVatOnSubscription=Pas de TVA sur les adhésions

0 comments on commit baf6ccf

Please sign in to comment.