This commit is contained in:
Grand Philippe 2012-12-10 10:02:13 +01:00
parent 158f581f03
commit a91a96e72e
43 changed files with 1252 additions and 572 deletions

View File

@ -9,6 +9,7 @@ For users:
- New: Add field "signature" into thirdparty card. If filled, text is added
at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
feature is disabled.
- New: Can input a payment back onto an credit note.
- New: Add link "Back to list" on all cards.
- New: After first install, warning are visible onto mandatory setup not
configured. Show also total number of activated modules.

1
htdocs/.gitignore vendored
View File

@ -1,3 +1,4 @@
/test.php
/custom*
/bootstrap
/multicompany

View File

@ -744,19 +744,31 @@ if ($rowid)
print_fiche_titre($langs->trans("NewCotisation"));
$bankdirect=0; // Option to write to bank is on by default
$bankviainvoice=0; // Option to write via invoice is on by default
$invoiceonly=0;
if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1;
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
// Define default choice to select
$bankdirect=0; // 1 means option by default is write to bank direct with no invoice
$invoiceonly=0; // 1 means option by default is invoice only
$bankviainvoice=0; // 1 means option by default is write to bank via invoice
if (GETPOST('paymentsave'))
{
if (GETPOST('paymentsave') == 'bankdirect') $bankdirect=1;
if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly=1;
if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice=1;
}
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;
}
print "\n\n<!-- Form add subscription -->\n";
if ($conf->use_javascript_ajax)
{
//var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE));
print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
$(".bankswitchclass, .bankswitchclass2").'.($bankdirect||$bankviainvoice||in_array(GETPOST('paymentsave'),array('bankdirect','bankviainvoice'))?'show()':'hide()').';
$(".bankswitchclass, .bankswitchclass2").'.(($bankdirect||$bankviainvoice)?'show()':'hide()').';
$("#none, #invoiceonly").click(function() {
$(".bankswitchclass").hide();
$(".bankswitchclass2").hide();
@ -886,7 +898,7 @@ if ($rowid)
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($bankviainvoice)?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice)?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
if (! empty($conf->banque->enabled))
{
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(! empty($bankdirect)?' checked="checked"':'');
@ -894,8 +906,8 @@ if ($rowid)
}
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(empty($conf->global->ADHERENT_BANK_USE) || $invoiceonly?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(! empty($invoiceonly)?' checked="checked"':'');
if (empty($object->fk_soc)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else
@ -909,8 +921,8 @@ if ($rowid)
}
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice && !empty($conf->global->ADHERENT_BANK_USE)?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(! empty($bankviainvoice)?' checked="checked"':'');
if (empty($object->fk_soc)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
else

View File

@ -42,13 +42,13 @@ $langs->load('compta');
*/
//init var
$invoice_type = GETPOST('invoice_type','int');
$amountPayment = $_POST['amountPayment'];
$amounts = $_POST['amounts']; // from text inputs : invoice amount payment (check required)
$remains = $_POST['remains']; // from dolibarr's object (no need to check)
$currentInvId = $_POST['imgClicked']; // from DOM elements : imgId (equals invoice id)
// Getting the posted keys=>values, sanitize the ones who are from text inputs
// from text inputs : total amount
$amountPayment = $amountPayment!='' ? ( is_numeric(price2num($amountPayment)) ? price2num($amountPayment) : '' ) : ''; // keep void if not a valid entry
// Clean checkamounts
@ -62,7 +62,7 @@ foreach ($amounts as $key => $value)
foreach ($remains as $key => $value)
{
$value = price2num($value);
$remains[$key]=$value;
$remains[$key]=(($invoice_type)==2?-1:1)*$value;
if (empty($value)) unset($remains[$key]);
}

View File

@ -2647,6 +2647,9 @@ else if ($id > 0 || ! empty($ref))
* List of payments
*/
$sign=1;
if ($object->type == 2) $sign=-1;
$nbrows=8; $nbcols=2;
if (! empty($conf->projet->enabled)) $nbrows++;
if (! empty($conf->banque->enabled)) $nbcols++;
@ -2686,9 +2689,9 @@ else if ($id > 0 || ! empty($ref))
{
$num = $db->num_rows($result);
$i = 0;
if ($object->type != 2)
{
//if ($object->type != 2)
//{
if ($num > 0)
{
while ($i < $num)
@ -2709,7 +2712,7 @@ else if ($id > 0 || ! empty($ref))
if ($bankaccountstatic->id) print $bankaccountstatic->getNomUrl(1,'transactions');
print '</td>';
}
print '<td align="right">'.price($objp->amount).'</td>';
print '<td align="right">'.price($sign * $objp->amount).'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
$i++;
@ -2719,7 +2722,7 @@ else if ($id > 0 || ! empty($ref))
{
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'">'.$langs->trans("None").'</td><td></td><td></td></tr>';
}
}
//}
$db->free($result);
}
else
@ -2819,11 +2822,27 @@ else if ($id > 0 || ! empty($ref))
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($resteapayeraffiche).'</b></td>';
print '<td nowrap="nowrap">&nbsp;</td></tr>';
}
else
else // Credit note
{
// Total already paid back
print '<tr><td colspan="'.$nbcols.'" align="right">';
print $langs->trans('AlreadyPaidBack');
print ' :</td><td align="right">'.price($sign * $totalpaye).'</td><td>&nbsp;</td></tr>';
// Billed
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans("Billed").' :</td><td align="right" style="border: 1px solid;">'.price($sign * $object->total_ttc).'</td><td>&nbsp;</td></tr>';
// Remainder to pay back
print '<tr><td colspan="'.$nbcols.'" align="right">';
if ($resteapayeraffiche <= 0) print $langs->trans('RemainderToPayBack');
else print $langs->trans('ExcessPaydBack');
print ' :</td>';
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * $resteapayeraffiche).'</b></td>';
print '<td nowrap="nowrap">&nbsp;</td></tr>';
// Sold credit note
print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price(abs($object->total_ttc)).'</b></td><td>&nbsp;</td></tr>';
//print '<tr><td colspan="'.$nbcols.'" align="right">'.$langs->trans('TotalTTC').' :</td>';
//print '<td align="right" style="border: 1px solid;" bgcolor="#f0f0f0"><b>'.price($sign * $object->total_ttc).'</b></td><td>&nbsp;</td></tr>';
}
print '</table>';

View File

@ -83,7 +83,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
$tmpfacture=new Facture($db);
$tmpfacture->fetch($cursorfacid);
$amountsresttopay[$cursorfacid]=price2num($tmpfacture->total_ttc-$tmpfacture->getSommePaiement());
if ($amounts[$cursorfacid] && $amounts[$cursorfacid] > $amountsresttopay[$cursorfacid])
if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
{
$addwarning=1;
$formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPay")).' '.$langs->trans("HelpPaymentHigherThanReminderToPay");
@ -147,6 +147,16 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
$db->begin();
// Clean parameters amount if payment is for a credit note
if (GETPOST('type') == 2)
{
foreach ($amounts as $key => $value) // How payment is dispatch
{
$newvalue = price2num($value,'MT');
$amounts[$key] = -$newvalue;
}
}
// Creation of payment line
$paiement = new Paiement($db);
$paiement->datepaye = $datepaye;
@ -157,7 +167,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
if (! $error)
{
$paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0));
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
$errmsg=$paiement->error;
@ -167,7 +177,9 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
if (! $error)
{
$result=$paiement->addPaymentToBank($user,'payment','(CustomerInvoicePayment)',$_POST['accountid'],$_POST['chqemetteur'],$_POST['chqbank']);
$label='(CustomerInvoicePayment)';
if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)';
$result=$paiement->addPaymentToBank($user,'payment',$label,$_POST['accountid'],$_POST['chqemetteur'],$_POST['chqbank']);
if ($result < 0)
{
$errmsg=$paiement->error;
@ -227,15 +239,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
dol_htmloutput_errors($errmsg);
// Bouchon
if ($facture->type == 2)
{
$langs->load('other');
print $langs->trans("FeatureNotYetAvailable");
llxFooter();
exit;
}
// Initialize data for confirmation (this is used because data can be change during confirmation)
if ($action == 'add_paiement')
{
@ -253,6 +256,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT;
$paymentnum=$facture->ref_int;
}
// Add realtime total information
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -296,6 +301,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
var json = {};
var form = $("#payment_form");
json["invoice_type"] = $("#invoice_type").val();
json["amountPayment"] = $("#amountpayment").attr("value");
json["amounts"] = _elemToJson(form.find("input[name*=\"amount_\"]"));
json["remains"] = _elemToJson(form.find("input[name*=\"remain_\"]"));
@ -336,7 +342,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
});
';
if (! empty($conf->global->MAIN_JS_ON_PAYMENT))
// Add user helper to input amount on invoices
if (! empty($conf->global->MAIN_JS_ON_PAYMENT) && $facture->type != 2)
{
print ' $("#payment_form").find("img").click(function() {
callForResult(jQuery(this).attr("id"));
@ -356,7 +363,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<input type="hidden" name="action" value="add_paiement">';
print '<input type="hidden" name="facid" value="'.$facture->id.'">';
print '<input type="hidden" name="socid" value="'.$facture->socid.'">';
print '<input type="hidden" name="type" value="'.$facture->type.'">';
print '<input type="hidden" name="type" id="invoice_type" value="'.$facture->type.'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($facture->client->name).'">';
print '<table class="border" width="100%">';
@ -462,17 +469,26 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$num = $db->num_rows($resql);
if ($num > 0)
{
$sign=1;
if ($facture->type == 2) $sign=-1;
$arraytitle=$langs->trans('Invoice');
if ($facture->type == 2) $arraytitle=$langs->trans("CreditNotes");
$alreadypayedlabel=$langs->trans('Received');
if ($facture->type == 2) $alreadypayedlabel=$langs->trans("PaidBack");
$remaindertopay=$langs->trans('RemainderToTake');
if ($facture->type == 2) $remaindertopay=$langs->trans("RemainderToPayBack");
$i = 0;
//print '<tr><td colspan="3">';
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Invoice').'</td>';
print '<td>'.$arraytitle.'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$langs->trans('Received').'</td>';
print '<td align="right">'.$langs->trans('RemainderToPay').'</td>';
print '<td align="right">'.$alreadypayedlabel.'</td>';
print '<td align="right">'.$remaindertopay.'</td>';
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>';
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@ -505,18 +521,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Date
print '<td align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
// Prix
print '<td align="right">'.price($objp->total_ttc).'</td>';
// Price
print '<td align="right">'.price($sign * $objp->total_ttc).'</td>';
// Recu
print '<td align="right">'.price($paiement);
// Received or paid back
print '<td align="right">'.price($sign * $paiement);
if ($creditnotes) print '+'.price($creditnotes);
if ($deposits) print '+'.price($deposits);
print '</td>';
// Remain to pay
print '<td align="right">'.price($remaintopay).'</td>';
$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
// Remain to take or to pay back
print '<td align="right">'.price($sign * $remaintopay).'</td>';
//$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
// Amount
print '<td align="right">';
@ -543,7 +559,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Warning
print '<td align="center" width="16">';
if ($amounts[$invoice->id] && $amounts[$invoice->id] > $amountsresttopay[$invoice->id])
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
if ($amounts[$invoice->id] && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])))
{
print ' '.img_warning($langs->trans("PaymentHigherThanReminderToPay"));
}
@ -564,12 +581,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Print total
print '<tr class="liste_total">';
print '<td colspan="2" align="left">'.$langs->trans('TotalTTC').'</td>';
print '<td align="right"><b>'.price($total_ttc).'</b></td>';
print '<td align="right"><b>'.price($totalrecu);
print '<td align="right"><b>'.price($sign * $total_ttc).'</b></td>';
print '<td align="right"><b>'.price($sign * $totalrecu);
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
print '</b></td>';
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right" id="result" style="font-weight: bold;"></td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
@ -588,15 +605,20 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bouton Enregistrer
if ($action != 'add_paiement')
{
// print '<tr><td colspan="3" align="center">';
print '<center><br><input type="checkbox" checked="checked" name="closepaidinvoices"> '.$langs->trans("ClosePaidInvoicesAutomatically");
$checkboxlabel=$langs->trans("ClosePaidInvoicesAutomatically");
if ($facture->type == 2) $checkboxlabel=$langs->trans("ClosePaidCreditNotesAutomatically");
$buttontitle=$langs->trans('ToMakePayment');
if ($facture->type == 2) $buttontitle=$langs->trans('ToMakePaymentBack');
print '<center><br>';
print '<input type="checkbox" checked="checked" name="closepaidinvoices"> '.$checkboxlabel;
/*if (! empty($conf->prelevement->enabled))
{
$langs->load("withdrawals");
if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '<br>'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed");
}*/
print '<br><input type="submit" class="button" value="'.$langs->trans('Save').'"><br><br></center>';
// print '</td></tr>';
print '<br><input type="submit" class="button" value="'.dol_escape_htmltag($buttontitle).'"><br><br>';
print '</center>';
}

