diff --git a/modules/EcmSales/EcmSale.php b/modules/EcmSales/EcmSale.php index 67f1554b..374363ab 100644 --- a/modules/EcmSales/EcmSale.php +++ b/modules/EcmSales/EcmSale.php @@ -1059,6 +1059,16 @@ class EcmSale extends SugarBean $result_array[$i]['total_invoice'] = $total_invoice; $result_array[$i]['percent'] = $percent; $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++; $sum_total_qty += $total_qty; diff --git a/modules/EcmSales/tpls/ListNewSales.tpl b/modules/EcmSales/tpls/ListNewSales.tpl index 7cc18504..225a464e 100644 --- a/modules/EcmSales/tpls/ListNewSales.tpl +++ b/modules/EcmSales/tpls/ListNewSales.tpl @@ -1,16 +1,15 @@ - - + + - - + +
EcmProducts

{$MOD.LBL_LISTNEWSALES_NAME}

EcmProducts +

{$MOD.LBL_LISTNEWSALES_NAME}

+
-
+
+ cellspacing="0"> @@ -74,7 +71,8 @@ @@ -82,7 +80,8 @@ @@ -91,17 +90,17 @@ @@ -118,14 +117,14 @@ @@ -164,169 +160,180 @@
Data wysyłki od + value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" + id="date_send_from" name="date_send_from" autocomplete="off"> Enter Date + alt="Enter Date" src="themes/default/images/jscalendar.gif"> {$MOD.LBL_LISTNEWSALES_DATE_END}: + value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" + id="date_send_to" name="date_send_to" autocomplete="off"> Enter Date + src="themes/default/images/jscalendar.gif"> + id="account_name" tabindex="" name="account_name"> + name="account_id"> + onclick="{literal}open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"SearchFormListNewSales","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);{/literal}" + value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex="" + name="btn_account_name"> + value="{if $POST.date_from!=''}{$POST.date_from}{/if}" id="date_from" name="date_from" + autocomplete="off"> Enter Date + src="themes/default/images/jscalendar.gif"> do: + value="{if $POST.date_to!=''}{$POST.date_to}{/if}" id="date_to" name="date_to" autocomplete="off"> Enter Date + src="themes/default/images/jscalendar.gif"> + name="parent_order_no">
-

