Merge pull request #19143 from andreubisquerra/develop
TakePOS Split Sale fixes and improvements
This commit is contained in:
commit
6832893cb8
@ -1719,7 +1719,13 @@ if ($resql) {
|
|||||||
|
|
||||||
print '<tr class="oddeven"';
|
print '<tr class="oddeven"';
|
||||||
if ($contextpage == 'poslist') {
|
if ($contextpage == 'poslist') {
|
||||||
print ' onclick="parent.$(\'#poslines\').load(\'invoice.php?action=history&placeid='.$obj->id.'\', function() {parent.$.colorbox.close();});"';
|
print ' onclick="parent.$(\'#poslines\').load(\'invoice.php?action=history&placeid='.$obj->id.'\', function() {parent.$.colorbox.close();';
|
||||||
|
if (strpos($obj->ref, 'PROV') !== false) {
|
||||||
|
//If is a draft invoice, load var to be able to add products
|
||||||
|
$place = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref));
|
||||||
|
print 'parent.place=\''.$place.'\'';
|
||||||
|
}
|
||||||
|
print '});"';
|
||||||
}
|
}
|
||||||
print '>';
|
print '>';
|
||||||
|
|
||||||
|
|||||||
@ -103,12 +103,10 @@ if ($action=="split") {
|
|||||||
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
dol_htmloutput_errors($invoice->error, $invoice->errors, 1);
|
||||||
}
|
}
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
|
||||||
echo $sql;
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set fk_facture=".$placeid." where rowid=".$line;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set fk_facture=".$placeid." where rowid=".$line;
|
||||||
echo $sql;
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
$invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-SPLIT)');
|
$invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-SPLIT)');
|
||||||
@ -167,11 +165,11 @@ if ($conf->global->TAKEPOS_COLOR_THEME == 1) {
|
|||||||
<script>
|
<script>
|
||||||
function Split(selectedline, split) {
|
function Split(selectedline, split) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "split.php?action=split&line="+selectedline+"&split="+split,
|
url: "split.php?action=split&line="+selectedline+"&split="+split+"&place=<?php echo $place;?>",
|
||||||
context: document.body
|
context: document.body
|
||||||
}).done(function() {
|
}).done(function() {
|
||||||
$("#currentplace").load("invoice.php?place="+parent.place+"&invoiceid="+parent.invoiceid, function() {
|
$("#currentplace").load("invoice.php?place="+parent.place+"&invoiceid="+parent.invoiceid, function() {
|
||||||
$('.posinvoiceline').click(function(){
|
$('#currentplace').find('.posinvoiceline').click(function(){
|
||||||
Split(this.id, 1);
|
Split(this.id, 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -184,6 +182,11 @@ function Split(selectedline, split) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
if (parent.place=='SPLIT') {
|
||||||
|
parent.place=0;
|
||||||
|
parent.invoiceid=0;
|
||||||
|
parent.Refresh();
|
||||||
|
}
|
||||||
$("#currentplace").load("invoice.php?place="+parent.place+"&invoiceid="+parent.invoiceid, function() {
|
$("#currentplace").load("invoice.php?place="+parent.place+"&invoiceid="+parent.invoiceid, function() {
|
||||||
$('#currentplace').find('.posinvoiceline')
|
$('#currentplace').find('.posinvoiceline')
|
||||||
.click(function(){
|
.click(function(){
|
||||||
@ -197,7 +200,7 @@ $( document ).ready(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (parent.place=='SPLIT') parent.place=0;
|
|
||||||
|
|
||||||
$("#headersplit1").html("<?php echo $langs->trans("Place");?> "+parent.place);
|
$("#headersplit1").html("<?php echo $langs->trans("Place");?> "+parent.place);
|
||||||
$("#headersplit2").html("<?php echo $langs->trans("SplitSale");?>");
|
$("#headersplit2").html("<?php echo $langs->trans("SplitSale");?>");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user