Skip to content

Commit 3e4ae3d

Browse files
committed
Better message for invoices on disputes
1 parent dc532cb commit 3e4ae3d

File tree

4 files changed

+37
-30
lines changed

4 files changed

+37
-30
lines changed

doc/Documentation SellYourSaas - Master and Deployment Servers - EN.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4827,7 +4827,7 @@ mkdir /mnt/myimg;
48274827
48284828
mount /dev/nbd0p1 /mnt/myimg
48294829
rm -rf /mnt/myimg/tmp/*
4830-
rm -f /mnt/myimg/var/log/*.gz /mnt/myimg/var/log/*.log /mnt/myimg/var/log/journal/*
4830+
rm -fr /mnt/myimg/var/log/*.gz /mnt/myimg/var/log/*.log /mnt/myimg/var/log/journal/*
48314831
umount /mnt/myimg
48324832
48334833
zerofree -v /dev/nbd0p1

langs/en_US/sellyoursaas.lang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ NewEmailToConfirm=New email to confirm
855855
UnitPriceOfLine=Unit price of line
856856
InvoicePaymentDisputed=Invoice payment disputed
857857
InvoicePaymentDisputedDesc=As soon as an invoice has been flagged to have a disputed payment, a message asking the customer to contact you is visible into its customer dashboard. Also, no other try to take payment will be done on the invoice as long as the invoice has this flag.
858-
InvoicePaymentDisputedMessage=The owner of the payment mode used to pay the invoice %s, created the %s, has an open dispute in bank to decline or cancel the payment. For this reason, your instance may have been suspended after the bank has contacted us, or may be suspended soon. Please contact us from the support menu to remove this alert and fix the situation.
858+
InvoicePaymentDisputedMessage=The owner of the payment mode used to pay this instances on this account has open a dispute in bank to decline or cancel the payment of the following invoice(s): %s. For this reason, your instance may have been suspended after the bank has contacted us, or may be suspended soon. Please contact us from the support menu to remove this alert and fix the situation.
859859
RuleForPassword=Password must contain at least %s characters, including UPPER/lowercase and numbers
860860
SepaSentToBank=SEPA direct debit sent to the bank
861861
SELLYOURSAAS_ENABLE_CUSTOMURL=Enable the "Custom URL" option

langs/fr_FR/sellyoursaas.lang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ NewEmailToConfirm=Nouvel e-mail pour confirmer
856856
UnitPriceOfLine=Prix unitaire de la ligne
857857
InvoicePaymentDisputed=Paiement de facture contesté
858858
InvoicePaymentDisputedDesc=Dès qu'une facture est signalée comme ayant un paiement contesté, un message demandant au client de vous contacter est visible dans son tableau de bord client. De plus, aucune autre tentative de paiement ne sera effectuée sur la facture tant que celle-ci porte ce marquage.
859-
InvoicePaymentDisputedMessage=Le propriétaire du mode de paiement utilisé pour régler la facture %s, créée le %s, a un litige ouvert en banque pour refuser ou annuler le paiement. Pour cette raison, votre instance a peut-être été suspendue après que la banque nous a contactés, ou pourrait être suspendue prochainement. Veuillez nous contacter depuis le menu d'assistance pour supprimer cette alerte et résoudre la situation.
859+
InvoicePaymentDisputedMessage=Le propriétaire du mode de paiement, utilisé pour régler les instances sur ce compte, a ouvert un litige bancaire pour refuser ou annuler le paiement de la ou des factures suivantes : %s. De ce fait, votre instance a peut-être été suspendue après que la banque nous a contactés, ou pourrait l'être prochainement. Veuillez nous contacter depuis le menu d'assistance pour supprimer cette alerte et corriger le problème.
860860
RuleForPassword=Le mot de passe doit contenir au moins %s caractères, y compris MAJUSCULES/minuscules et chiffres
861861
SepaSentToBank=Prélèvement SEPA envoyé à la banque
862862
SELLYOURSAAS_ENABLE_CUSTOMURL=Activez l'option "URL personnalisée"

myaccount/index.php

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3098,6 +3098,40 @@
30983098
// Show warnings
30993099

31003100
if (empty($welcomecid) && ! in_array($action, array('instanceverification', 'autoupgrade'))) {
3101+
// Show warnings on invoice dispute
3102+
$sql = 'SELECT f.rowid, f.ref, f.datef, f.datec, f.date_lim_reglement as date_due, f.dispute_status, fe.invoicepaymentdisputed';
3103+
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facture_extrafields as fe';
3104+
$sql .= ' WHERE fe.fk_object = f.rowid AND f.fk_soc = '.((int) $mythirdpartyaccount->id);
3105+
$sql .= ' AND dispute_status = 1';
3106+
$sql .= ' ORDER BY f.datef';
3107+
$sql .= ' LIMIT 100';
3108+
3109+
$resql = $db->query($sql);
3110+
if ($resql) {
3111+
$num_rows = $db->num_rows($resql);
3112+
$i=0;
3113+
if ($num_rows) {
3114+
$atleastoneinvoicedisputed++;
3115+
$listofreftoshow = '';
3116+
3117+
while ($obj = $db->fetch_object($resql)) {
3118+
$listofreftoshow .= ($listofreftoshow ? ', ' : $listofreftoshow).$obj->ref.' ('.dol_print_date($db->jdate($obj->datec), 'day', 'gmt').')';
3119+
}
3120+
3121+
if ($listofreftoshow) {
3122+
print '
3123+
<!-- Warnings disputed -->
3124+
<div class="note note-warning note-disputed">
3125+
<h4 class="block">'.$langs->trans("InvoicePaymentDisputedMessage", $listofreftoshow).'</h4>
3126+
</div>
3127+
';
3128+
}
3129+
}
3130+
} else {
3131+
dol_print_error($db);
3132+
}
3133+
3134+
31013135
$companypaymentmode = new CompanyPaymentMode($db);
31023136
$result = $companypaymentmode->fetch(0, null, $mythirdpartyaccount->id);
31033137

@@ -3396,33 +3430,6 @@
33963430
} else {
33973431
dol_print_error($db);
33983432
}
3399-
3400-
// Test if there is one invoice disputed
3401-
$sql = 'SELECT f.rowid, f.ref, f.datef, f.datec, f.date_lim_reglement as date_due, f.dispute_status, fe.invoicepaymentdisputed';
3402-
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facture_extrafields as fe';
3403-
$sql .= ' WHERE fe.fk_object = f.rowid AND f.fk_soc = '.((int) $mythirdpartyaccount->id);
3404-
$sql .= ' AND dispute_status = 1';
3405-
$sql .= ' ORDER BY f.datef';
3406-
$sql .= ' LIMIT 1';
3407-
3408-
$resql = $db->query($sql);
3409-
if ($resql) {
3410-
$num_rows = $db->num_rows($resql);
3411-
$i=0;
3412-
if ($num_rows) {
3413-
$atleastoneinvoicedisputed++;
3414-
3415-
while ($obj = $db->fetch_object($resql)) {
3416-
print '
3417-
<div class="note note-warning note-disputed">
3418-
<h4 class="block">'.$langs->trans("InvoicePaymentDisputedMessage", $obj->ref, dol_print_date($db->jdate($obj->datec), 'day', 'gmt')).'</h4>
3419-
</div>
3420-
';
3421-
}
3422-
}
3423-
} else {
3424-
dol_print_error($db);
3425-
}
34263433
}
34273434

34283435

0 commit comments

Comments
 (0)