24 if (empty($langs) || !is_object($langs))
26 print "Error, template page can't be called as URL";
31 $langs->loadLangs(array(
"main",
"bills",
"cashdesk"));
37 <script
type=
"text/javascript" src=
"javascript/facturation1.js"></script>
38 <script type=
"text/javascript" src=
"javascript/dhtml.js"></script>
39 <script type=
"text/javascript" src=
"javascript/keypad.js"></script>
41 <!-- ========================= Cadre
"Article" ============================= -->
42 <fieldset
class=
"cadre_facturation"><legend
class=
"titre1"><?php echo $langs->trans(
"Article"); ?></legend>
43 <form
id=
"frmFacturation" class=
"formulaire1" method=
"post" action=
"facturation_verif.php" autocomplete=
"off">
44 <input type=
"hidden" name=
"token" value=
"<?php echo newToken(); ?>" />
46 <input type=
"hidden" name=
"hdnSource" value=
"NULL" />
48 <table
class=
"center">
49 <tr><th
class=
"label1"><?php echo $langs->trans(
"FilterRefOrLabelOrBC"); ?></th><th
class=
"label1"><?php echo $langs->trans(
"Designation"); ?></th></tr>
51 <!-- Affichage de la reference et de la designation -->
52 <!-- Suppression de l
'attribut onkeyup qui causait un probleme d'emulation avec les douchettes -->
53 <td><input
class=
"texte_ref" type=
"text" id =
"txtRef" name=
"txtRef" value=
"<?php echo $obj_facturation->ref() ?>"
54 onchange=
"javascript: setSource('REF');"
55 onfocus=
"javascript: this.select();" />
57 <td
class=
"select_design maxwidthonsmartphone">
58 <select
id=
"selProduit" class=
"maxwidthonsmartphone" name=
"selProduit" onchange=
"javascript: setSource('LISTE');">
60 print '<option value="0">'.$top_liste_produits.
'</option>'.
"\n";
62 $id = $obj_facturation->id();
66 $nbtoshow = $nbr_enreg;
67 if (!empty($conf_taille_listes) && $nbtoshow > $conf_taille_listes) $nbtoshow = $conf_taille_listes;
69 for ($i = 0; $i < $nbtoshow; $i++)
71 if ($id == $tab_designations[$i][
'rowid']) {
72 $selected =
'selected';
77 $label = $tab_designations[$i][
'label'];
79 print '<option '.$selected.
' value="'.$tab_designations[$i][
'rowid'].
'">'.
dol_trunc($tab_designations[$i][
'ref'], 16).
' - '.
dol_trunc($label, 35,
'middle');
80 if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i][
'fk_product_type'] == 0) {
81 print ' ('.$langs->trans(
"CashDeskStock").
': '.(empty($tab_designations[$i][
'reel']) ? 0 : $tab_designations[$i][
'reel']).
')';
83 print '</option>'.
"\n";
92 <form
id=
"frmQte" class=
"formulaire1" method=
"post" action=
"facturation_verif.php?action=ajout_article" onsubmit =
"javascript: return verifSaisie();">
93 <input type=
"hidden" name=
"token" value=
"<?php echo newToken(); ?>" />
94 <table
class=
"center">
96 <th><?php echo $langs->trans(
"Qty"); ?></th>
97 <th><?php echo $langs->trans(
"PriceUHT"); ?></th>
98 <th><?php echo $langs->trans(
"Discount"); ?> (%)</th>
99 <th><?php echo $langs->trans(
"VATRate"); ?></th>
103 <td><input
class=
"texte1 maxwidth50onsmartphone" type=
"text" id=
"txtQte" name=
"txtQte" value=
"1" onkeyup=
"javascript: modif();" onfocus=
"javascript: this.select();" />
104 <?php
print genkeypad(
"txtQte",
"frmQte"); ?>
106 <!-- Show unit
price -->
108 <td><input
class=
"texte1_off maxwidth50onsmartphone" type=
"text" name=
"txtPrixUnit" value=
"<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange=
"javascript: modif();" disabled /></td>
109 <!-- Choix de la remise -->
110 <td><input
class=
"texte1 maxwidth50onsmartphone" type=
"text" id=
"txtRemise" name=
"txtRemise" value=
"0" onkeyup=
"javascript: modif();" onfocus=
"javascript: this.select();"/>
111 <?php
print genkeypad(
"txtRemise",
"frmQte"); ?>
113 <!-- Choix du taux de TVA -->
114 <td
class=
"select_tva center">
116 $vatrate = $obj_facturation->vatrate;
119 if ($_SESSION[
"CASHDESK_ID_THIRDPARTY"] > 0) $buyer->fetch($_SESSION[
"CASHDESK_ID_THIRDPARTY"]);
120 echo $form->load_tva(
'selTva', (
GETPOSTISSET(
"selTva") ?
GETPOST(
"selTva",
'alpha', 2) : $vatrate), $mysoc, $buyer, 0, 0,
'',
false, -1);
126 <!-- Affichage du stock pour l
'article courant -->
128 <td><?php echo $langs->trans("Stock"); ?></td>
130 <input class="texte1_off maxwidth50onsmartphone" type="text" name="txtStock" value="<?php echo $obj_facturation->stock() ?>" disabled />
132 <td><?php echo $langs->trans("TotalHT"); ?></td>
133 <!-- Affichage du total HT -->
134 <td colspan="2"><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
139 <input class="button bouton_ajout_article" type="submit" id="sbmtEnvoyer" value="<?php echo $langs->trans("AddThisArticle"); ?>" />
143 <!-- ========================= Cadre "Amount" ============================= -->
144 <form id="frmDifference" class="formulaire1" method="post" onsubmit="javascript: return verifReglement()" action="validation_verif.php?action=validate_sell">
145 <input type="hidden" name="hdnChoix" value="" />
146 <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
147 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
148 <table class="centpercent">
149 <tr><th class="label1"><?php echo $langs->trans("TotalTicket"); ?></th><th class="label1"><?php echo $langs->trans("Received"); ?></th><th class="label1"><?php echo $langs->trans("Change"); ?></th></tr>
151 <!-- Affichage du montant du -->
152 <td><input class="texte2_off maxwidth100onsmartphone" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->amountWithTax(), 'MT
'); ?>" disabled /></td>
153 <!-- Choix du montant encaisse -->
154 <td><input class="texte2 maxwidth100onsmartphone" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
155 <?php print genkeypad("txtEncaisse", "frmDifference"); ?>
157 <!-- Affichage du montant rendu -->
158 <td><input class="texte2_off maxwidth100onsmartphone" type="text" name="txtRendu" value="0" disabled /></td>
164 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("PaymentMode"); ?></legend>
165 <div class="inline-block">
167 print '<div
class=
"inline-block" style=
"margin: 6px;">
';
168 if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CASH
']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CASH
'] < 0)
170 $langs->load("errors");
171 print '<input
class=
"bouton_mode_reglement_disabled" type=
"button" name=
"btnModeReglement" value=
"'.$langs->trans("Cash
").'" title=
"'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete
", $langs->transnoentitiesnoconv("CashDesk
"))).'" />
';
172 } else print '<input
class=
"button bouton_mode_reglement" type=
"submit" name=
"btnModeReglement" value=
"'.$langs->trans("Cash
").'" onclick=
"javascript: verifClic(\'ESP\');" />
';
174 print '<div
class=
"inline-block" style=
"margin: 6px;">
';
175 if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB
']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB
'] < 0)
177 $langs->load("errors");
178 print '<input
class=
"bouton_mode_reglement_disabled" type=
"button" name=
"btnModeReglement" value=
"'.$langs->trans("CreditCard
").'" title=
"'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete
", $langs->transnoentitiesnoconv("CashDesk
"))).'" />
';
179 } else print '<input
class=
"button bouton_mode_reglement" type=
"submit" name=
"btnModeReglement" value=
"'.$langs->trans("CreditCard
").'" onclick=
"javascript: verifClic(\'CB\');" />
';
181 print '<div
class=
"inline-block" style=
"margin: 6px;">
';
182 if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE
']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE
'] < 0)
184 $langs->load("errors");
185 print '<input
class=
"bouton_mode_reglement_disabled" type=
"button" name=
"btnModeReglement" value=
"'.$langs->trans("CheckBank
").'" title=
"'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete
"), $langs->transnoentitiesnoconv("CashDesk
")).'" />
';
186 } else print '<input
class=
"button bouton_mode_reglement" type=
"submit" name=
"btnModeReglement" value=
"'.$langs->trans("CheckBank
").'" onclick=
"javascript: verifClic(\'CHQ\');" />
';
188 print '<div
class=
"clearboth">
';
189 print '<div
class=
"inline-block" style=
"margin: 6px;">
';
191 <input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF
');" />
193 print $langs->trans("DateDue").' :
';
194 print $form->selectDate(-1, 'txtDatePaiement
', 0, 0, 0, 'paymentmode
', 1, 0);
201 <script type="text/javascript">
203 inputField : "txtDatePaiement",
204 ifFormat : "%Y-%m-%d",
205 button : "btnCalendrier"
208 if (document.getElementById('frmFacturation
').txtRef.value) {
211 document.getElementById('frmQte
').txtQte.focus();
212 document.getElementById('frmQte
').txtQte.select();
216 document.getElementById('frmFacturation
').txtRef.focus();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
$conf db name
Only used if Module[ID]Name translation string is not found.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print
Draft customers invoices.
dol_trunc($string, $size=40, $trunc= 'right', $stringencoding= 'UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type