Delivery contact on ZS realization list

This commit is contained in:
2025-11-30 15:46:59 +00:00
parent 7312918962
commit 2424bb76a3
2 changed files with 253 additions and 234 deletions

View File

@@ -1059,6 +1059,16 @@ class EcmSale extends SugarBean
$result_array[$i]['total_invoice'] = $total_invoice; $result_array[$i]['total_invoice'] = $total_invoice;
$result_array[$i]['percent'] = $percent; $result_array[$i]['percent'] = $percent;
$result_array[$i]['currency'] = $r['currency_id']; $result_array[$i]['currency'] = $r['currency_id'];
$result_array[$i]['delivery_name'] = null;
if (strlen($r['shipping_address_name']) > 0) {
$result_array[$i]['delivery_name'] = $r['shipping_address_name'];
$d = $db->fetchByAssoc($db->query(sprintf("SELECT id, TRIM(name) FROM accounts WHERE name LIKE '%s' AND deleted=0", strtolower(trim($r['shipping_address_name'])))));
if ($d && $d['id']) {
$result_array[$i]['delivery_id'] = $d['id'];
}
}
$i++; $i++;
$sum_total_qty += $total_qty; $sum_total_qty += $total_qty;

View File

@@ -1,16 +1,15 @@
<script type="text/javascript" <script type="text/javascript" src="include/ECM/EcmMultiPdf/EcmMultiPdf.js"></script>
src="include/ECM/EcmMultiPdf/EcmMultiPdf.js"></script> <script type="text/javascript" src="include/jQuery/jquery.blockUI.js"></script>
<script type="text/javascript"
src="include/jQuery/jquery.blockUI.js"></script>
<table cellspacing="0" cellpadding="0" border="0"> <table cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td><img src="themes/Sugar/images/EcmProducts.gif" <td><img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts"
style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts"
width="16" border="0" height="16"></td> width="16" border="0" height="16"></td>
<td><h2>{$MOD.LBL_LISTNEWSALES_NAME}</h2></td> <td>
<h2>{$MOD.LBL_LISTNEWSALES_NAME}</h2>
</td>
</tr> </tr>
</table> </table>
<br/> <br />
<form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales"> <form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales">
<ul class="tablist" style="width:100%;"> <ul class="tablist" style="width:100%;">
<input type="hidden" name="module" value="EcmSales"> <input type="hidden" name="module" value="EcmSales">
@@ -27,8 +26,8 @@
</td> </td>
<td nowrap=""> <td nowrap="">
<input type="text" maxlength="10" size="11" tabindex="" title="" <input type="text" maxlength="10" size="11" tabindex="" title=""
value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_from" value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
name="date_send_from" autocomplete="off"> id="date_send_from" name="date_send_from" autocomplete="off">
<img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger" <img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger"
alt="Enter Date" src="themes/default/images/jscalendar.gif"> alt="Enter Date" src="themes/default/images/jscalendar.gif">
<script type="text/javascript"> <script type="text/javascript">
@@ -42,16 +41,15 @@
dateStr: "", dateStr: "",
step: 1, step: 1,
weekNumbers: false weekNumbers: false
} });
);
{/literal} {/literal}
</script> </script>
{$MOD.LBL_LISTNEWSALES_DATE_END}: {$MOD.LBL_LISTNEWSALES_DATE_END}:
<input type="text" maxlength="10" size="11" tabindex="" title="" <input type="text" maxlength="10" size="11" tabindex="" title=""
value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_to" value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}"
name="date_send_to" autocomplete="off"> id="date_send_to" name="date_send_to" autocomplete="off">
<img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date" <img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date"
src="themes/default/images/jscalendar.gif"> src="themes/default/images/jscalendar.gif">
<script type="text/javascript"> <script type="text/javascript">
@@ -65,8 +63,7 @@
dateStr: "", dateStr: "",
step: 1, step: 1,
weekNumbers: false weekNumbers: false
} });
);
{/literal} {/literal}
</script> </script>
</td> </td>
@@ -74,7 +71,8 @@
<td rowspan="2"> <td rowspan="2">
<select id="sale_type" name="sale_type[]" multiple="true"> <select id="sale_type" name="sale_type[]" multiple="true">
{foreach from=$SALE_TYPES key="key" item="value" name="sale_types"} {foreach from=$SALE_TYPES key="key" item="value" name="sale_types"}
<option {if in_array($key, $SELECTED_TYPES)}selected="selected" {/if} value="{$key}">{$value}</option> <option {if in_array($key, $SELECTED_TYPES)}selected="selected" {/if} value="{$key}">{$value}
</option>
{/foreach} {/foreach}
</select> </select>
</td> </td>
@@ -82,7 +80,8 @@
<td rowspan="2"> <td rowspan="2">
<select id="sale_status" name="sale_status[]" multiple="true"> <select id="sale_status" name="sale_status[]" multiple="true">
{foreach from=$SALE_STATUSES key="key" item="value" name="sale_statuses"} {foreach from=$SALE_STATUSES key="key" item="value" name="sale_statuses"}
<option {if in_array($key, $SELECTED_STATUSES)}selected="selected" {/if} value="{$key}">{$value}</option> <option {if in_array($key, $SELECTED_STATUSES)}selected="selected" {/if} value="{$key}">{$value}
</option>
{/foreach} {/foreach}
</select> </select>
</td> </td>
@@ -118,8 +117,8 @@
</td> </td>
<td nowrap=""> <td nowrap="">
<input type="text" maxlength="10" size="11" tabindex="" title="" <input type="text" maxlength="10" size="11" tabindex="" title=""
value="{if $POST.date_from!=''}{$POST.date_from}{/if}" value="{if $POST.date_from!=''}{$POST.date_from}{/if}" id="date_from" name="date_from"
id="date_from" name="date_from" autocomplete="off"> autocomplete="off">
<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date" <img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date"
src="themes/default/images/jscalendar.gif"> src="themes/default/images/jscalendar.gif">
<script type="text/javascript"> <script type="text/javascript">
@@ -133,14 +132,12 @@
dateStr: "", dateStr: "",
step: 1, step: 1,
weekNumbers: false weekNumbers: false
} });
);
{/literal} {/literal}
</script> </script>
do: do:
<input type="text" maxlength="10" size="11" tabindex="" title="" <input type="text" maxlength="10" size="11" tabindex="" title=""
value="{if $POST.date_to!=''}{$POST.date_to}{/if}" value="{if $POST.date_to!=''}{$POST.date_to}{/if}" id="date_to" name="date_to" autocomplete="off">
id="date_to" name="date_to" autocomplete="off">
<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date" <img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date"
src="themes/default/images/jscalendar.gif"> src="themes/default/images/jscalendar.gif">
<script type="text/javascript"> <script type="text/javascript">
@@ -154,8 +151,7 @@
dateStr: "", dateStr: "",
step: 1, step: 1,
weekNumbers: false weekNumbers: false
} });
);
{/literal} {/literal}
</script> </script>
</td> </td>
@@ -170,7 +166,8 @@
</table> </table>
<h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę wysyłki{/if}</h3> <h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę
wysyłki{/if}</h3>
<input type="hidden" id="idss" value=""> <input type="hidden" id="idss" value="">
<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button"> <input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
<input type="button" onclick="location.href='index.php?module=EcmSales&amp;action=ListNewSales';" <input type="button" onclick="location.href='index.php?module=EcmSales&amp;action=ListNewSales';"
@@ -219,21 +216,30 @@
</td> </td>
<td></td> <td></td>
<td> <td>
<a href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a> <a
href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a>
{if $item.delivery_name}
{if $item.delivery_id}
&nbsp;(<a
href="index.php?module=Accounts&action=DetailView&record={$item.delivery_id}">{$item.delivery_name}</a>)
{else}
&nbsp;({$item.delivery_name})
{/if}
{/if}
</td> </td>
<td>{$item.delivery_date}</td> <td>{$item.delivery_date}</td>
<td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if} <td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if} disabled="disabled">
disabled="disabled"></td> </td>
<td>{$item.send_date} </td> <td>{$item.send_date} </td>
<td style="text-align: right">{$item.quantity}</td> <td style="text-align: right">{$item.quantity}</td>
<td data-total="{$item.total_netto}" <td data-total="{$item.total_netto}" style="text-align: right">
style="text-align: right">{$item.total_netto|number_format:2:".":","}</td> {$item.total_netto|number_format:2:".":","}</td>
<td data-total="{$item.total_vat}" <td data-total="{$item.total_vat}" style="text-align: right">{$item.total_vat|number_format:2:".":","}
style="text-align: right">{$item.total_vat|number_format:2:".":","}</td> </td>
<td data-total="{$item.total_brutto}" <td data-total="{$item.total_brutto}" style="text-align: right">
style="text-align: right">{$item.total_brutto|number_format:2:".":","}</td> {$item.total_brutto|number_format:2:".":","}</td>
<td data-total="{$item.total_invoice}" <td data-total="{$item.total_invoice}" style="text-align: right">
style="text-align: right">{$item.total_invoice|number_format:2:".":","}</td> {$item.total_invoice|number_format:2:".":","}</td>
<td style="text-align: right">{$item.percent}<a style="cursor:pointer;" <td style="text-align: right">{$item.percent}<a style="cursor:pointer;"
onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img
border="0" src="modules/EcmQuotes/images/search.gif"></a> border="0" src="modules/EcmQuotes/images/search.gif"></a>
@@ -274,14 +280,16 @@
<td></td> <td></td>
<td></td> <td></td>
<td> <td>
<span style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span> <span
style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td> <td>
<span style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span> <span
style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@@ -293,12 +301,11 @@
<td> <td>
{if $item.type!='gratis'} {if $item.type!='gratis'}
{if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}" {if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}"
src="modules/EcmSales/images/convert_disabled.gif" src="modules/EcmSales/images/convert_disabled.gif" title="{$item.fv_name}"
title="{$item.fv_name}" style="cursor:pointer;" style="cursor:pointer;"
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if} onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if}
{if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}" {if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}"
src="modules/EcmSales/images/convert_enabled.gif" src="modules/EcmSales/images/convert_enabled.gif" title="Create Invoice"
title="Create Invoice"
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}" onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}"
style="cursor:pointer;" />{/if} style="cursor:pointer;" />{/if}
{if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif" {if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
@@ -381,14 +388,16 @@
<td></td> <td></td>
<td></td> <td></td>
<td> <td>
<span style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span> <span
style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td> <td>
<span style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span> <span
style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>