{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę wysyłki{/if}

+

{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę + wysyłki{/if}

+ value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button"> + onclick="createMultiPdf()"> + value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY}" onclick="getSelected(); getList();"> + value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY} 2" onclick="getSelected(); getList2();"> + onclick="getSelected(); getList3();">
{if $LINK!=''}{$LINK}{/if} - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - {foreach from=$POSITION_LIST key="key" item="item" name="components"} - {if $item.id!=''} - - - - + + - - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + +
{$MOD.LBL_LISTNEWSALES_POS}{$MOD.LBL_LISTNEWSALES_NUMBER}{$MOD.LBL_LISTNEWSALES_DESCRIPTION}{$MOD.LBL_LISTNEWSALES_PARENT_NAME}{$MOD.LBL_LISTNEWSALES_DELIVERY_DATE}Termin wysyłki{$MOD.LBL_LISTNEWSALES_QUANTITY}{$MOD.LBL_LISTNEWSALES_TOTAL_NETTO}{$MOD.LBL_LISTNEWSALES_TOTAL_VAT}{$MOD.LBL_LISTNEWSALES_TOTAL_BRUTTO}{$MOD.LBL_LISTNEWSALES_TOTAL_INVOICE}{$MOD.LBL_LISTNEWSALES_PERCENT}{$MOD.LBL_LISTNEWSALES_CURRENCY}{$MOD.LBL_LISTNEWSALES_PRINTED} 
{$MOD.LBL_LISTNEWSALES_POS}{$MOD.LBL_LISTNEWSALES_NUMBER}{$MOD.LBL_LISTNEWSALES_DESCRIPTION}{$MOD.LBL_LISTNEWSALES_PARENT_NAME}{$MOD.LBL_LISTNEWSALES_DELIVERY_DATE}Termin wysyłki{$MOD.LBL_LISTNEWSALES_QUANTITY}{$MOD.LBL_LISTNEWSALES_TOTAL_NETTO}{$MOD.LBL_LISTNEWSALES_TOTAL_VAT}{$MOD.LBL_LISTNEWSALES_TOTAL_BRUTTO}{$MOD.LBL_LISTNEWSALES_TOTAL_INVOICE}{$MOD.LBL_LISTNEWSALES_PERCENT}{$MOD.LBL_LISTNEWSALES_CURRENCY}{$MOD.LBL_LISTNEWSALES_PRINTED} 
{$item.position} + {$item.position}{$item.document_no} - - {$item.parent_name} - {$item.delivery_date}{$item.send_date} {$item.quantity}{$item.total_netto|number_format:2:".":","}{$item.total_vat|number_format:2:".":","}{$item.total_brutto|number_format:2:".":","}{$item.total_invoice|number_format:2:".":","}{$item.percent} + + {$item.parent_name} + {if $item.delivery_name} + {if $item.delivery_id} +  ({$item.delivery_name}) + {else} +  ({$item.delivery_name}) + {/if} + {/if} + {$item.delivery_date} + {$item.send_date} {$item.quantity} + {$item.total_netto|number_format:2:".":","}{$item.total_vat|number_format:2:".":","} + + {$item.total_brutto|number_format:2:".":","} + {$item.total_invoice|number_format:2:".":","}{$item.percent} - - {$CURRENCIES[$item.currency]} - {if $item.type!='gratis'} - {if $item.fv_switch=='yes'}'{/if} - {if $item.fv_switch=='no'}{/if} - {if $item.wz_switch=='disabled'} {/if} - {if $item.wz_switch=='enabled'}{/if} - {else} - {if $item.rw_switch=='disabled'} {/if} - {if $item.rw_switch=='enabled'}{/if} - {/if} - -
Total{$item.products.order_total|number_format:2:".":","}{$item.products.wz_total|number_format:2:".":","}
+ {$item.products.minus|number_format:2:".":","} +
+ {$item.products.plus|number_format:2:".":","} +
+ + + {$CURRENCIES[$item.currency]} + + + {if $item.type!='gratis'} + {if $item.fv_switch=='yes'}'{/if} + {if $item.fv_switch=='no'}{/if} + {if $item.wz_switch=='disabled'} {/if} + {if $item.wz_switch=='enabled'}{/if} + {else} + {if $item.rw_switch=='disabled'} {/if} + {if $item.rw_switch=='enabled'}{/if} + {/if} + + + {/if} - {/foreach} + {/foreach} @@ -343,56 +350,58 @@ {$POSITION_LIST.total_brutto|number_format:2:".":","} {$POSITION_LIST.total_invoice|number_format:2:".":","} {$POSITION_LIST.total_percent|string_format:"%.2f"}% + onclick="{literal}if(document.getElementById('div_all').style.display=='none'){document.getElementById('div_all').style.display='block';}else{document.getElementById('div_all').style.display='none';}{/literal}"> + + {$va.code} + + {if $va.order>$va.wz} + {$va.order|number_format:2:".":","} + {$va.wz|number_format:2:".":","} + {else} + {$va.order|number_format:2:".":","} + {$va.wz|number_format:2:".":","} + {/if} + + + {/if} + {/foreach} + + Total + {$POSITION_LIST.total_product.order_total|number_format:2:".":","} + {$POSITION_LIST.total_product.wz_total|number_format:2:".":","} + + + + + + {$POSITION_LIST.total_product.minus|number_format:2:".":","} + + + + + + + {$POSITION_LIST.total_product.plus|number_format:2:".":","} + + + + + - \ No newline at end of file + \ No newline at end of file