Merge pull request #10087 from AurelGDN/develop

New Takepos: cheque payment button in cashdesk
This commit is contained in:
Laurent Destailleur 2018-12-01 15:03:19 +01:00 committed by GitHub
commit 03f0922325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 6 deletions

View File

@ -47,6 +47,21 @@ button.calcbutton2 {
height:24%;
}
button.calcbutton3 {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
cursor: pointer;
vertical-align: middle;
text-align: center;
font-size:120%;
overflow: visible; /* removes extra width in IE */
width:12%;
height:24%;
}
button.actionbutton {
display: inline-block;
position: relative;
@ -110,5 +125,5 @@ div.description{
p.description_content{
padding:10px;
margin:0px;
}

View File

@ -57,6 +57,7 @@ else{
if ($action == 'valid' && $user->rights->facture->creer){
if ($pay=="cash") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CASH;
else if ($pay=="card") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
else if ($pay=="cheque") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
$now=dol_now();
$invoice = new Facture($db);
$invoice->fetch($placeid);
@ -69,6 +70,7 @@ if ($action == 'valid' && $user->rights->facture->creer){
$payment->amounts[$invoice->id]=$invoice->total_ttc;
if ($pay=="cash") $payment->paiementid=4;
else if ($pay=="card") $payment->paiementid=6;
else if ($pay=="cheque") $payment->paiementid=7;
$payment->num_paiement=$invoice->facnumber;
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');

View File

@ -101,20 +101,21 @@ $langs->loadLangs(array("main", "bills", "cashdesk"));
<button type="button" class="calcbutton" onclick="addreceived(10);">10</button>
<button type="button" class="calcbutton" onclick="addreceived(20);">20</button>
<button type="button" class="calcbutton" onclick="addreceived(50);">50</button>
<button type="button" <?php if ($placeid==0) echo "disabled";?> class="calcbutton2" onclick="Validate('cash');"><?php echo $langs->trans("Cash"); ?></button>
<button type="button" class="calcbutton2" onclick="Validate('cash');"><?php echo $langs->trans("Cash"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(1);">1</button>
<button type="button" class="calcbutton" onclick="addreceived(2);">2</button>
<button type="button" class="calcbutton" onclick="addreceived(5);">5</button>
<button type="button" <?php if ($placeid==0) echo "disabled";?> class="calcbutton2" onclick="Validate('card');"><?php echo $langs->trans("PaymentTypeCB"); ?></button>
<button type="button" class="calcbutton2" onclick="Validate('card');"><?php echo $langs->trans("PaymentTypeCB"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(0.10);">0.10</button>
<button type="button" class="calcbutton" onclick="addreceived(0.20);">0.20</button>
<button type="button" class="calcbutton" onclick="addreceived(0.50);">0.50</button>
<button type="button" class="calcbutton2" onclick="parent.$.colorbox.close();"><span id="printtext"><?php echo $langs->trans("GoBack"); ?></span></button>
<button type="button" class="calcbutton2" onclick="Validate('cheque');"><?php echo $langs->trans("Cheque"); ?></button>
<button type="button" class="calcbutton" onclick="addreceived(0.01);">0.01</button>
<button type="button" class="calcbutton" onclick="addreceived(0.02);">0.02</button>
<button type="button" class="calcbutton" onclick="addreceived(0.05);">0.05</button>
<button type="button" class="calcbutton2" onclick="reset();"><span style='font-size: 150%;'>C</span></button>
<button type="button" class="calcbutton3" onclick="reset();"><span style='font-size: 150%;'>C</span></button>
<button type="button" class="calcbutton3" onclick="printclick();"><span id="printtext"><?php echo $langs->trans("GoBack"); ?></span></button>
</div>
</body>
</html>
</html>