Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

見積・発注・受注・請求で、住所のコピー元がなくても住所のコピーの選択肢が表示される不具合の修正 #1065

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions layouts/v7/modules/Inventory/partials/EditViewContents.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<label name="togglingHeader">{vtranslate('LBL_BILLING_ADDRESS_FROM', $MODULE)}</label>
</td>
<td class="fieldValue" name="copyAddress1">
<div class="radio">
<div class="radio{if $CHECK_ACCOUNTID eq false} hidden{/if}">
<label>
<input type="radio" name="copyAddressFromRight" class="accountAddress" data-copy-address="billing" checked="checked">
&nbsp;{vtranslate('SINGLE_Accounts', $MODULE)}
Expand Down Expand Up @@ -68,7 +68,7 @@
<label name="togglingHeader">{vtranslate('LBL_SHIPPING_ADDRESS_FROM', $MODULE)}</label>
</td>
<td class="fieldValue" name="copyAddress2">
<div class="radio">
<div class="radio{if $CHECK_ACCOUNTID eq false} hidden{/if}">
<label>
<input type="radio" name="copyAddressFromLeft" class="accountAddress" data-copy-address="shipping" checked="checked">
&nbsp;{vtranslate('SINGLE_Accounts', $MODULE)}
Expand Down
4 changes: 2 additions & 2 deletions layouts/v7/modules/PurchaseOrder/uitypes/Text.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{foreach from=$pickList key=keys item=value}
{if $keys eq 'vendor' or $keys eq 'contact' or $keys eq 'account'}
{$modl = ucfirst($keys|cat:"s")}
{if vtlib_isModuleActive($modl)}
{if vtlib_isModuleActive($modl) and array_key_exists($keys|cat:'_id', $RECORD_STRUCTURE['LBL_PO_INFORMATION'])}
<option value="{$keys}">{vtranslate($value,$MODULE)}</option>
{/if}
{else}
Expand All @@ -51,7 +51,7 @@
{foreach from=$pickList key=keys item=value}
{if $keys eq 'vendor' or $keys eq 'contact' or $keys eq 'account'}
{$modl = ucfirst($keys|cat:"s")}
{if vtlib_isModuleActive($modl)}
{if vtlib_isModuleActive($modl) and array_key_exists($keys|cat:'_id', $RECORD_STRUCTURE['LBL_PO_INFORMATION'])}
<option value="{$keys}">{vtranslate($value,$MODULE)}</option>
{/if}
{else}
Expand Down
11 changes: 11 additions & 0 deletions modules/Inventory/views/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ public function process(Vtiger_Request $request) {
$viewer->assign('CURRENTDATE', date('Y-n-j'));
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());

// 顧客企業が非表示項目である場合, コピーする住所の選択肢から削除する
$inventoryModules = array(
'Invoice' => 'LBL_INVOICE_INFORMATION',
'SalesOrder' => 'LBL_SO_INFORMATION',
// 'PurchaseOrder' => 'LBL_PO_INFORMATION', // POはテンプレート側で対応
'Quotes' => 'LBL_QUOTE_INFORMATION'
);
if ($inventoryModules[$moduleName] && $recordStructure[$inventoryModules[$moduleName]]) {
$viewer->assign('CHECK_ACCOUNTID', array_key_exists("account_id", $recordStructure[$inventoryModules[$moduleName]]));
}

$taxRegions = $recordModel->getRegionsList();
$defaultRegionInfo = $taxRegions[0];
unset($taxRegions[0]);
Expand Down