View File

@ -121,7 +121,8 @@ class Paiement extends CommonObject
/**
* Create payment of invoices into database.
* Use this->amounts to have list of invoices for the payment
* Use this->amounts to have list of invoices for the payment.
* For payment of a customer invoice, amounts are postive, for payment of credit note, amounts are negative
*
* @param User $user Object user
* @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
@ -189,6 +190,9 @@ class Paiement extends CommonObject
$deposits=$invoice->getSumDepositsUsed();
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
//var_dump($invoice->total_ttc.' - '.$paiement.' -'.$creditnotes.' - '.$deposits.' - '.$remaintopay);exit;
// If there is withdrawals request to do and not done yet, we wait before closing.
$mustwait=0;
$listofpayments=$invoice->getListOfPayments();
@ -205,7 +209,7 @@ class Paiement extends CommonObject
}
}
if ($invoice->type != 0 && $invoice->type != 1) dol_syslog("Invoice ".$facid." is not a standard nor replacement invoice. We do nothing more.");
if ($invoice->type != 0 && $invoice->type != 1 && $invoice->type != 2) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note. We do nothing more.");
else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
else $result=$invoice->set_paid($user,'','');
@ -363,7 +367,7 @@ class Paiement extends CommonObject
/**
* A record into bank for payment with links between this bank record and invoices of payment.
* All payment properties must have been set first like after a call to create().
* All payment properties (this->amount, this->amounts, ...) must have been set first like after a call to create().
*
* @param User $user Object of user making payment
* @param string $mode 'payment', 'payment_supplier'
@ -401,7 +405,7 @@ class Paiement extends CommonObject
$this->datepaye,
$this->paiementid, // Payment mode id or code ("CHQ or VIR for example")
$label,
$totalamount,
$totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note)
$this->num_paiement,
'',
$user,

View File

@ -108,11 +108,11 @@ else
else $sql.= " AND f.fk_user_author = ".$userid;
}
// Search criteria
if ($_REQUEST["search_ref"]) $sql .=" AND p.rowid=".$_REQUEST["search_ref"];
if ($_REQUEST["search_account"]) $sql .=" AND b.fk_account=".$_REQUEST["search_account"];
if ($_REQUEST["search_paymenttype"]) $sql .=" AND c.code='".$_REQUEST["search_paymenttype"]."'";
if ($_REQUEST["search_amount"]) $sql .=" AND p.amount=".price2num($_REQUEST["search_amount"]);
if ($_REQUEST["search_company"]) $sql .=" AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'";
if (GETPOST("search_ref")) $sql .=" AND p.rowid=".GETPOST("search_ref",'int');
if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int');
if (GETPOST("search_paymenttype") > 0) $sql .=" AND c.code='".GETPOST("search_paymenttype",'int')."'";
if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount"));
if (GETPOST("search_company")) $sql .=" AND s.nom LIKE '%".$db->escape(GETPOST("search_company"))."%'";
}
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset);

View File

@ -65,9 +65,10 @@ if ($modecompta == 'CREANCES-DETTES')
$nom.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period="$year_start - $year_end";
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesResultDue")."<br>";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
else $description.= $langs->trans("DepositsAreIncluded");
$description=$langs->trans("RulesAmountWithTaxIncluded");
$description.='<br>'.$langs->trans("RulesResultDue");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.="<br>".$langs->trans("DepositsAreNotIncluded");
else $description.="<br>".$langs->trans("DepositsAreIncluded");
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
@ -76,7 +77,8 @@ else {
$nom.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$period="$year_start - $year_end";
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year_start=".($year_start+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesResultInOut");
$description=$langs->trans("RulesAmountWithTaxIncluded");
$description.='<br>'.$langs->trans("RulesResultInOut");
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
}
@ -513,7 +515,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
print "</td>";
print '<td align="right">&nbsp;';
if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
if (isset($encaiss_ttc[$case]))
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss_ttc[$case],'MT')).'</a>';
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;

View File

@ -252,7 +252,8 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
}
if (! $cum[$caseprev] && $cum[$case])
{
print '<td align="right">+Inf%</td>';
//print '<td align="right">+Inf%</td>';
print '<td align="right">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{

View File

@ -1,286 +1,286 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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/core/lib/price.lib.php
* \brief Library with functions to calculate prices
*/
/**
* Calculate totals (net, vat, ...) of a line.
* Value for localtaxX_type are '0' : local tax not applied
* '1' : local tax apply on products and services without vat (vat is not applied for local tax calculation)
* '2' : local tax apply on products and services before vat (vat is calculated on amount + localtax)
* '3' : local tax apply on products without vat (vat is not applied for local tax calculation)
* '4' : local tax apply on products before vat (vat is calculated on amount + localtax)
* '5' : local tax apply on services without vat (vat is not applied for local tax calculation)
* '6' : local tax apply on services before vat (vat is calculated on amount + localtax)
* '7' : local tax is a fix amount applied on global invoice
*
* @param int $qty Quantity
* @param float $pu Unit price (HT or TTC selon price_base_type)
* @param float $remise_percent_ligne Discount for line
* @param float $txtva 0=do not apply standard tax, Vat rate=apply
* @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply, -1=autodetect according to seller
* @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply, -1=autodetect according to seller
* @param float $remise_percent_global 0
* @param string $price_base_type HT=on calcule sur le HT, TTC=on calcule sur le TTC
* @param int $info_bits Miscellanous informations on line
* @param int $type 0/1=Product/service
* @param string $seller Thirdparty seller (we need $seller->country_code property). Provided only if seller is the supplier.
* @return result[ 0=total_ht,
* 1=total_vat,
* 2=total_ttc,
* 3=pu_ht,
* 4=pu_tva,
* 5=pu_ttc,
* 6=total_ht_without_discount,
* 7=total_vat_without_discount,
* 8=total_ttc_without_discount,
* 9=amount tax1 for total_ht,
* 10=amount tax2 for total_ht,
* 11=amount tax1 for pu_ht,
* 12=amount tax2 for pu_ht,
* 13=not used???,
* 14=amount tax1 for total_ht_without_discount,
* 15=amount tax1 for total_ht_without_discount]
*/
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '')
{
global $conf,$mysoc,$db;
$result=array();
if (empty($seller) || ! is_object($seller))
{
if (! is_object($mysoc)) // mysoc may be not defined (during migration process)
{
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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/core/lib/price.lib.php
* \brief Library with functions to calculate prices
*/
/**
* Calculate totals (net, vat, ...) of a line.
* Value for localtaxX_type are '0' : local tax not applied
* '1' : local tax apply on products and services without vat (vat is not applied for local tax calculation)
* '2' : local tax apply on products and services before vat (vat is calculated on amount + localtax)
* '3' : local tax apply on products without vat (vat is not applied for local tax calculation)
* '4' : local tax apply on products before vat (vat is calculated on amount + localtax)
* '5' : local tax apply on services without vat (vat is not applied for local tax calculation)
* '6' : local tax apply on services before vat (vat is calculated on amount + localtax)
* '7' : local tax is a fix amount applied on global invoice
*
* @param int $qty Quantity
* @param float $pu Unit price (HT or TTC selon price_base_type)
* @param float $remise_percent_ligne Discount for line
* @param float $txtva 0=do not apply standard tax, Vat rate=apply
* @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply, -1=autodetect according to seller
* @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply, -1=autodetect according to seller
* @param float $remise_percent_global 0
* @param string $price_base_type HT=on calcule sur le HT, TTC=on calcule sur le TTC
* @param int $info_bits Miscellanous informations on line
* @param int $type 0/1=Product/service
* @param string $seller Thirdparty seller (we need $seller->country_code property). Provided only if seller is the supplier.
* @return result[ 0=total_ht,
* 1=total_vat,
* 2=total_ttc,
* 3=pu_ht,
* 4=pu_tva,
* 5=pu_ttc,
* 6=total_ht_without_discount,
* 7=total_vat_without_discount,
* 8=total_ttc_without_discount,
* 9=amount tax1 for total_ht,
* 10=amount tax2 for total_ht,
* 11=amount tax1 for pu_ht,
* 12=amount tax2 for pu_ht,
* 13=not used???,
* 14=amount tax1 for total_ht_without_discount,
* 15=amount tax1 for total_ht_without_discount]
*/
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '')
{
global $conf,$mysoc,$db;
$result=array();
if (empty($seller) || ! is_object($seller))
{
if (! is_object($mysoc)) // mysoc may be not defined (during migration process)
{
$mysoc=new Societe($db);
$mysoc->getMysoc($conf);
}
$seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc
//var_dump($seller->country_id);exit;
}
$countryid=$seller->country_id;
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
// Now we search localtaxes information ourself (rates and types).
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv";
//$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc";
$sql.= " WHERE cv.taux = ".$txtva;
//$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'";
$sql.= " AND cv.fk_pays = ".$countryid;
dol_syslog("search vat information sql=".$sql);
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
$localtax1_rate=$obj->localtax1;
$localtax2_rate=$obj->localtax2;
$localtax1_type=$obj->localtax1_type;
$localtax2_type=$obj->localtax2_type;
//var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit;
}
}
else dol_print_error($db);
// initialize total (may be HT or TTC depending on price_base_type)
$tot_sans_remise = $pu * $qty;
$tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100));
$tot_avec_remise = $tot_avec_remise_ligne * (1 - ($remise_percent_global / 100));
// initialize result
for ($i=0; $i <= 15; $i++) $result[$i] = 0;
// if there's some localtax including vat, we calculate localtaxes (we will add later)
$localtaxes = array(0,0,0);
$apply_tax = false;
switch($localtax1_type) {
case '2': // localtax on product or service
$apply_tax = true;
break;
case '4': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '6': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax1_rate && $apply_tax) {
$result[14] = price2num(($tot_sans_remise * (1 + ( $localtax1_rate / 100))) - $tot_sans_remise, 'MT');
$localtaxes[0] += $result[14];
$result[9] = price2num(($tot_avec_remise * (1 + ( $localtax1_rate / 100))) - $tot_avec_remise, 'MT');
$localtaxes[1] += $result[9];
$result[11] = price2num(($pu * (1 + ( $localtax1_rate / 100))) - $pu, 'MU');
$localtaxes[2] += $result[11];
}
$apply_tax = false;
switch($localtax2_type) {
case '2': // localtax on product or service
$apply_tax = true;
break;
case '4': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '6': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax2_rate && $apply_tax) {
$result[15] = price2num(($tot_sans_remise * (1 + ( $localtax2_rate / 100))) - $tot_sans_remise, 'MT');
$localtaxes[0] += $result[15];
$result[10] = price2num(($tot_avec_remise * (1 + ( $localtax2_rate / 100))) - $tot_avec_remise, 'MT');
$localtaxes[1] += $result[10];
$result[12] = price2num(($pu * (1 + ( $localtax2_rate / 100))) - $pu, 'MU');
$localtaxes[2] += $result[12];
}
//dol_syslog("price.lib::calcul_price_total $qty, $pu, $remise_percent_ligne, $txtva, $price_base_type $info_bits");
if ($price_base_type == 'HT')
{
// We work to define prices using the price without tax
$result[6] = price2num($tot_sans_remise, 'MT');
$result[8] = price2num(($tot_sans_remise + $localtaxes[0]) * (1 + ( (($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result8bis= price2num(($tot_sans_remise + $localtaxes[0]) * (1 + ( $txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[7] = price2num($result8bis - ($result[6] + $localtaxes[0]), 'MT');
$result[0] = price2num($tot_avec_remise, 'MT');
$result[2] = price2num(($tot_avec_remise + $localtaxes[1]) * (1 + ( (($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result2bis= price2num(($tot_avec_remise + $localtaxes[1]) * (1 + ( $txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[1] = price2num($result2bis - ($result[0] + $localtaxes[1]), 'MT'); // Total VAT = TTC - (HT + localtax)
$result[3] = price2num($pu, 'MU');
$result[5] = price2num(($pu + $localtaxes[2]) * (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MU'); // Selon TVA NPR ou non
$result5bis= price2num(($pu + $localtaxes[2]) * (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normale (non NPR)
$result[4] = price2num($result5bis - ($result[3] + $localtaxes[2]), 'MU');
}
else
{
// We work to define prices using the price with tax
$result[8] = price2num($tot_sans_remise + $localtaxes[0], 'MT');
$result[6] = price2num(($tot_sans_remise + $localtaxes[0]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result6bis= price2num(($tot_sans_remise + $localtaxes[0]) / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[7] = price2num($result[8] - ($result6bis + $localtaxes[0]), 'MT');
$result[2] = price2num($tot_avec_remise + $localtaxes[1], 'MT');
$result[0] = price2num(($tot_avec_remise + $localtaxes[1]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result0bis= price2num(($tot_avec_remise + $localtaxes[1]) / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[1] = price2num($result[2] - ($result0bis + $localtaxes[1]), 'MT'); // Total VAT = TTC - HT
$result[5] = price2num(($pu + $localtaxes[2]), 'MU');
$result[3] = price2num(($pu + $localtaxes[2]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MU'); // Selon TVA NPR ou non
$result3bis= price2num(($pu + $localtaxes[2]) / (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normale (non NPR)
$result[4] = price2num($result[5] - ($result3bis + $localtaxes[2]), 'MU');
}
// if there's some localtax without vat, we calculate localtaxes (we will add them at end)
//If price is 'TTC' we need to have the totals without VAT for a correct calculation
if ($price_base_type=='TTC')
{
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
$pu = price2num($pu / (1 + ($txtva / 100)),'MU');
}
$apply_tax = false;
switch($localtax1_type) {
case '1': // localtax on product or service
$apply_tax = true;
break;
case '3': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '5': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax1_rate && $apply_tax) {
$result[14] = price2num(($tot_sans_remise * (1 + ( $localtax1_rate / 100))) - $tot_sans_remise, 'MT'); // amount tax1 for total_ht_without_discount
$result[8] += $result[14]; // total_ttc_without_discount + tax1
$result[9] = price2num(($tot_avec_remise * (1 + ( $localtax1_rate / 100))) - $tot_avec_remise, 'MT'); // amount tax1 for total_ht
$result[2] += $result[9]; // total_ttc + tax1
$result[11] = price2num(($pu * (1 + ( $localtax1_rate / 100))) - $pu, 'MU'); // amount tax1 for pu_ht
$result[5] += $result[11]; // pu_ht + tax1
}
$apply_tax = false;
switch($localtax2_type) {
case '1': // localtax on product or service
$apply_tax = true;
break;
case '3': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '5': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax2_rate && $apply_tax) {
$result[15] = price2num(($tot_sans_remise * (1 + ( $localtax2_rate / 100))) - $tot_sans_remise, 'MT'); // amount tax2 for total_ht_without_discount
$result[8] += $result[15]; // total_ttc_without_discount + tax2
$result[10] = price2num(($tot_avec_remise * (1 + ( $localtax2_rate / 100))) - $tot_avec_remise, 'MT'); // amount tax2 for total_ht
$result[2] += $result[10]; // total_ttc + tax2
$result[12] = price2num(($pu * (1 + ( $localtax2_rate / 100))) - $pu, 'MU'); // amount tax2 for pu_ht
$result[5] += $result[12]; // pu_ht + tax2
}
// If rounding is not using base 10 (rare)
if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT))
{
if ($price_base_type == 'HT')
{
$result[0]=round($result[0]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[2]=price2num($result[0]+$result[1], 'MT');
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
}
else
{
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[0]=price2num($result[2]-$result[0], 'MT');
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
}
}
//print "Price.lib::calcul_price_total ".$result[0]."-".$result[1]."-".$result[2];
return $result;
}
}
$seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc
//var_dump($seller->country_id);exit;
}
$countryid=$seller->country_id;
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
// Now we search localtaxes information ourself (rates and types).
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv";
//$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc";
$sql.= " WHERE cv.taux = ".$txtva;
//$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'";
$sql.= " AND cv.fk_pays = ".$countryid;
dol_syslog("search vat information sql=".$sql);
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
$localtax1_rate=$obj->localtax1;
$localtax2_rate=$obj->localtax2;
$localtax1_type=$obj->localtax1_type;
$localtax2_type=$obj->localtax2_type;
//var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit;
}
}
else dol_print_error($db);
// initialize total (may be HT or TTC depending on price_base_type)
$tot_sans_remise = $pu * $qty;
$tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100));
$tot_avec_remise = $tot_avec_remise_ligne * (1 - ($remise_percent_global / 100));
// initialize result
for ($i=0; $i <= 15; $i++) $result[$i] = 0;
// if there's some localtax including vat, we calculate localtaxes (we will add later)
$localtaxes = array(0,0,0);
$apply_tax = false;
switch($localtax1_type) {
case '2': // localtax on product or service
$apply_tax = true;
break;
case '4': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '6': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax1_rate && $apply_tax) {
$result[14] = price2num(($tot_sans_remise * (1 + ( $localtax1_rate / 100))) - $tot_sans_remise, 'MT');
$localtaxes[0] += $result[14];
$result[9] = price2num(($tot_avec_remise * (1 + ( $localtax1_rate / 100))) - $tot_avec_remise, 'MT');
$localtaxes[1] += $result[9];
$result[11] = price2num(($pu * (1 + ( $localtax1_rate / 100))) - $pu, 'MU');
$localtaxes[2] += $result[11];
}
$apply_tax = false;
switch($localtax2_type) {
case '2': // localtax on product or service
$apply_tax = true;
break;
case '4': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '6': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax2_rate && $apply_tax) {
$result[15] = price2num(($tot_sans_remise * (1 + ( $localtax2_rate / 100))) - $tot_sans_remise, 'MT');
$localtaxes[0] += $result[15];
$result[10] = price2num(($tot_avec_remise * (1 + ( $localtax2_rate / 100))) - $tot_avec_remise, 'MT');
$localtaxes[1] += $result[10];
$result[12] = price2num(($pu * (1 + ( $localtax2_rate / 100))) - $pu, 'MU');
$localtaxes[2] += $result[12];
}
//dol_syslog("price.lib::calcul_price_total $qty, $pu, $remise_percent_ligne, $txtva, $price_base_type $info_bits");
if ($price_base_type == 'HT')
{
// We work to define prices using the price without tax
$result[6] = price2num($tot_sans_remise, 'MT');
$result[8] = price2num(($tot_sans_remise + $localtaxes[0]) * (1 + ( (($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result8bis= price2num(($tot_sans_remise + $localtaxes[0]) * (1 + ( $txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[7] = price2num($result8bis - ($result[6] + $localtaxes[0]), 'MT');
$result[0] = price2num($tot_avec_remise, 'MT');
$result[2] = price2num(($tot_avec_remise + $localtaxes[1]) * (1 + ( (($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result2bis= price2num(($tot_avec_remise + $localtaxes[1]) * (1 + ( $txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[1] = price2num($result2bis - ($result[0] + $localtaxes[1]), 'MT'); // Total VAT = TTC - (HT + localtax)
$result[3] = price2num($pu, 'MU');
$result[5] = price2num(($pu + $localtaxes[2]) * (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MU'); // Selon TVA NPR ou non
$result5bis= price2num(($pu + $localtaxes[2]) * (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normale (non NPR)
$result[4] = price2num($result5bis - ($result[3] + $localtaxes[2]), 'MU');
}
else
{
// We work to define prices using the price with tax
$result[8] = price2num($tot_sans_remise + $localtaxes[0], 'MT');
$result[6] = price2num(($tot_sans_remise + $localtaxes[0]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result6bis= price2num(($tot_sans_remise + $localtaxes[0]) / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[7] = price2num($result[8] - ($result6bis + $localtaxes[0]), 'MT');
$result[2] = price2num($tot_avec_remise + $localtaxes[1], 'MT');
$result[0] = price2num(($tot_avec_remise + $localtaxes[1]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MT'); // Selon TVA NPR ou non
$result0bis= price2num(($tot_avec_remise + $localtaxes[1]) / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR)
$result[1] = price2num($result[2] - ($result0bis + $localtaxes[1]), 'MT'); // Total VAT = TTC - HT
$result[5] = price2num(($pu + $localtaxes[2]), 'MU');
$result[3] = price2num(($pu + $localtaxes[2]) / (1 + ((($info_bits & 1)?0:$txtva) / 100)), 'MU'); // Selon TVA NPR ou non
$result3bis= price2num(($pu + $localtaxes[2]) / (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normale (non NPR)
$result[4] = price2num($result[5] - ($result3bis + $localtaxes[2]), 'MU');
}
// if there's some localtax without vat, we calculate localtaxes (we will add them at end)
//If price is 'TTC' we need to have the totals without VAT for a correct calculation
if ($price_base_type=='TTC')
{
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
$pu = price2num($pu / (1 + ($txtva / 100)),'MU');
}
$apply_tax = false;
switch($localtax1_type) {
case '1': // localtax on product or service
$apply_tax = true;
break;
case '3': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '5': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax1_rate && $apply_tax) {
$result[14] = price2num(($tot_sans_remise * (1 + ( $localtax1_rate / 100))) - $tot_sans_remise, 'MT'); // amount tax1 for total_ht_without_discount
$result[8] += $result[14]; // total_ttc_without_discount + tax1
$result[9] = price2num(($tot_avec_remise * (1 + ( $localtax1_rate / 100))) - $tot_avec_remise, 'MT'); // amount tax1 for total_ht
$result[2] += $result[9]; // total_ttc + tax1
$result[11] = price2num(($pu * (1 + ( $localtax1_rate / 100))) - $pu, 'MU'); // amount tax1 for pu_ht
$result[5] += $result[11]; // pu_ht + tax1
}
$apply_tax = false;
switch($localtax2_type) {
case '1': // localtax on product or service
$apply_tax = true;
break;
case '3': // localtax on product
if ($type == 0) $apply_tax = true;
break;
case '5': // localtax on service
if ($type == 1) $apply_tax = true;
break;
}
if ($uselocaltax2_rate && $apply_tax) {
$result[15] = price2num(($tot_sans_remise * (1 + ( $localtax2_rate / 100))) - $tot_sans_remise, 'MT'); // amount tax2 for total_ht_without_discount
$result[8] += $result[15]; // total_ttc_without_discount + tax2
$result[10] = price2num(($tot_avec_remise * (1 + ( $localtax2_rate / 100))) - $tot_avec_remise, 'MT'); // amount tax2 for total_ht
$result[2] += $result[10]; // total_ttc + tax2
$result[12] = price2num(($pu * (1 + ( $localtax2_rate / 100))) - $pu, 'MU'); // amount tax2 for pu_ht
$result[5] += $result[12]; // pu_ht + tax2
}
// If rounding is not using base 10 (rare)
if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT))
{
if ($price_base_type == 'HT')
{
$result[0]=round($result[0]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[2]=price2num($result[0]+$result[1], 'MT');
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
}
else
{
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[0]=price2num($result[2]-$result[0], 'MT');
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
}
}
//print "Price.lib::calcul_price_total ".$result[0]."-".$result[1]."-".$result[2];
return $result;
}

View File

@ -376,7 +376,7 @@ class pdf_crabe extends ModelePDFFactures
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getTypeOfLocalTaxFromRate($vatrate,1,$mysoc);
$localtax2_array=getTypeOfLocalTaxFromRate($vatrate,2,$mysoc);
@ -524,7 +524,12 @@ class pdf_crabe extends ModelePDFFactures
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
$tab3_posx = 120;
global $conf;
$sign=1;
if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
$tab3_height = 4;
@ -535,9 +540,12 @@ class pdf_crabe extends ModelePDFFactures
$default_font_size = pdf_getPDFFontSize($outputlangs);
$title=$outputlangs->transnoentities("PaymentsAlreadyDone");
if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone");
$pdf->SetFont('','', $default_font_size - 3);
$pdf->SetXY($tab3_posx, $tab3_top - 4);
$pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0);
$pdf->MultiCell(60, 3, $title, 0, 'L', 0);
$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top);
@ -620,7 +628,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->MultiCell(20, 3, price($sign * $row->amount), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
@ -1042,7 +1050,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
}
}

View File

@ -1,3 +1,70 @@
5.9.200 (2012-12-05)
- Bug item #768 "Rowspan with Pagebreak error" was fixed.
- Page regions now works also with limited MultiCell() cells.
5.9.199 (2012-11-29)
- Internal setImageBuffer() method was improved.
5.9.198 (2012-11-19)
- Datamatrix EDIFACT mode was fixed.
5.9.197 (2012-11-06)
- Bug item #756 "TCPDF 5.9.196 shows line on top of all PDFs" was fixed.
5.9.196 (2012-11-02)
- Several methods were improved to avoid output when the context is out of page.
- Bug item #755 "remove cached files before unsetting" was fixed.
5.9.195 (2012-10-24)
- Method _putfonts() was improved.
5.9.194 (2012-10-23)
- Text alignment on TextField() method was fixed.
5.9.193 (2012-09-25)
- Support for named destinations on HTML links was added (i.e.: <a href="#destinationname">link to named destination</a>).
5.9.192 (2012-09-24)
- A problem on the releasing process was fixed.
5.9.191 (2012-09-24)
- SVG image naow support svg and eps images.
5.9.190 (2012-09-23)
- "page" word translation is now set to empty if not defined.
- Tooltip feature was added on the radiobutton annotation.
5.9.189 (2012-09-18)
- Bug item #3568969 "ini_get safe_mode error" was fixed.
5.9.188 (2012-09-15)
- A datamatrix barcode bug was fixed.
5.9.187 (2012-09-14)
- Subset feature was extended to include the first 256 characters.
5.9.186 (2012-09-13)
- barcodes.php file was resynced.
- Methods SetAbsX, SetAbsY, SetAbsXY where added to set the absolute pointer coordinates.
- Method getCharBBox were added to get single character bounding box.
- Signature of addTTFfont method was changed ($addcbbox paramter was added).
5.9.185 (2012-09-12)
- Method _putfontwidths() was fixed.
5.9.184 (2012-09-11)
- A problem with EAN barcodes was fixed.
5.9.183 (2012-09-07)
- A problem with font names normalization was fixed.
5.9.182 (2012-09-05)
- Bug item #3564982 "Infinite loop in Write() method" was fixed.
5.9.181 (2012-08-31)
- composer.json file was added.
- Bug item #3563369 "Cached images are not unlinked some time" was fixed.
5.9.180 (2012-08-22)
- Bug item #3560493 "Problems with nested cells in HTML" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.180
Release date: 2012-08-22
Version: 5.9.200
Release date: 2012-12-05
Author: Nicola Asuni
Copyright (c) 2002-2012:

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : barcodes.php
// Version : 1.0.024
// Version : 1.0.025
// Begin : 2008-06-09
// Last Update : 2012-04-30
// Last Update : 2012-09-11
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -37,14 +37,14 @@
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.024
* @version 1.0.025
*/
/**
* @class TCPDFBarcode
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
* @package com.tecnick.tcpdf
* @version 1.0.024
* @version 1.0.025
* @author Nicola Asuni
*/
class TCPDFBarcode {
@ -1452,7 +1452,7 @@ class TCPDFBarcode {
$seq .= '010101'; // right guard bar
} else {
$bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array());
$half_len = ceil($len / 2);
$half_len = intval(ceil($len / 2));
if ($len == 8) {
for ($i = 0; $i < $half_len; ++$i) {
$seq .= $codes['A'][$code{$i}];

View File

@ -0,0 +1,38 @@
{
"name": "tecnick.com/tcpdf",
"version": "5.9.200",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents.",
"keywords": ["pdf","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
"license": "LGPLv3",
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"classmap": [
"fonts",
"config/lang",
"config",
"2dbarcodes.php",
"barcodes.php",
"datamatrix.php",
"encodings_maps.php",
"htmlcolors.php",
"pdf417.php",
"qrcode.php",
"spotcolors.php",
"tcpdf.php",
"tcpdf_filters.php",
"tcpdf_parser.php",
"unicode_data.php"
]
}
}

View File

@ -223,7 +223,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
define('HEAD_MAGNIFICATION', 1.1);
/**
* height of cell repect font height
* height of cell respect font height
*/
define('K_CELL_HEIGHT_RATIO', 1.25);

View File

@ -214,7 +214,7 @@ define ('PDF_IMAGE_SCALE_RATIO', 1.25);
define('HEAD_MAGNIFICATION', 1.1);
/**
* height of cell repect font height
* height of cell respect font height
*/
define('K_CELL_HEIGHT_RATIO', 1.25);

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : datamatrix.php
// Version : 1.0.001
// Version : 1.0.004
// Begin : 2010-06-07
// Last Update : 2011-09-14
// Last Update : 2012-11-19
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
@ -34,14 +34,14 @@
//============================================================+
/**
* @file
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.001
*/
* @file
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.004
*/
// custom definitions
if (!defined('DATAMATRIXDEFS')) {
@ -59,54 +59,54 @@ if (!defined('DATAMATRIXDEFS')) {
/**
* ASCII encoding: ASCII character 0 to 127 (1 byte per CW)
*/
* ASCII encoding: ASCII character 0 to 127 (1 byte per CW)
*/
define('ENC_ASCII', 0);
/**
* C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)
*/
* C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)
*/
define('ENC_C40', 1);
/**
* TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)
*/
* TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)
*/
define('ENC_TXT', 2);
/**
* X12 encoding: ANSI X12 (3/2 byte per CW)
*/
* X12 encoding: ANSI X12 (3/2 byte per CW)
*/
define('ENC_X12', 3);
/**
* EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)
*/
* EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)
*/
define('ENC_EDF', 4);
/**
* BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)
*/
* BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)
*/
define('ENC_BASE256', 5);
/**
* ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)
*/
* ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)
*/
define('ENC_ASCII_EXT', 6);
/**
* ASCII number encoding: ASCII digits (2 bytes per CW)
*/
* ASCII number encoding: ASCII digits (2 bytes per CW)
*/
define('ENC_ASCII_NUM', 7);
/**
* @class Datamatrix
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.001
*/
* @class Datamatrix
* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
*
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.004
*/
class Datamatrix {
/**
@ -184,7 +184,7 @@ class Datamatrix {
protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12');
/**
* Basic set of charactes for each encodation mode.
* Basic set of characters for each encodation mode.
* @protected
*/
protected $chset = array(
@ -270,7 +270,7 @@ class Datamatrix {
$cw[] = 129;
++$nd;
// add remaining pads
for ($i = $nd; $i <= $params[11]; ++$i) {
for ($i = $nd; $i < $params[11]; ++$i) {
$cw[] = $this->get253StateCodeword(129, $i);
}
}
@ -280,7 +280,7 @@ class Datamatrix {
// initialize empty arrays
$grid = array_fill(0, ($params[2] * $params[3]), 0);
// get placement map
$places = $this->getPlacemetMap($params[2], $params[3]);
$places = $this->getPlacementMap($params[2], $params[3]);
// fill the grid with data
$grid = array();
$i = 0;
@ -365,7 +365,7 @@ class Datamatrix {
if (($a == 0) OR ($b == 0)) {
return 0;
}
return $alog[($log[$a] + $log[$b]) % ($gf - 1)];
return ($alog[($log[$a] + $log[$b]) % ($gf - 1)]);
}
/**
@ -552,7 +552,7 @@ class Datamatrix {
return ENC_C40;
}
// get char
$chr = ord($data{($pos + $charscount)});
$chr = ord($data[$pos + $charscount]);
$charscount++;
// STEP L
if ($this->isCharMode($chr, ENC_ASCII_NUM)) {
@ -709,7 +709,7 @@ class Datamatrix {
while ($pos < $data_lenght) {
switch ($enc) {
case ENC_ASCII: { // STEP B. While in ASCII encodation
if (($data_lenght > 1) AND ($pos < ($data_lenght - 1)) AND ($this->isCharMode(ord($data{($pos)}), ENC_ASCII_NUM) AND $this->isCharMode(ord($data{($pos + 1)}), ENC_ASCII_NUM))) {
if (($data_lenght > 1) AND ($pos < ($data_lenght - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) {
// 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode.
$cw[] = (intval(substr($data, $pos, 2)) + 130);
++$cw_num;
@ -724,7 +724,7 @@ class Datamatrix {
++$cw_num;
} else {
// get new byte
$chr = ord($data{($pos)});
$chr = ord($data[$pos]);
++$pos;
if ($this->isCharMode($chr, ENC_ASCII_EXT)) {
// 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character.
@ -752,7 +752,7 @@ class Datamatrix {
$charset = $this->chset[$set_id];
do {
// 2. process the next character in C40 encodation.
$chr = ord($data{($epos)});
$chr = ord($data[$epos]);
++$epos;
// check for extended character
if ($chr & 0x80) {
@ -802,6 +802,8 @@ class Datamatrix {
$enc = $newenc;
$cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num;
$pos -= $p;
$p = 0;
break;
}
}
@ -834,9 +836,11 @@ class Datamatrix {
$cw_num += 2;
} else {
// switch to ASCII encoding
$enc = ENC_ASCII;
$cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num;
if ($enc != ENC_ASCII) {
$enc = ENC_ASCII;
$cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num;
}
}
}
break;
@ -846,52 +850,50 @@ class Datamatrix {
$temp_cw = array();
$epos = $pos;
$field_lenght = 0;
while ($epos < $data_lenght) {
$newenc = $enc;
do {
// 2. process the next character in EDIFACT encodation.
$chr = ord($data{($epos)});
++$epos;
$temp_cw[] = $chr;
++$field_lenght;
if (($field_lenght == 4) OR ($epos == $data_lenght)) {
if ($field_lenght < 4) {
$chr = ord($data[$epos]);
if ($this->isCharMode($chr, ENC_EDF)) {
++$epos;
$temp_cw[] = $chr;
++$field_lenght;
}
if (($field_lenght == 4) OR ($epos == $data_lenght) OR !$this->isCharMode($chr, ENC_EDF)) {
if ($field_lenght < 4) { echo $field_lenght."\n";
// set unlatch character
$temp_cw[] = 0x1f;
++$field_lenght;
$enc = ENC_ASCII;
// fill empty characters
for ($i = $field_lenght; $i < 4; ++$i) {
$temp_cw[] = 0;
}
$enc = ENC_ASCII;
}
// encodes four data characters in three codewords
$cw[] = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
$cw[] = (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2);
$cw[] = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F);
$cw_num += 3;
$tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
if ($tcw > 0) {
$cw[] = $tcw;
$cw_num++;
}
$tcw= (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2);
if ($tcw > 0) {
$cw[] = $tcw;
$cw_num++;
}
$tcw = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F);
if ($tcw > 0) {
$cw[] = $tcw;
$cw_num++;
}
$temp_cw = array();
$pos = $epos;
$field_lenght = 0;
}
// 1. If the EDIFACT encoding is at the point of starting a new triple symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
if ($field_lenght == 0) {
// get remaining number of data symbols
$cwr = ($this->getMaxDataCodewords($cw_num + 2) - $cw_num);
if ($cwr < 3) {
// return to ascii without unlatch
$enc = ENC_ASCII;
if ($enc == ENC_ASCII) {
break; // exit from EDIFACT mode
} else {
$newenc = $this->lookAheadTest($data, $pos, $enc);
if ($newenc != $enc) {
// 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
$enc = $newenc;
$cw[] = $this->getSwitchEncodingCodeword($enc);
++$cw_num;
break; // exit from EDIFACT mode
}
}
}
}
} while ($epos < $data_lenght);
break;
}
case ENC_BASE256: { // G. While in Base 256 (B256) encodation
@ -908,7 +910,7 @@ class Datamatrix {
break; // exit from B256 mode
} else {
// 2. Otherwise, process the next character in Base 256 encodation.
$chr = ord($data{($pos)});
$chr = ord($data[$pos]);
++$pos;
$temp_cw[] = $chr;
++$field_lenght;
@ -1076,7 +1078,6 @@ class Datamatrix {
return $marr;
}
/**
* Build a placement map.
* (Annex F - ECC 200 symbol character placement)
@ -1085,7 +1086,7 @@ class Datamatrix {
* @return array
* @protected
*/
protected function getPlacemetMap($nrow, $ncol) {
protected function getPlacementMap($nrow, $ncol) {
// initialize array with zeros
$marr = array_fill(0, ($nrow * $ncol), 0);
// set starting values

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -114,6 +114,20 @@ INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, act
-- Regions Germany (id country=5)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (501, 5, 501, '', 0, 'Deutschland', 1);
-- Regions Greece (id_country=102)
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10201, 10201, 102, NULL, NULL, 'Αττική', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10202, 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10203, 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10204, 10204, 102, NULL, NULL, 'Κρήτη', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10205, 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10206, 10206, 102, NULL, NULL, 'Ήπειρος', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10207, 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10208, 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10209, 10209, 102, NULL, NULL, 'Πελοπόννησος', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10210, 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10211, 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10212, 10212, 102, NULL, NULL, 'Θεσσαλία', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10213, 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1);
-- Regions Switzerland (id country=6)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (601, 6, 601, '', 1, 'Cantons', 1);

View File

@ -356,6 +356,75 @@ INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) V
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'SH','SCHLESWIG-HOLSTEIN','Schleswig-Holstein',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'TH','THÜRINGEN','Thüringen',1);
-- Provinces Greece (id country=102)
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('66', 10201, NULL, NULL, NULL, 'Αθήνα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('00', 10205, NULL, NULL, NULL, 'Δράμα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 10205, NULL, NULL, NULL, 'Έβρος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('02', 10205, NULL, NULL, NULL, 'Θάσος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('03', 10205, NULL, NULL, NULL, 'Καβάλα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('04', 10205, NULL, NULL, NULL, 'Ξάνθη', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('05', 10205, NULL, NULL, NULL, 'Ροδόπη', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('06', 10203, NULL, NULL, NULL, 'Ημαθία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('07', 10203, NULL, NULL, NULL, 'Θεσσαλονίκη', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('08', 10203, NULL, NULL, NULL, 'Κιλκίς', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('09', 10203, NULL, NULL, NULL, 'Πέλλα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('10', 10203, NULL, NULL, NULL, 'Πιερία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 10203, NULL, NULL, NULL, 'Σέρρες', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('12', 10203, NULL, NULL, NULL, 'Χαλκιδική', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('13', 10206, NULL, NULL, NULL, 'Άρτα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('14', 10206, NULL, NULL, NULL, 'Θεσπρωτία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('15', 10206, NULL, NULL, NULL, 'Ιωάννινα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('16', 10206, NULL, NULL, NULL, 'Πρέβεζα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('17', 10213, NULL, NULL, NULL, 'Γρεβενά', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('18', 10213, NULL, NULL, NULL, 'Καστοριά', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('19', 10213, NULL, NULL, NULL, 'Κοζάνη', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('20', 10213, NULL, NULL, NULL, 'Φλώρινα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('21', 10212, NULL, NULL, NULL, 'Καρδίτσα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('22', 10212, NULL, NULL, NULL, 'Λάρισα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('23', 10212, NULL, NULL, NULL, 'Μαγνησία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('24', 10212, NULL, NULL, NULL, 'Τρίκαλα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('25', 10212, NULL, NULL, NULL, 'Σποράδες', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('26', 10212, NULL, NULL, NULL, 'Βοιωτία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('27', 10202, NULL, NULL, NULL, 'Εύβοια', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('28', 10202, NULL, NULL, NULL, 'Ευρυτανία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('29', 10202, NULL, NULL, NULL, 'Φθιώτιδα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('30', 10202, NULL, NULL, NULL, 'Φωκίδα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('31', 10209, NULL, NULL, NULL, 'Αργολίδα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('32', 10209, NULL, NULL, NULL, 'Αρκαδία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('33', 10209, NULL, NULL, NULL, 'Κορινθία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('34', 10209, NULL, NULL, NULL, 'Λακωνία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('35', 10209, NULL, NULL, NULL, 'Μεσσηνία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('36', 10211, NULL, NULL, NULL, 'Αιτωλοακαρνανία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('37', 10211, NULL, NULL, NULL, 'Αχαΐα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('38', 10211, NULL, NULL, NULL, 'Ηλεία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('39', 10207, NULL, NULL, NULL, 'Ζάκυνθος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('40', 10207, NULL, NULL, NULL, 'Κέρκυρα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('41', 10207, NULL, NULL, NULL, 'Κεφαλληνία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('42', 10207, NULL, NULL, NULL, 'Ιθάκη', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('43', 10207, NULL, NULL, NULL, 'Λευκάδα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('44', 10208, NULL, NULL, NULL, 'Ικαρία', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('45', 10208, NULL, NULL, NULL, 'Λέσβος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('46', 10208, NULL, NULL, NULL, 'Λήμνος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('47', 10208, NULL, NULL, NULL, 'Σάμος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('48', 10208, NULL, NULL, NULL, 'Χίος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('49', 10210, NULL, NULL, NULL, 'Άνδρος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('50', 10210, NULL, NULL, NULL, 'Θήρα', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('51', 10210, NULL, NULL, NULL, 'Κάλυμνος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('52', 10210, NULL, NULL, NULL, 'Κάρπαθος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('53', 10210, NULL, NULL, NULL, 'Κέα-Κύθνος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('54', 10210, NULL, NULL, NULL, 'Κω', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('55', 10210, NULL, NULL, NULL, 'Μήλος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('56', 10210, NULL, NULL, NULL, 'Μύκονος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('57', 10210, NULL, NULL, NULL, 'Νάξος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('58', 10210, NULL, NULL, NULL, 'Πάρος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('59', 10210, NULL, NULL, NULL, 'Ρόδος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('60', 10210, NULL, NULL, NULL, 'Σύρος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('61', 10210, NULL, NULL, NULL, 'Τήνος', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('62', 10204, NULL, NULL, NULL, 'Ηράκλειο', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('63', 10204, NULL, NULL, NULL, 'Λασίθι', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('64', 10204, NULL, NULL, NULL, 'Ρέθυμνο', 1);
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('65', 10204, NULL, NULL, NULL, 'Χανιά', 1);
-- Cantons Switzerland (id country=6)
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'AG','ARGOVIE','Argovie',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'AI','APPENZELL RHODES INTERIEURES','Appenzell Rhodes intérieures',1);

View File

@ -130,6 +130,17 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '506', 'KG
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '507', 'Ltd. - Limited Company');
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '508', 'OHG - Offene Handelsgesellschaft');
-- Greece
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10201',102,'Ατομική επιχείρηση',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10202',102,'Εταιρική επιχείρηση',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10203',102,'Ομόρρυθμη Εταιρεία Ο.Ε',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10204',102,'Ετερόρρυθμη Εταιρεία Ε.Ε',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10205',102,'Εταιρεία Περιορισμένης Ευθύνης Ε.Π.Ε',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10206',102,'Ανώνυμη Εταιρεία Α.Ε',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10207',102,'Ανώνυμη ναυτιλιακή εταιρεία Α.Ν.Ε',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10208',102,'Συνεταιρισμός',0,1);
INSERT INTO `llx_c_forme_juridique` (code,fk_pays,libelle,isvatexempted,active) VALUES ('10209',102,'Συμπλοιοκτησία',0,1);
-- Italy
INSERT INTO llx_c_forme_juridique (code,fk_pays,libelle,isvatexempted,active) VALUES ('301',3,'Società semplice',0,1);
INSERT INTO llx_c_forme_juridique (code,fk_pays,libelle,isvatexempted,active) VALUES ('302',3,'Società in nome collettivo s.n.c.',0,1);

View File

@ -300,7 +300,7 @@ create table llx_accounting_system
active smallint DEFAULT 0
)ENGINE=innodb;
ALTER TABLE llx_accounting_system ADD UNIQUE INDEX idx_accounting_system_pcg_version (pcg_version);
ALTER TABLE llx_accounting_system ADD UNIQUE INDEX uk_accounting_system_pcg_version (pcg_version);
create table llx_accountingaccount
(

View File

@ -18,5 +18,5 @@
-- ===========================================================================
ALTER TABLE llx_accounting_system ADD UNIQUE INDEX idx_accounting_system_pcg_version (pcg_version);
ALTER TABLE llx_accounting_system ADD UNIQUE INDEX uk_accounting_system_pcg_version (pcg_version);

View File

@ -103,6 +103,7 @@ ConciliatedBy=Reconciled by
DateConciliating=Reconcile date
BankLineConciliated=Transaction reconciled
CustomerInvoicePayment=Customer payment
CustomerInvoicePaymentBack=Customer payment back
SupplierInvoicePayment=Supplier payment
WithdrawalPayment=Withdrawal payment
SocialContributionPayment=Social contribution payment

View File

@ -58,6 +58,7 @@ Payment=Payment
PaymentBack=Payment back
Payments=Payments
PaymentsBack=Payments back
PaidBack=Paid back
DatePayment=Payment date
DeletePayment=Delete payment
ConfirmDeletePayment=Are you sure you want to delete this payment ?
@ -69,6 +70,7 @@ ReceivedCustomersPaymentsToValid=Received customers payments to validate
PaymentsReportsForYear=Payments reports for %s
PaymentsReports=Payments reports
PaymentsAlreadyDone=Payments already done
PaymentsBackAlreadyDone=Payments back already done
PaymentRule=Payment rule
PaymentMode=Payment type
PaymentConditions=Payment term
@ -181,10 +183,12 @@ ShowInvoiceDeposit=Show deposit invoice
ShowPayment=Show payment
File=File
AlreadyPaid=Already paid
AlreadyPaidBack=Already paid back
AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and deposits)
Abandoned=Abandoned
RemainderToPay=Remainder to pay
RemainderToTake=Remainder to take
RemainderToPayBack=Remainder to pay back
AmountExpected=Amount claimed
ExcessReceived=Excess received
EscompteOffered=Discount offered (payment before term)
@ -381,7 +385,10 @@ CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least
ExpectedToPay=Expected payment
PayedByThisPayment=Payed by this payment
ClosePaidInvoicesAutomatically=Classify "Payed" all standard or replacement invoices entierely payed.
ClosePaidCreditNotesAutomatically=Classify "Payed" all credit notes entierely paid back.
AllCompletelyPayedInvoiceWillBeClosed=All invoice with no remain to pay will be automatically closed to status "Payed".
ToMakePayment=Pay
ToMakePaymentBack=Pay back
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice
TypeContact_facture_external_BILLING=Customer invoice contact

View File

@ -80,7 +80,6 @@ TotalToPay=Total to pay
TotalVATReceived=Total VAT received
CustomerAccountancyCode=Customer accountancy code
SupplierAccountancyCode=Supplier accountancy code
AlreadyPaid=Already paid
AccountNumberShort=Account number
AccountNumber=Account number
NewAccount=New account
@ -109,8 +108,9 @@ AnnualByCompaniesDueDebtMode=Balance of income and expenses, detail by third par
AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third parties, mode <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b>.
SeeReportInInputOutputMode=See report <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b> for a calculation on actual payments made
SeeReportInDueDebtMode=See report <b>%sClaims-Debts%s</b> said <b>commitment accounting</b> for a calculation on issued invoices
RulesResultDue=- Amounts shown are with all taxes included<br>- It includes outstanding invoices, expenses and VAT whether they are paid or not. <br>- It is based on the validation date of invoices and VAT and on the due date for expenses.
RulesResultInOut=- Amounts shown are with all taxes included<br>- It includes the real payments made on invoices, expenses and VAT. <br>- It is based on the payment dates of the invoices, expenses anf VAT.<br>
RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included
RulesResultDue=- It includes outstanding invoices, expenses and VAT whether they are paid or not. <br>- It is based on the validation date of invoices and VAT and on the due date for expenses.
RulesResultInOut=- It includes the real payments made on invoices, expenses and VAT. <br>- It is based on the payment dates of the invoices, expenses anf VAT.
RulesCADue=- It includes the client's due invoices whether they are paid or not. <br>- It is based on the validation date of these invoices. <br>
RulesCAIn=- It includes all the effective payments of invoices received from clients.<br>- It is based on the payment date of these invoices<br>
DepositsAreNotIncluded=- Deposit invoices are nor included

View File

@ -103,6 +103,7 @@ ConciliatedBy=Rapproché par
DateConciliating=Date rapprochement
BankLineConciliated=Écriture rapprochée
CustomerInvoicePayment=Règlement client
CustomerInvoicePaymentBack=Remboursement client
SupplierInvoicePayment=Règlement fournisseur
WithdrawalPayment=Règlement bon de prélèvement
SocialContributionPayment=Règlement charge sociale

View File

@ -47,12 +47,14 @@ InvoiceCustomer=Facture client
CustomerInvoice=Facture client
CustomersInvoices=Factures clients
SupplierInvoice=Facture fournisseur
SuppliersInvoices=Factures fournisseurs
SupplierBill=Facture fournisseur
SupplierBills=Factures fournisseurs
Payment=Règlement
PaymentBack=Remboursement
Payments=Règlements
PaymentsBack=Remboursements
PaidBack=Remboursé
DatePayment=Date paiement
DeletePayment=Supprimer le paiement
ConfirmDeletePayment=Êtes-vous sûr de vouloir supprimer ce paiement ?
@ -64,6 +66,7 @@ ReceivedCustomersPaymentsToValid=Règlements clients reçus à valider
PaymentsReportsForYear=Rapports de règlements pour %s
PaymentsReports=Rapports de règlements
PaymentsAlreadyDone=Versements déjà effectués
PaymentsBackAlreadyDone=Remboursements déjà effectués
PaymentMode=Mode de règlement
PaymentConditions=Conditions de règlement
PaymentConditionsShort=Conditions règlement
@ -86,7 +89,7 @@ DoPayment=Émettre règlement
DoPaymentBack=Émettre remboursement
ConvertToReduc=Convertir en réduction future
EnterPaymentReceivedFromCustomer=Saisie d'un règlement reçu du client
EnterPaymentDueToCustomer=Réaliser règlement d'avoirs dus au client
EnterPaymentDueToCustomer=Saisie d'un remboursement d'un avoir client
DisabledBecauseRemainderToPayIsZero=Désactivé car reste à payer est nul
Amount=Montant
PriceBase=Base du prix
@ -175,10 +178,12 @@ ShowInvoiceDeposit=Afficher facture d'acompte
ShowPayment=Afficher règlement
File=Fichier
AlreadyPaid=Déjà réglé
AlreadyPaidBack=Déjà remboursé
AlreadyPaidNoCreditNotesNoDeposits=Déjà réglé (hors avoirs et acomptes)
Abandoned=Abandonné
RemainderToPay=Reste à payer
RemainderToTake=Reste à encaisser
RemainderToPayBack=Reste à rembourser
AmountExpected=Montant réclamé
ExcessReceived=Trop perçu
EscompteOffered=Escompte (règlement avant échéance)
@ -377,7 +382,10 @@ CantRemovePaymentWithOneInvoicePaid=Suppression impossible quand il existe au mo
ExpectedToPay=Paiement attendu
PayedByThisPayment=Règlé par ce paiement
ClosePaidInvoicesAutomatically=Classer automatiquement à "Payé" les factures standards et de remplacement entièrement payées.
ClosePaidCreditNotesAutomatically=Classer automatiquement à "Payé" les factures avoirs entièrement remboursées.
AllCompletelyPayedInvoiceWillBeClosed=Toutes les factures avec un reste à payer nul seront automatiquement fermées au statut "Payé".
ToMakePayment=Payer
ToMakePaymentBack=Rembourser
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Responsable suivi facture client
TypeContact_facture_external_BILLING=Contact client facturation

View File

@ -80,7 +80,6 @@ TotalToPay=Total à payer
TotalVATReceived=Total TVA perçue
CustomerAccountancyCode=Compte comptable client
SupplierAccountancyCode=Compte comptable fournisseur
AlreadyPaid=Déjà réglé
AccountNumberShort=N° du compte
AccountNumber=Numéro du compte
NewAccount=Nouveau compte
@ -109,8 +108,9 @@ AnnualByCompaniesDueDebtMode=Bilan des recettes et dépenses, détail par tiers,
AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par tiers, en mode <b>%sRecettes-Dépenses%s</b> dit <b>comptabilité de caisse</b>.
SeeReportInInputOutputMode=Voir le rapport <b>%sRecettes-Dépenses%s</b> dit <b>comptabilité de caisse</b> pour un calcul sur les paiements effectivement réalisés
SeeReportInDueDebtMode=Voir le rapport <b>%sCréances-Dettes%s</b> dit <b>comptabilité d'engagement</b> pour un calcul sur les factures émises
RulesResultDue=- Les montants affichés sont les montants taxe incluse<br>- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges.<br>
RulesResultInOut=- Les montants affichés sont les montants taxe incluse<br>- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TVA.<br>- Il se base sur la date de règlement de ces factures, charges et TVA.<br>
RulesAmountWithTaxIncluded=- Les montants affichés sont les montants taxe incluse
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges.
RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TVA.<br>- Il se base sur la date de règlement de ces factures, charges et TVA.
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
RulesCAIn=- Il inclut les règlements effectivement reçus des factures clients.<br>- Il se base sur la date de règlement de ces factures<br>
DepositsAreNotIncluded=- Les factures d'accomptes ne sont pas incluses

View File

@ -316,7 +316,7 @@ Option=Option
List=Liste
FullList=Liste complète
Statistics=Statistiques
OtherStatistics=Autres statistics
OtherStatistics=Autres statistiques
Status=État
Ref=Réf.
RefSupplier=Réf. fournisseur

View File

@ -1,12 +1,13 @@
# Dolibarr language file - ja_JP - main
CHARSET=UTF-8
DIRECTION=ltr
FONTFORPDF=arialunicid0
#FONTSIZEFORPDF=9
FONTFORPDF=cid0jp
FONTSIZEFORPDF=9
// START - Lines generated via autotranslator.php tool (2012-02-29 16:41:06).
// Reference language: en_US -> ja_JP
SeparatorDecimal=
SeparatorDecimal=.
SeparatorThousand=、
FormatDateShort=%m/%d/%Y
FormatDateShortJava=MM/dd/yyyy

View File

@ -718,7 +718,7 @@ class User extends CommonObject
}
}
// Removed extrafields
// Remove extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
{
$result=$this->deleteExtraFields($this);

View File

@ -171,13 +171,60 @@ class BuildDocTest extends PHPUnit_Framework_TestCase
$localobject->createFromOrder($localobjectcom);
$localobject->date_lim_reglement = dol_now() + 3600 * 24 *30;
// Crabe
// Crabe (english)
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $langs);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (japanese)
$newlangs1=new Translate("",$conf);
$newlangs1->setDefaultLang('ja_JP');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs1);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (saudiarabia)
$newlangs2a=new Translate("",$conf);
$newlangs2a->setDefaultLang('sa_SA');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs2a);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (english_saudiarabia)
$newlangs2b=new Translate("",$conf);
$newlangs2b->setDefaultLang('en_SA');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs2b);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (greek)
$newlangs3=new Translate("",$conf);
$newlangs3->setDefaultLang('el_GR');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs3);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (chinese)
$newlangs4=new Translate("",$conf);
$newlangs4->setDefaultLang('zh_CN');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs4);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
// Crabe (russian)
$newlangs5=new Translate("",$conf);
$newlangs5->setDefaultLang('ru_RU');
$localobject->modelpdf='crabe';
$result=facture_pdf_create($db, $localobject, $localobject->modelpdf, $newlangs);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
return 0;
}