Lieferadressen haben jetzt einen (noch nutzlosen) Loeschenbutton, der ausgeblendet wird, wenn die Lieferadressen nicht 'echt' sind, oder wenn sie bereits vorhanen sind.
map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $query = qq|SELECT COUNT(shipto_id) AS used FROM (
+ SELECT shipto_id FROM oe UNION
+ SELECT shipto_id FROM ar UNION
+ SELECT shipto_id FROM delivery_orders
+ ) AS stid WHERE shipto_id = ? OR ? = 0|;
+ ($form->{shiptoused}) = selectfirst_array_query($form, $dbh, $query, ($form->{shipto_id})x2);
+
$sth->finish;
$dbh->disconnect;
CT->get_shipto(\%myconfig, \%$form);
print $cgi->header(), join '__pjx__', map $form->{"shipto$_"},
- qw(name department_1 department_2 street zipcode city country contact phone fax email);
+ qw(name department_1 department_2 street zipcode city country contact phone fax email used);
$lxdebug->leave_sub();
}
'Delete' => 'Löschen',
'Delete Account' => 'Konto löschen',
'Delete Dataset' => 'Datenbank löschen',
+ 'Delete Shipto' => 'Lieferadresse löschen',
'Delete delivery order' => 'Lieferschein löschen',
'Delete drafts' => 'Entwürfe löschen',
'Delete group' => 'Gruppe löschen',
'erfassen' => 'add',
'weiter' => 'continue',
'löschen' => 'delete',
+ 'lieferadresse_löschen' => 'delete_shipto',
'neue_ware' => 'new_part',
'speichern' => 'save',
'speichern_und_debitorenbuchung_erfassen' => 'save_and_ar_transaction',
'Pick List' => 'Sammelliste',
'Please enter values' => 'Bitte Werte eingeben',
'Postscript' => 'Postscript',
- 'Preis' => 'Preis',
- 'Preisklasse' => 'Preisgruppe',
'Price' => 'Preis',
'Price Factor' => 'Preisfaktor',
'Pricegroup' => 'Preisgruppe',
name = 'shipto_id',
id = 'shipto_id',
DATA = SHIPTO,
- onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail'])",
+ onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto])",
id_key = 'shipto_id',
label_sub = 'shipto_label',
label_key = 'shipto_label',
</tr>
</table>
+ <input type="submit" id="delete_shipto" name="delete_shipto" value="Lieferadresse löschen" disabled>
<br style="clear: left" />
</div>
Calendar.setup({ inputField : "toB", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_to" });
Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
//-->
+
+ function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
</script>
name = 'shipto_id',
id = 'shipto_id',
DATA = SHIPTO,
- onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail'])",
+ onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto])",
id_key = 'shipto_id',
label_sub = 'shipto_label',
label_key = 'shipto_label',
</tr>
</table>
+ <input type="submit" id="delete_shipto" name="delete_shipto" value="<translate>Delete Shipto</translate>" disabled>
<br style="clear: left" />
</div>
Calendar.setup({ inputField : "toB", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_to" });
Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
//-->
+
+ function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
</script>